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

RESOLVED FIXED in Firefox 13

Status

()

defect
RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
Firefox 13
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

Assignee

Description

8 years ago
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
Assignee

Comment 1

7 years ago
Attachment #597720 - Flags: review?(ted.mielczarek)
Assignee

Comment 2

7 years ago
Attachment #597722 - Flags: review?(ted.mielczarek)
Assignee

Updated

7 years ago
Assignee: nobody → mh+mozilla
Assignee

Comment 3

7 years ago
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)
Assignee

Comment 4

7 years ago
Attachment #597877 - Flags: review?(ted.mielczarek)
Assignee

Updated

7 years ago
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
Assignee

Comment 7

7 years ago
Brad, can you try this?
Assignee

Updated

7 years ago
Attachment #597877 - Attachment is obsolete: true
Assignee

Comment 8

7 years ago
This version works on both x86 and arm.
Assignee

Updated

7 years ago
Attachment #598153 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/18166496af3d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13

Updated

7 years ago
Depends on: 729067
You need to log in before you can comment on or make changes to this bug.