Closed Bug 720621 Opened 9 years ago Closed 9 years ago

Crashes with "Text relocation are not supported" when built with NDK >= r6b

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 13

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file, 4 obsolete files)

The reason this happens is
http://code.google.com/p/android/issues/detail?id=23203

There are three possible ways to fix/workaround this:
- detect the problem in configure, and disable the new linker. Easy fix, but not future proof (the old linker will have to go eventually).
- detect the problem in configure, and hack around it. Might be tricky, but would allow to still use the new linker.
- Allow the new linker to handle text relocations. I have mixed feelings about this. This is going to be difficult to implement with bug 686805, and in general, text relocations add to startup time, and we should avoid them. They're also very easy to sneak in, and actually having the linker fail when there are make them very noticeable.

I'd go for option 2.
Blocks: 719985
Attachment #597720 - Flags: review?(ted.mielczarek)
Attachment #597722 - Flags: review?(ted.mielczarek)
Assignee: nobody → mh+mozilla
Comment on attachment 597722 [details] [diff] [review]
Avoid text relocations induced by NDK >= r6b - nspr part

I'm going to avoid modifying nspr.
Attachment #597722 - Attachment is obsolete: true
Attachment #597722 - Flags: review?(ted.mielczarek)
Attachment #597877 - Flags: review?(ted.mielczarek)
Attachment #597720 - Attachment is obsolete: true
Attachment #597720 - Flags: review?(ted.mielczarek)
Comment on attachment 597877 [details] [diff] [review]
Avoid text relocations induced by NDK >= r6b

Review of attachment 597877 [details] [diff] [review]:
-----------------------------------------------------------------

::: configure.in
@@ +4112,5 @@
> +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 -z "$MOZ_OLD_LINKER" -a "$OS_TARGET" = "Android"; then
> +  AC_CACHE_CHECK([whether the CRT objects have text relocations],
> +    CRT_HAS_TEXT_RELOCATIONS,

It's normal to use an ac_cv_foo-style variable for these.
Attachment #597877 - Flags: review?(ted.mielczarek) → review+
this patch seems to break the x86 android build. With it I get in the config.log: 

configure:12569: /home/blassey/android-ndk-r6b/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-android-linux-gcc -o conftest.so -shared -Wl,-z,defs  -mandroid -L/home/blassey/android-ndk-r6b/platforms/android-9/arch-x86/usr/lib -Wl,-rpath-link=/home/blassey/android-ndk-r6b/platforms/android-9/arch-x86/usr/lib --sysroot=/home/blassey/android-ndk-r6b/platforms/android-9/arch-x86 -llog -Wl,--allow-shlib-undefined  -L/home/blassey/android-ndk-r6b/sources/cxx-stl/stlport/libs/x86/ conftest.C  -lstlport_static 1>&2
/tmp/ccUYlM6L.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status


and this from configure:
checking whether the CRT objects have text relocations... configure: error: couldn't compile a simple C file
Brad, can you try this?
Attachment #597877 - Attachment is obsolete: true
This version works on both x86 and arm.
Attachment #598153 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/18166496af3d
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Depends on: 729067
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.