aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-02-01 12:05:28 -0800
committerPaul Eggert2019-02-01 12:05:53 -0800
commit84802b66197c623735aaca875b8e1a39cb0ef085 (patch)
tree7e81ea8b26ef4f24e613c1ba8478a048b94ace92
parent08dc1a371f7b0b88b3961fd37cca8a1717a94a7d (diff)
downloademacs-84802b66197c623735aaca875b8e1a39cb0ef085.tar.gz
emacs-84802b66197c623735aaca875b8e1a39cb0ef085.zip
Omit some linker hacks if not doing unexec
* configure.ac (LDFLAGS, LD_SWITCH_SYSTEM_TEMACS): Omit some funky linker flags if not supporting unexec. Use macOS linker hacks only if needed * configure.ac: On darwin, link with -fno-pie and -headerpad only if configuring with unexec.
-rw-r--r--configure.ac25
1 files changed, 15 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 16491a95d56..40be0859aaa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -791,7 +791,9 @@ case "${canonical}" in
791 opsys=qnxnto 791 opsys=qnxnto
792 test -z "$CC" && CC=qcc 792 test -z "$CC" && CC=qcc
793 CFLAGS="$CFLAGS -D__NO_EXT_QNX" 793 CFLAGS="$CFLAGS -D__NO_EXT_QNX"
794 LDFLAGS="-N2MB $LDFLAGS" 794 if test "$with_unexec" = yes; then
795 LDFLAGS="-N2MB $LDFLAGS"
796 fi
795 ;; 797 ;;
796 798
797 ## Intel 386 machines where we don't care about the manufacturer. 799 ## Intel 386 machines where we don't care about the manufacturer.
@@ -1501,7 +1503,7 @@ esac
1501test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ= 1503test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ=
1502 1504
1503LD_SWITCH_SYSTEM= 1505LD_SWITCH_SYSTEM=
1504case "$opsys" in 1506test "$with_unexec" = no || case "$opsys" in
1505 freebsd|dragonfly) 1507 freebsd|dragonfly)
1506 ## Let 'ld' find image libs and similar things in /usr/local/lib. 1508 ## Let 'ld' find image libs and similar things in /usr/local/lib.
1507 ## The system compiler, GCC, has apparently been modified to not 1509 ## The system compiler, GCC, has apparently been modified to not
@@ -5379,6 +5381,15 @@ case "$opsys" in
5379 cygwin) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000" ;; 5381 cygwin) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000" ;;
5380 5382
5381 darwin) 5383 darwin)
5384 if test "$HAVE_NS" = "yes"; then
5385 libs_nsgui="-framework AppKit"
5386 if test "$NS_IMPL_COCOA" = "yes"; then
5387 libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon"
5388 fi
5389 else
5390 libs_nsgui=
5391 fi
5392 LD_SWITCH_SYSTEM_TEMACS=$libs_nsgui
5382 ## The -headerpad option tells ld (see man page) to leave room at the 5393 ## The -headerpad option tells ld (see man page) to leave room at the
5383 ## end of the header for adding load commands. Needed for dumping. 5394 ## end of the header for adding load commands. Needed for dumping.
5384 ## 0x1000 is enough for roughly 52 load commands on the x86_64 5395 ## 0x1000 is enough for roughly 52 load commands on the x86_64
@@ -5387,15 +5398,9 @@ case "$opsys" in
5387 ## about 14 to about 34. Setting it high gets us plenty of slop and 5398 ## about 14 to about 34. Setting it high gets us plenty of slop and
5388 ## only costs about 1.5K of wasted binary space. 5399 ## only costs about 1.5K of wasted binary space.
5389 headerpad_extra=1000 5400 headerpad_extra=1000
5390 if test "$HAVE_NS" = "yes"; then 5401 if test "$with_unexec" = yes; then
5391 libs_nsgui="-framework AppKit" 5402 LD_SWITCH_SYSTEM_TEMACS="-fno-pie $LD_SWITCH_SYSTEM_TEMACS -Xlinker -headerpad -Xlinker $headerpad_extra"
5392 if test "$NS_IMPL_COCOA" = "yes"; then
5393 libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon"
5394 fi
5395 else
5396 libs_nsgui=
5397 fi 5403 fi
5398 LD_SWITCH_SYSTEM_TEMACS="-fno-pie $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra"
5399 5404
5400 ## This is here because src/Makefile.in did some extra fiddling around 5405 ## This is here because src/Makefile.in did some extra fiddling around
5401 ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in 5406 ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in