summaryrefslogtreecommitdiff
path: root/toolkit/library/libxul.mk
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-11-13 11:46:33 +0000
committerMoonchild <moonchild@palemoon.org>2023-11-13 11:46:33 +0000
commita36a691826d9ea9ad4c564f2d27905f267a5e53d (patch)
treed4507995775ce9fff688d937693f911b85c0bf13 /toolkit/library/libxul.mk
parent9816215ea7461dfbb1707809344b5d569ad615e3 (diff)
parent98f59fb96c80bb8664e0931eaead9c70898ed5a5 (diff)
downloaduxp-a36a691826d9ea9ad4c564f2d27905f267a5e53d.tar.gz
Merge pull request 'Use elfdump on SunOS instead of readelf.' (#2380) from athenian200/UXP:sunos-elfdump-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2380
Diffstat (limited to 'toolkit/library/libxul.mk')
-rw-r--r--toolkit/library/libxul.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk
index 7b18c1f7e5..0636fcd400 100644
--- a/toolkit/library/libxul.mk
+++ b/toolkit/library/libxul.mk
@@ -37,6 +37,13 @@ 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)))
+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
+
+# It's safer to use elfdump on SunOS, because that's available on all
+# supported versions of Solaris and illumos.
+
+ifeq (SunOS,$(OS_ARCH))
+LOCAL_CHECKS += ; test "elfdump -p $1 | awk '$5 == "PT_LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0
+endif