mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1442468 - Remove workaround for http://code.google.com/p/android/issues/detail?id=23203. r=froydnj
That NDK bug has been fixed since r8c, and we now require something more recent than that. This effectively reverts the changes from bug 720621 and bug 734832. --HG-- extra : rebase_source : 9ff76a790ec4135dc0172cfd0f11fc1ecef7df64
This commit is contained in:
parent
00c0357e61
commit
61d75ea276
@ -56,9 +56,6 @@ GetTid()
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
/* See mozglue/android/APKOpen.cpp */
|
||||
extern "C" MOZ_EXPORT __attribute__((weak)) void* __dso_handle;
|
||||
|
||||
/* Android doesn't have pthread_atfork defined in pthread.h */
|
||||
extern "C" MOZ_EXPORT int
|
||||
pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
|
||||
|
@ -59,22 +59,6 @@ void make_dumpable() {
|
||||
}
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
* To work around http://code.google.com/p/android/issues/detail?id=23203
|
||||
* we don't link with the crt objects. In some configurations, this means
|
||||
* a lack of the __dso_handle symbol because it is defined there, and
|
||||
* depending on the android platform and ndk versions used, it may or may
|
||||
* not be defined in libc.so. In the latter case, we fail to link. Defining
|
||||
* it here as weak makes us provide the symbol when it's not provided by
|
||||
* the crt objects, making the change transparent for future NDKs that
|
||||
* would fix the original problem. On older NDKs, it is not a problem
|
||||
* either because the way __dso_handle was used was already broken (and
|
||||
* the custom linker works around it).
|
||||
*/
|
||||
APKOPEN_EXPORT __attribute__((weak)) void *__dso_handle;
|
||||
}
|
||||
|
||||
typedef int mozglueresult;
|
||||
|
||||
enum StartupEvent {
|
||||
|
@ -1654,42 +1654,6 @@ dnl gnu style tables anyways.
|
||||
LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
|
||||
fi
|
||||
|
||||
dnl The custom linker doesn't support text relocations, but NDK >= r6b
|
||||
dnl creates some (http://code.google.com/p/android/issues/detail?id=23203)
|
||||
dnl We however want to avoid these text relocations, and this can be done
|
||||
dnl by making gcc not link crtbegin and crtend. In the broken NDKs, crtend
|
||||
dnl doesn't contain anything at all, beside placeholders for some sections,
|
||||
dnl and crtbegin only contains a finalizer function that calls
|
||||
dnl __cxa_finalize. The custom linker actually takes care of calling
|
||||
dnl __cxa_finalize when the library doesn't call it itself, which makes it
|
||||
dnl safe not to link crtbegin. Besides, previous versions of the NDK didn't
|
||||
dnl link crtbegin and crtend at all.
|
||||
if test -n "$MOZ_LINKER" -a "$OS_TARGET" = "Android"; then
|
||||
AC_CACHE_CHECK([whether the CRT objects have text relocations],
|
||||
ac_cv_crt_has_text_relocations,
|
||||
[echo 'int foo() { return 0; }' > conftest.cpp
|
||||
if AC_TRY_COMMAND(${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5) &&
|
||||
test -s conftest${DLL_SUFFIX}; then
|
||||
if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
|
||||
ac_cv_crt_has_text_relocations=yes
|
||||
else
|
||||
ac_cv_crt_has_text_relocations=no
|
||||
fi
|
||||
else
|
||||
AC_ERROR([couldn't compile a simple C file])
|
||||
fi
|
||||
rm -rf conftest*])
|
||||
if test "$ac_cv_crt_has_text_relocations" = yes; then
|
||||
dnl While we want libraries to skip the CRT files, we don't want
|
||||
dnl executables to be treated the same way. We thus set the flag
|
||||
dnl in DSO_LDOPTS and not LDFLAGS. However, to pass it to nspr,
|
||||
dnl we need to use LDFLAGS because nspr doesn't inherit DSO_LDOPTS.
|
||||
dnl Using LDFLAGS in nspr is safe, since we only really build
|
||||
dnl libraries there.
|
||||
DSO_LDOPTS="$DSO_LDOPTS -nostartfiles"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl End of C++ language/feature checks
|
||||
AC_LANG_C
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user