diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-02-01 12:05:28 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-02-01 12:05:53 -0800 |
commit | 84802b66197c623735aaca875b8e1a39cb0ef085 (patch) | |
tree | 7e81ea8b26ef4f24e613c1ba8478a048b94ace92 /configure.ac | |
parent | 08dc1a371f7b0b88b3961fd37cca8a1717a94a7d (diff) | |
download | emacs-84802b66197c623735aaca875b8e1a39cb0ef085.tar.gz |
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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
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 opsys=qnxnto test -z "$CC" && CC=qcc CFLAGS="$CFLAGS -D__NO_EXT_QNX" - LDFLAGS="-N2MB $LDFLAGS" + if test "$with_unexec" = yes; then + LDFLAGS="-N2MB $LDFLAGS" + fi ;; ## Intel 386 machines where we don't care about the manufacturer. @@ -1501,7 +1503,7 @@ esac test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ= LD_SWITCH_SYSTEM= -case "$opsys" in +test "$with_unexec" = no || case "$opsys" in freebsd|dragonfly) ## Let 'ld' find image libs and similar things in /usr/local/lib. ## The system compiler, GCC, has apparently been modified to not @@ -5379,6 +5381,15 @@ case "$opsys" in cygwin) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000" ;; darwin) + if test "$HAVE_NS" = "yes"; then + libs_nsgui="-framework AppKit" + if test "$NS_IMPL_COCOA" = "yes"; then + libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon" + fi + else + libs_nsgui= + fi + LD_SWITCH_SYSTEM_TEMACS=$libs_nsgui ## The -headerpad option tells ld (see man page) to leave room at the ## end of the header for adding load commands. Needed for dumping. ## 0x1000 is enough for roughly 52 load commands on the x86_64 @@ -5387,15 +5398,9 @@ case "$opsys" in ## about 14 to about 34. Setting it high gets us plenty of slop and ## only costs about 1.5K of wasted binary space. headerpad_extra=1000 - if test "$HAVE_NS" = "yes"; then - libs_nsgui="-framework AppKit" - if test "$NS_IMPL_COCOA" = "yes"; then - libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon" - fi - else - libs_nsgui= + if test "$with_unexec" = yes; then + LD_SWITCH_SYSTEM_TEMACS="-fno-pie $LD_SWITCH_SYSTEM_TEMACS -Xlinker -headerpad -Xlinker $headerpad_extra" fi - LD_SWITCH_SYSTEM_TEMACS="-fno-pie $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" ## This is here because src/Makefile.in did some extra fiddling around ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in |