Wrong DT_NEEDED entries in libxul.so and libxpcom.so on Android fennec builds

RESOLVED FIXED in mozilla7

Status

()

Core
Build Config
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

Trunk
mozilla7
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Taken from a nightly:

For libxpcom.so:
 0x00000001 (NEEDED)                     Shared library: [liblog.so]
 0x00000001 (NEEDED)                     Shared library: [libmozalloc.so]
 0x00000001 (NEEDED)                     Shared library: [libmozutils.so]
 0x00000001 (NEEDED)                     Shared library: [../../dist/lib/libxul.so]
 0x00000001 (NEEDED)                     Shared library: [libplds4.so]
 0x00000001 (NEEDED)                     Shared library: [libplc4.so]
 0x00000001 (NEEDED)                     Shared library: [libnspr4.so]
 0x00000001 (NEEDED)                     Shared library: [libdl.so]
 0x00000001 (NEEDED)                     Shared library: [../../dist/lib/libmozalloc.so]
 0x00000001 (NEEDED)                     Shared library: [libm.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so]

For libxul.so:
 0x00000001 (NEEDED)                     Shared library: [liblog.so]
 0x00000001 (NEEDED)                     Shared library: [libmozalloc.so]
 0x00000001 (NEEDED)                     Shared library: [libmozutils.so]
 0x00000001 (NEEDED)                     Shared library: [../../dist/lib/libmozsqlite3.so]
 0x00000001 (NEEDED)                     Shared library: [libsmime3.so]
 0x00000001 (NEEDED)                     Shared library: [libssl3.so]
 0x00000001 (NEEDED)                     Shared library: [libnss3.so]
 0x00000001 (NEEDED)                     Shared library: [libnssutil3.so]
 0x00000001 (NEEDED)                     Shared library: [libz.so]
 0x00000001 (NEEDED)                     Shared library: [libplds4.so]
 0x00000001 (NEEDED)                     Shared library: [libplc4.so]
 0x00000001 (NEEDED)                     Shared library: [libnspr4.so]
 0x00000001 (NEEDED)                     Shared library: [libdl.so]
 0x00000001 (NEEDED)                     Shared library: [../../dist/lib/libmozalloc.so]
 0x00000001 (NEEDED)                     Shared library: [libGLESv2.so]
 0x00000001 (NEEDED)                     Shared library: [libm.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so]

Our dynamic linker might be permissive, but this is still wrong (the ../../dist/lib paths)
Blocks: 584474
It turns out the problem is that libxul.so, libmozalloc.so and libmozsqlite3.so don't have an soname.
And this is due to --enable-wrap-malloc.
Created attachment 534751 [details] [diff] [review]
Fix MK{,C}SHLIB when using wrap-malloc
Attachment #534751 - Flags: review?(ted.mielczarek)
Corresponding try build:
http://tbpl.mozilla.org/?tree=Try&rev=660a27381d2c
Assignee: nobody → mh+mozilla
I don't really understand what's broken here. Can you expound?
(In reply to comment #5)
> I don't really understand what's broken here. Can you expound?

The DT_NEEDED entries in libxul.so and libxpcom.so contain paths (to the dist directory) instead of sonames for libxul.so, libmozsqlite3 and libmozalloc.so. DT_NEEDED is what the dynamic linker uses to know what libraries to load. It searches the DT_NEEDED values in the ld.so.config paths and LD_LIBRARY_PATH. I haven't looked why exactly it doesn't care about the fact that some values contain a path already. I'd actually expect something similar to fail on a desktop environment.

This happens because these libraries are linked without the necessary -Wl,-h,$SONAME option passed to the linker, and this in turn happens because --enable-wrap-malloc resets the MKSHLIB value instead of adding what it wants to it.
Comment on attachment 534751 [details] [diff] [review]
Fix MK{,C}SHLIB when using wrap-malloc

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

Okay, thanks. I apparently failed to parse your changes the first time.
Attachment #534751 - Flags: review?(ted.mielczarek) → review+
http://hg.mozilla.org/mozilla-central/rev/58b25606c605
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.