* configure.ac: Add -static to LDFLAGS when using apple linker to

prevent it from pulling in dynamic linker.
This commit is contained in:
Vladimir Serbinenko 2013-11-25 05:47:20 +01:00
parent 5c066a81c2
commit 246a434f61
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2013-11-24 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Add -static to LDFLAGS when using apple linker to
prevent it from pulling in dynamic linker.
2013-11-24 Vladimir Serbinenko <phcoder@gmail.com>
Apple assembly doesn't handle symbol arithmetic well. So define an

View file

@ -673,8 +673,8 @@ if test x"$target_cpu" = xi386 || test x"$target_cpu" = xx86_64; then
if test x${target_cpu} != xi386 && test x$format = x${target_cpu}pe; then
continue
fi
CFLAGS="$TARGET_CFLAGS -static"
LDFLAGS="$TARGET_LDFLAGS -Wl,$format -nostdlib"
CFLAGS="$TARGET_CFLAGS"
LDFLAGS="$TARGET_LDFLAGS -Wl,$format -nostdlib -static"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
asm (".globl start; start:");
asm (".globl _start; _start:");
@ -825,7 +825,7 @@ fi
# Set them to their new values for the tests below.
CC="$TARGET_CC"
if test "x$TARGET_APPLE_LINKER" = x1 ; then
CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
CFLAGS="$TARGET_CFLAGS -nostdlib -static -Wno-error"
else
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
fi
@ -851,7 +851,7 @@ fi
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x)
if test "x$TARGET_APPLE_LINKER" = x1 ; then
CFLAGS="$TARGET_CFLAGS -nostdlib"
CFLAGS="$TARGET_CFLAGS -nostdlib -static"
else
CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
fi