Closed
Bug 1243349
Opened 9 years ago
Closed 9 years ago
Firefox fails to link against nspr libraries
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox47 fixed)
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: nbp, Assigned: ted)
References
Details
Attachments
(1 file)
After running "mach build --verbose", and pretty printing the command line (/…/ represent the build directory of an debug x64 build), I noticed that we are trying to link against nspr libraries, while not providing the correct directory path.
I guess this implies that if the build is successful, we might be linking against system libraries, which is not possible while building on NixOS, as /lib does not exists.
I think the problem might be that we give twice -L/…/dist/lib instead of giving -L/…/dist/bin, where libnspr4.so is located (even on Linux systems).
gcc
-shared
-m64
-Wl,--gc-sections
-Wl,-z,defs
-Wl,-soname
-Wl,libnssutil3.so
-Wl,--version-script,/…/security/nss/lib/util/nssutil.def
-o /…/security/nss/lib/util/libnssutil3.so
/…/security/nss/lib/util/quickder.o
[…]
/…/security/nss/lib/util/utilpars.o
-L/…/dist/lib
-L/…/dist/lib
-lplc4
-lplds4
-lnspr4
-lpthread
-ldl
-lc
0:06.11 /nix/store/v7h3j43vx0dz5ahhkxg5z50by2iqc6k1-binutils-2.23.1/bin/ld: cannot find -lplc4
0:06.11 /nix/store/v7h3j43vx0dz5ahhkxg5z50by2iqc6k1-binutils-2.23.1/bin/ld: cannot find -lplds4
0:06.12 /nix/store/v7h3j43vx0dz5ahhkxg5z50by2iqc6k1-binutils-2.23.1/bin/ld: cannot find -lnspr4
0:06.12 collect2: error: ld returned 1 exit status
$ find /…/dist -name lib\*.\*
[…]
/…/dist/bin/libplds4.so
[…]
/…/dist/bin/libnspr4.so
[…]
/…/dist/bin/libplc4.so
[…]
Assignee | ||
Comment 1•9 years ago
|
||
Oops, I broke this in bug 1230117. Apparently this is working by accident on my machine and in automation by linking against the system NSPR libs (although we're packaging our NSPR libs, so we're using those). I have a patch that seems to work.
Assignee: nobody → ted
Blocks: 1230117
Comment 2•9 years ago
|
||
ted was able to find the cause where the library path is incorrectly set to dist/lib following a series of patches to remove the configure step from NSS.
In the meantime the workaround is to set LD_LIBRARY_PATH to dist/bin. As I understand it, the reason it compiles successfully on CI is because the build machines have libnspr4-dev installed.
Updated•9 years ago
|
Summary: Firefox failed to link against nspr libraries. → Firefox fails to link against nspr libraries
Assignee | ||
Comment 3•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/32605/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/32605/
Attachment #8712667 -
Flags: review?(mh+mozilla)
Updated•9 years ago
|
Attachment #8712667 -
Flags: review?(mh+mozilla) → review+
Comment 4•9 years ago
|
||
Comment on attachment 8712667 [details]
MozReview Request: bug 1243349 - fix NSPR link paths for NSS. r?gps
https://reviewboard.mozilla.org/r/32605/#review29331
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b538734b6a1794e791c376196cd9212ba9835353
bug 1243349 - fix NSPR link paths for NSS. r=glandium
Comment 6•9 years ago
|
||
backed out for bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=20574193&repo=mozilla-inbound
Flags: needinfo?(ted)
Assignee | ||
Comment 9•9 years ago
|
||
Assignee | ||
Comment 10•9 years ago
|
||
That try push looks good, aside from some unrelated bustage I apparently picked up from inbound.
Flags: needinfo?(ted)
Assignee | ||
Comment 11•9 years ago
|
||
Comment on attachment 8712667 [details]
MozReview Request: bug 1243349 - fix NSPR link paths for NSS. r?gps
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32605/diff/1-2/
Attachment #8712667 -
Attachment description: MozReview Request: bug 1243349 - fix NSPR link paths for NSS. r?glandium → MozReview Request: bug 1243349 - fix NSPR link paths for NSS. r?gps
Attachment #8712667 -
Flags: review?(mshal)
Comment 12•9 years ago
|
||
Comment on attachment 8712667 [details]
MozReview Request: bug 1243349 - fix NSPR link paths for NSS. r?gps
https://reviewboard.mozilla.org/r/32605/#review29429
I don't see any issues here, though it's really hard to understand the impact on all the various configurations. Obviously that's not something we can easily fix first :)
Attachment #8712667 -
Flags: review?(mshal) → review+
Updated•9 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 13•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/94a70f108d118a9a22ea6719e1c37867fedf49c7
bug 1243349 - fix NSPR link paths for NSS. r=mshal
Comment 14•9 years ago
|
||
Would bug 1183027 be a consequence of this ? I remember the link failure was explicitely during some nspr link.
Flags: needinfo?(ted)
Assignee | ||
Comment 15•9 years ago
|
||
It's related to the same code I just touched. Assuming B2G doesn't build --with-system-nspr that issue should no longer occur. The Makefile we use to build NSS does some fiddly text substitution with -L to find the directory containing NSPR libs:
https://hg.mozilla.org/integration/mozilla-inbound/file/94a70f108d11/config/external/nss/Makefile.in#l100
Flags: needinfo?(ted)
Comment 17•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•