diff options
author | Matt A. Tobin <email@mattatobin.com> | 2021-11-19 08:06:23 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2021-11-19 08:06:23 -0500 |
commit | 0caddc34f86c28aeeafb1d967872eca008db1974 (patch) | |
tree | f9dcab668e2ec89121f7ca0182b4e208cb861bf4 /system/evil/libxul.mk | |
parent | 1d64f7e91284f0a9c08a1f9edb2bb251e94bb59c (diff) | |
download | aura-central-0caddc34f86c28aeeafb1d967872eca008db1974.tar.gz |
Issue %3005 - Move toolkit/library to system/evil
Diffstat (limited to 'system/evil/libxul.mk')
-rw-r--r-- | system/evil/libxul.mk | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/system/evil/libxul.mk b/system/evil/libxul.mk new file mode 100644 index 000000000..835c2f60c --- /dev/null +++ b/system/evil/libxul.mk @@ -0,0 +1,57 @@ +# 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)/system/evil/libxul.mk + +ifeq (Linux,$(OS_ARCH)) +OS_LDFLAGS += -Wl,-version-script,symverscript + +symverscript: $(topsrcdir)/system/evil/symverscript.in + $(call py_action,preprocessor, \ + -DVERSION='xul$(MOZILLA_SYMBOLVERSION)' $< -o $@) + +EXTRA_DEPS += symverscript +endif + +# Generate GDB pretty printer-autoload files on Linux and Solaris. OSX's GDB is +# too old to support Python pretty-printers; if this changes, we could make +# this 'ifdef GNU_CC'. +ifeq (,$(filter-out SunOS Linux,$(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)/system/evil/libxul.so-gdb.py.in +LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir)) +endif + +ifeq ($(OS_ARCH),SunOS) +OS_LDFLAGS += -Wl,-z,defs +endif + +# 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. +ifneq (OpenBSD,$(OS_TARGET)) +ifneq (WINNT,$(OS_TARGET)) +ifdef LD_IS_BFD +OS_LDFLAGS += $(topsrcdir)/system/evil/StaticXULComponents.ld +endif +endif +endif + +ifdef _MSC_VER +get_first_and_last = dumpbin -exports $1 | grep _NSModule@@ | sort -k 3 | sed -n 's/^.*?\([^@]*\)@@.*$$/\1/;1p;$$p' +else +get_first_and_last = $(TOOLCHAIN_PREFIX)nm -g $1 | grep _NSModule$$ | grep -vw refptr | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p' +endif + +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 + +ifeq (,$(filter-out SunOS Linux,$(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 +endif |