~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to build/unix/elfhack/Makefile.in

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# This Source Code Form is subject to the terms of the Mozilla Public
3
 
# License, v. 2.0. If a copy of the MPL was not distributed with this
4
 
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
 
 
6
 
DEPTH           = @DEPTH@
7
 
topsrcdir       = @top_srcdir@
8
 
srcdir          = @srcdir@
9
 
VPATH           = @srcdir@
10
 
 
11
 
include $(DEPTH)/config/autoconf.mk
12
 
 
13
 
INTERNAL_TOOLS = 1
14
 
 
15
 
HOST_PROGRAM = elfhack
16
 
NO_DIST_INSTALL = 1
17
 
NO_PROFILE_GUIDED_OPTIMIZE = 1
18
 
 
19
 
VPATH += $(topsrcdir)/build
20
 
 
21
 
HOST_CPPSRCS = \
22
 
  elf.cpp \
23
 
  elfhack.cpp \
24
 
  $(NULL)
25
 
 
26
 
OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions
27
 
 
28
 
ifneq (,$(filter %86,$(TARGET_CPU)))
29
 
CPU := x86
30
 
else
31
 
ifneq (,$(filter arm%,$(TARGET_CPU)))
32
 
CPU := arm
33
 
else
34
 
CPU := $(TARGET_CPU)
35
 
endif
36
 
endif
37
 
 
38
 
CSRCS := \
39
 
  inject/$(CPU).c \
40
 
  inject/$(CPU)-noinit.c \
41
 
  test-ctors.c \
42
 
  test-array.c \
43
 
  $(NULL)
44
 
 
45
 
ifndef CROSS_COMPILE
46
 
CSRCS += dummy.c
47
 
endif
48
 
 
49
 
WRAP_LDFLAGS=
50
 
 
51
 
# need this to suppress errors due to /usr/include/linux/byteorder/swab.h
52
 
# on mozilla buildbots
53
 
OS_CXXFLAGS := $(filter-out -pedantic,$(OS_CXXFLAGS))
54
 
 
55
 
include $(topsrcdir)/config/rules.mk
56
 
 
57
 
test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack $(filter inject/%,$(CSRCS:.c=.$(OBJ_SUFFIX)))
58
 
        $(MKSHLIB) $(LDFLAGS) $< -nostartfiles
59
 
        @echo ===
60
 
        @echo === If you get failures below, please file a bug describing the error
61
 
        @echo === and your environment \(compiler and linker versions\), and use
62
 
        @echo === --disable-elf-hack until this is fixed.
63
 
        @echo ===
64
 
        # Fail if the library doesn't have $(DT_TYPE) .dynamic info
65
 
        $(TOOLCHAIN_PREFIX)readelf -d $@ | grep '($(DT_TYPE))'
66
 
        @rm -f $@.bak
67
 
        $(CURDIR)/elfhack -b -f $@
68
 
        # Fail if the backup file doesn't exist
69
 
        [ -f "$@.bak" ]
70
 
        # Fail if the new library doesn't contain less relocations
71
 
        [ $$($(TOOLCHAIN_PREFIX)objdump -R $@.bak | wc -l) -gt $$(objdump -R $@ | wc -l) ]
72
 
 
73
 
test-array$(DLL_SUFFIX): DT_TYPE=INIT_ARRAY
74
 
test-ctors$(DLL_SUFFIX): DT_TYPE=INIT
75
 
 
76
 
.PRECIOUS: test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX)
77
 
 
78
 
GARBAGE += test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX) test-array$(DLL_SUFFIX).bak test-ctors$(DLL_SUFFIX).bak
79
 
 
80
 
libs:: test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX)
81
 
 
82
 
ifndef CROSS_COMPILE
83
 
dummy: dummy.$(OBJ_SUFFIX)
84
 
        $(CC) -o $@ $^ $(LDFLAGS)
85
 
 
86
 
libs:: dummy
87
 
        # Will either crash or return exit code 1 if elfhack is broken
88
 
        LD_PRELOAD=$(CURDIR)/test-array$(DLL_SUFFIX) $(CURDIR)/dummy
89
 
        LD_PRELOAD=$(CURDIR)/test-ctors$(DLL_SUFFIX) $(CURDIR)/dummy
90
 
 
91
 
GARBAGE += dummy
92
 
endif
93
 
 
94
 
inject:
95
 
        $(NSINSTALL) -D $@
96
 
 
97
 
inject/%.c: inject.c $(call mkdir_deps,inject)
98
 
        cp $< $@
99
 
 
100
 
GARBAGE_DIRS += inject
101
 
 
102
 
inject/%.$(OBJ_SUFFIX): DEFINES += -DBITS=$(if $(HAVE_64BIT_OS),64,32)
103
 
inject/%.$(OBJ_SUFFIX): CFLAGS := -O2 -fno-stack-protector $(filter -m% -I%,$(CFLAGS))
104
 
inject/$(CPU)-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT
105
 
test.$(OBJ_SUFFIX): CFLAGS := -O0
106
 
host_elf.$(OBJ_SUFFIX) host_elfhack.$(OBJ_SUFFIX): elfxx.h