2014-03-31 15:21:38 +04:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_DEPS += $( topsrcdir) /toolkit/library/libxul.mk
i f e q ( L i n u x , $( OS_ARCH ) )
i f n e q ( A n d r o i d , $( OS_TARGET ) )
Bug 1036894 part 9 - Replace all EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS with EXTRA_LIBS, OS_LIBS or OS_LDFLAGS, appropriately. r=gps
OS_LIBS for libraries that are not part of the gecko tree, EXTRA_LIBS for
libraries, such as NSPR, that are in the tree, but are not handled by
moz.build just yet. Those EXTRA_LIBS may also come from a system library.
However, in cases where the expanded variables are always empty for the
in-tree case, OS_LIBS is used (as for, e.g. MOZ_ZLIB_LIBS). OS_LDFLAGS is
used exclusively for non-library linker flags.
Always pass EXTRA_LIBS before OS_LIBS on linker command lines.
Forbid EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS in Makefiles.
2014-07-23 08:31:02 +04:00
OS_LDFLAGS += -Wl,-version-script,symverscript
2014-03-31 15:21:38 +04:00
symverscript : $( topsrcdir ) /toolkit /library /symverscript .in
$( call py_action,preprocessor, \
2014-07-23 08:29:09 +04:00
-DVERSION= 'xul$(MOZILLA_SYMBOLVERSION)' $< -o $@ )
2014-03-31 15:21:38 +04:00
EXTRA_DEPS += symverscript
e n d i f
e n d i f
i f d e f M O Z _ W E B R T C
i f e q ( W I N N T , $( OS_TARGET ) )
i f n d e f M O Z _ H A S _ W I N S D K _ W I T H _ D 3 D
Bug 1036894 part 9 - Replace all EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS with EXTRA_LIBS, OS_LIBS or OS_LDFLAGS, appropriately. r=gps
OS_LIBS for libraries that are not part of the gecko tree, EXTRA_LIBS for
libraries, such as NSPR, that are in the tree, but are not handled by
moz.build just yet. Those EXTRA_LIBS may also come from a system library.
However, in cases where the expanded variables are always empty for the
in-tree case, OS_LIBS is used (as for, e.g. MOZ_ZLIB_LIBS). OS_LDFLAGS is
used exclusively for non-library linker flags.
Always pass EXTRA_LIBS before OS_LIBS on linker command lines.
Forbid EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS in Makefiles.
2014-07-23 08:31:02 +04:00
OS_LDFLAGS += \
2014-05-03 02:31:05 +04:00
-LIBPATH:'$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_D3D_CPU_SUFFIX)' \
2014-03-31 15:21:38 +04:00
$( NULL)
e n d i f
e n d i f
e n d i f
# Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
# too old to support Python pretty-printers; if this changes, we could make
# this 'ifdef GNU_CC'.
i f e q ( L i n u x , $( OS_ARCH ) )
# Create a GDB Python auto-load file alongside the libxul shared library in
# the build directory.
PP_TARGETS += LIBXUL_AUTOLOAD
LIBXUL_AUTOLOAD = $( topsrcdir) /toolkit/library/libxul.so-gdb.py.in
LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir= $( abspath $( topsrcdir) )
e n d i f
2013-11-19 08:45:31 +04:00
# BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
# exists. Using an implicit linker script to make it fold that section in
# .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
# script however makes gold misbehave, first because it doesn't like that
# the linker script is given after crtbegin.o, and even past that, replaces
# the default section rules with those from the script instead of
# supplementing them. Which leads to a lib with a huge load of sections.
2014-08-26 11:47:02 +04:00
i f n e q ( O p e n B S D , $( OS_TARGET ) )
2014-08-27 18:16:49 +04:00
i f n e q ( W I N N T , $( OS_TARGET ) )
2013-11-19 08:45:31 +04:00
i f d e f L D _ I S _ B F D
Bug 1036894 part 9 - Replace all EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS with EXTRA_LIBS, OS_LIBS or OS_LDFLAGS, appropriately. r=gps
OS_LIBS for libraries that are not part of the gecko tree, EXTRA_LIBS for
libraries, such as NSPR, that are in the tree, but are not handled by
moz.build just yet. Those EXTRA_LIBS may also come from a system library.
However, in cases where the expanded variables are always empty for the
in-tree case, OS_LIBS is used (as for, e.g. MOZ_ZLIB_LIBS). OS_LDFLAGS is
used exclusively for non-library linker flags.
Always pass EXTRA_LIBS before OS_LIBS on linker command lines.
Forbid EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS in Makefiles.
2014-07-23 08:31:02 +04:00
OS_LDFLAGS += $( topsrcdir) /toolkit/library/StaticXULComponents.ld
2013-11-19 08:45:31 +04:00
e n d i f
2014-08-26 11:47:02 +04:00
e n d i f
2014-08-27 18:16:49 +04:00
e n d i f
2013-11-19 08:45:31 +04:00
2014-08-27 18:16:49 +04:00
i f d e f _ M S C _ V E R
2013-11-19 08:45:31 +04:00
get_first_and_last = dumpbin -exports $1 | grep _NSModule@@ | sort -k 3 | sed -n 's/^.*?\([^@]*\)@@.*$$/\1/;1p;$$p'
e l s e
2014-08-27 18:16:49 +04:00
get_first_and_last = $( TOOLCHAIN_PREFIX) nm -g $1 | grep _NSModule$$ | grep -vw refptr | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
2013-11-19 08:45:31 +04:00
e n d i f
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
i f e q ( L i n u x , $( OS_ARCH ) )
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
e n d i f