Bug 1471698 - Skip module order test if binaries are stripped by linker r?glandium draft
authorJacek Caban <jacek@codeweavers.com>
Tue, 26 Jun 2018 15:35:20 +0200
changeset 811546 33c9bdddc44df2991c43820c3052ca5db9e095b1
parent 811545 dc9a4263b207b7fe7c55ba3da9da8b8db7f61541
push id114339
push userbmo:jacek@codeweavers.com
push dateWed, 27 Jun 2018 19:31:33 +0000
reviewersglandium
bugs1471698
milestone60.1.0
Bug 1471698 - Skip module order test if binaries are stripped by linker r?glandium MozReview-Commit-ID: F9Tqz09wYw4
toolkit/library/libxul.mk
--- a/toolkit/library/libxul.mk
+++ b/toolkit/library/libxul.mk
@@ -10,19 +10,25 @@ EXTRA_DEPS += $(topsrcdir)/toolkit/libra
 ifeq (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)/toolkit/library/libxul.so-gdb.py.in
 LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
 endif
 
+# skip module order test if binaries are stripped by linker
+comma := ,
+ifeq (,$(filter -Wl$(comma)-s, $(OS_LDFLAGS)))
+
 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
 
+endif
+
 ifeq (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