+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
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:");
# 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
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