Closed Bug 1478228 Opened 7 years ago Closed 7 years ago

Avoid R_ARM_V4BX relocations on android builds

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

Building Firefox for Android with lld fails with errors like: /builds/worker/workspace/build/src/clang/bin/ld.lld: error: can't create dynamic relocation R_ARM_V4BX against local symbol in readonly segment; recompile object files with -fPIC >>> defined in ../../gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.o >>> referenced by ../../gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.o:(.text+0x4F0) This is actually because those relocations are not supported by lld (filed https://bugs.llvm.org/show_bug.cgi?id=38303) but they are also not necessary for us. As a matter of fact, they are plain ignored by gold, because they only apply when one wants to maintain binary compatibility with ARMv4, which is not something we need for Android (they are used to locate `bx lr` instructions). The fact only two objects compiled from assembly files contain such relocations proves that the compiler doesn't emit them for `bx lr` instructions, as well as the assembler doesn't emit them for *other* assembly files, like the ones from libvpx or ffvpx, or openmax, etc., which means it's surely possible. "Just" have to find how.
So the reason those relocations are there is because the source assembly files contain `.object_arch armv4` *and* they are built with gas (through the use of -no-integrated-as), because the clang assembler doesn't support all the syntax in those files. Other files do have `.object_arch armv4` but not -no-integrated-as, and in that case, the relocations are not emitted.
Comment on attachment 8994797 [details] Bug 1478228 - Avoid R_ARM_V4BX relocations on android builds. https://reviewboard.mozilla.org/r/259338/#review266312 ::: gfx/cairo/libpixman/src/moz.build:139 (Diff revision 1) > if use_arm_neon_gcc: > DEFINES['USE_ARM_NEON'] = True > SOURCES += ['pixman-arm-neon.c'] > SOURCES['pixman-arm-neon.c'].flags += CONFIG['NEON_FLAGS'] > > +if CONFIG['OS_TARGET'] == 'Android' and (use_arm_simd_gcc or use_arm_simd_gcc): `use_arm_simd_gcc or use_arm_simd_gcc` doesn't seem correct. Is one of those supposed to be `use_arm_neon_gcc`?
Comment on attachment 8994797 [details] Bug 1478228 - Avoid R_ARM_V4BX relocations on android builds. https://reviewboard.mozilla.org/r/259338/#review266318
Attachment #8994797 - Flags: review?(nfroyd) → review+
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/ef50d6c4450d Avoid R_ARM_V4BX relocations on android builds. r=froydnj
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: