1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 # You can obtain one at http://mozilla.org/MPL/2.0/.
5 EXTRA_DEPS
+= $(topsrcdir
)/toolkit
/library
/libxul.mk
7 ifeq (Linux
,$(OS_ARCH
))
8 ifneq (Android
,$(OS_TARGET
))
9 OS_LDFLAGS
+= -Wl
,-version-script
,symverscript
11 symverscript
: $(topsrcdir
)/toolkit
/library
/symverscript.in
12 $(call py_action
,preprocessor
, \
13 -DVERSION
='xul$(MOZILLA_SYMBOLVERSION)' $< -o
$@
)
15 EXTRA_DEPS
+= symverscript
20 ifeq (WINNT
,$(OS_TARGET
))
21 ifndef MOZ_HAS_WINSDK_WITH_D3D
23 -LIBPATH
:'$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_D3D_CPU_SUFFIX)' \
29 # Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
30 # too old to support Python pretty-printers; if this changes, we could make
31 # this 'ifdef GNU_CC'.
32 ifeq (Linux
,$(OS_ARCH
))
33 # Create a GDB Python auto-load file alongside the libxul shared library in
34 # the build directory.
35 PP_TARGETS
+= LIBXUL_AUTOLOAD
36 LIBXUL_AUTOLOAD
= $(topsrcdir
)/toolkit
/library
/libxul.so-gdb.py.in
37 LIBXUL_AUTOLOAD_FLAGS
:= -Dtopsrcdir
=$(abspath
$(topsrcdir
))
40 # BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
41 # exists. Using an implicit linker script to make it fold that section in
42 # .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
43 # script however makes gold misbehave, first because it doesn't like that
44 # the linker script is given after crtbegin.o, and even past that, replaces
45 # the default section rules with those from the script instead of
46 # supplementing them. Which leads to a lib with a huge load of sections.
47 ifneq (OpenBSD
,$(OS_TARGET
))
48 ifneq (WINNT
,$(OS_TARGET
))
50 OS_LDFLAGS
+= $(topsrcdir
)/toolkit
/library
/StaticXULComponents.
ld
56 get_first_and_last
= dumpbin
-exports
$1 | grep _NSModule@@ |
sort -k
3 | sed
-n
's/^.*?\([^@]*\)@@.*$$/\1/;1p;$$p'
58 get_first_and_last
= $(TOOLCHAIN_PREFIX
)nm
-g
$1 | grep _NSModule
$$ | grep
-vw refptr |
sort | sed
-n
's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
61 LOCAL_CHECKS
= test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo
"NSModules are not ordered appropriately" && exit
1 || exit
0
63 ifeq (Linux
,$(OS_ARCH
))
64 LOCAL_CHECKS
+= ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD
" { t += 1 } END { print t }')" -le
1 && echo
"Only one PT_LOAD segment" && exit
1 || exit
0