summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-08-28 16:23:16 +0300
committerTor Lillqvist <tml@iki.fi>2012-09-24 17:00:44 +0300
commitcff0c7d492432842c45a9628e579a60b2ca5d542 (patch)
treecd83dddf9838bf6fec3033b4562ed0792297cd63 /configure.in
parentadd80cede10c3f4afb811cdbc9d5c151a0fbf412 (diff)
Further changes for an attempt to use the faulty.lib linker on Android
Change-Id: Ib9422711e981ff63d6e4f197c2e04a25c22e8adc
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 02ad841174b0..51397f6847c2 100644
--- a/configure.in
+++ b/configure.in
@@ -225,6 +225,26 @@ if test -n "$with_android_ndk"; then
test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-gcc $ANDROIDCFLAGS"
test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-g++ $ANDROIDCXXFLAGS"
+
+ AC_MSG_CHECKING([whether the CRT objects have text relocations])
+ echo 'int foo() { return 0; }' > conftest.cpp
+ if AC_TRY_COMMAND(${CXX} -shared -o conftest.so conftest.cpp 1>&5) &&
+ test -s conftest.so; then
+ if $android_gcc_prefix-readelf -d conftest.so | grep -q TEXTREL; then
+ crt_has_text_relocations=yes
+ else
+ crt_has_text_relocations=no
+ fi
+ else
+ AC_ERROR([couldn't compile a simple C file])
+ fi
+ AC_MSG_RESULT([$crt_has_text_relocations])
+ rm -rf conftest*
+ if test $crt_has_text_relocations = yes; then
+ # We should build only libraries for Android anyway, no executables
+ CXX="$CXX -nostartfiles"
+ CC="$CC -nostartfiles"
+ fi
fi
AC_SUBST(ANDROID_NDK_HOME)
AC_SUBST(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)