Closed
Bug 1346602
Opened 4 years ago
Closed 4 years ago
GYP: NSS no longer builds on BSDs
Categories
(NSS :: Build, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
3.31
People
(Reporter: jbeich, Assigned: jbeich)
References
Details
(Keywords: regression)
Attachments
(1 file)
1.61 KB,
patch
|
ttaubert
:
review+
|
Details | Diff | Splinter Review |
$ ./build.sh NSPR [1/3] configure ... NSPR [2/3] make ... NSPR [3/3] install ... ninja: Entering directory `out/Debug' [407/899] SOLINK ../dist/Debug/lib/libfreebl3.so FAILED: ../dist/Debug/lib/libfreebl3.so ../dist/Debug/lib/libfreebl3.so.TOC if [ ! -e ../dist/Debug/lib/libfreebl3.so -o ! -e ../dist/Debug/lib/libfreebl3.so.TOC ]; then cc-shared -Wl,-Bsymbolic -Wl,--version-script,obj/lib/freebl/freebl3.gen/out.freebl.def -Wl,--gc-sections -Wl,--warn-unresolved-symbols -Wl,-z,defs -m64 -o ../dist/Debug/lib/libfreebl3.so -Wl,-soname=libfreebl3.so @../dist/Debug/lib/libfreebl3.so.rsp && { readelf -d ../dist/Debug/lib/libfreebl3.so| grep SONAME ; nm -gD -f p ../dist/Debug/lib/libfreebl3.so | cut -f1-2 -d' '; } > ../dist/Debug/lib/libfreebl3.so.TOC; else cc -shared -Wl,-Bsymbolic -Wl,--version-script,obj/lib/freebl/freebl3.gen/out.freebl.def -Wl,--gc-sections -Wl,--warn-unresolved-symbols -Wl,-z,defs -m64 -o ../dist/Debug/lib/libfreebl3.so -Wl,-soname=libfreebl3.so @../dist/Debug/lib/libfreebl3.so.rsp && { readelf -d ../dist/Debug/lib/libfreebl3.so | grep SONAME ; nm -gD -f p ../dist/Debug/lib/libfreebl3.so | cut -f1-2 -d' '; } > ../dist/Debug/lib/libfreebl3.so.tmp && if ! cmp -s ../dist/Debug/lib/libfreebl3.so.tmp ../dist/Debug/lib/libfreebl3.so.TOC; then mv ../dist/Debug/lib/libfreebl3.so.tmp ../dist/Debug/lib/libfreebl3.so.TOC ; fi; fi obj/lib/freebl/freebl3.sysrand.o: In function `RNG_SystemInfoForRNG': out/Debug/../../lib/freebl/unix_rand.c:872: undefined reference to `environ' out/Debug/../../lib/freebl/unix_rand.c:880: undefined reference to `environ' out/Debug/../../lib/freebl/unix_rand.c:882: undefined reference to `environ' cc: error: linker command failed with exit code 1 (use -v to see invocation) [416/899] CC obj/lib/sqlite/sqlite.sqlite3.o ninja: build stopped: subcommand failed.
Summary: GYP: no longer builds on BSDs → GYP: NSS no longer builds on BSDs
Keywords: regression
Comment 1•4 years ago
|
||
Isnt it the same thing as #1321317 ?
Comment hidden (obsolete) |
Doh, I didn't notice the order of flags changed. https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=d0ae97e800a0
Attachment #8846588 -
Flags: review?(ttaubert)
Comment 4•4 years ago
|
||
Comment on attachment 8846588 [details] [diff] [review] v0 Review of attachment 8846588 [details] [diff] [review]: ----------------------------------------------------------------- ::: coreconf/config.gypi @@ +223,5 @@ > '-Wl,-z,defs', > ], > + 'conditions': [ > + ['OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or OS=="openbsd"', { > + # Bug 1321317 - unix_rand.c:880: undefined reference to `environ' So... previously the condition here was: if (cc_use_gnu_ld==1) { if (OS==dragonfly|*bsd) { ... } if (no_zdefs==0) { ... } } Now we have: if (cc_use_gnu_ld==1) { if (no_zdefs==0) { if (OS==dragonfly|*bsd) { ... } } } Is that how you want it to be? I don't know which flags you exactly build with. It just seems weird that you now also need -Dno_zdefs=0 instead of previously only -Dcc_use_gnu_ld=1?
Here's an example that works on Linux or GNU/kFreeBSD but not on FreeBSD. Try adding -Wl,--warn-unresolved-symbols at various argument positions. $ cat a.c extern char **environ; int puts(const char *); void foo() { puts(*environ); } $ cc -fPIC -shared -Wl,-z,defs a.c -o a.so /tmp/a-6e65a2.o: In function `foo': a.c:(.text+0xb): undefined reference to `environ' cc: error: linker command failed with exit code 1 (use -v to see invocation) (In reply to Tim Taubert [:ttaubert] from comment #4) > So... previously the condition here was: > > if (cc_use_gnu_ld==1) { > if (OS==dragonfly|*bsd) { > ... > } > if (no_zdefs==0) { > ... > } > } -Wl,--warn-unresolved-symbols is only required if -Wl,-z,defs And no_zdefs==0 check didn't exist before bug 1330655. Going with pseudo-code it'd be if (cc_use_gnu_ld==1) { ... -Wl,-z,defs ... if (OS==dragonfly|*bsd) { ... } } > > Now we have: > > if (cc_use_gnu_ld==1) { > if (no_zdefs==0) { ... -Wl,-z,defs ... > if (OS==dragonfly|*bsd) { > ... > } > } > } > > Is that how you want it to be? I Correct. > also need -Dno_zdefs=0 instead of previously only -Dcc_use_gnu_ld=1? Because -Wl,-z,defs was previously under -Dcc_use_gnu_ld=1.
Comment 6•4 years ago
|
||
Comment on attachment 8846588 [details] [diff] [review] v0 Review of attachment 8846588 [details] [diff] [review]: ----------------------------------------------------------------- Makes sense. Thanks for explaining.
Attachment #8846588 -
Flags: review?(ttaubert) → review+
Yes, if possible also backport to 3.29 to help testing GYP build downstream.
Flags: needinfo?(jbeich)
Comment 9•4 years ago
|
||
https://hg.mozilla.org/projects/nss/rev/b210faf7a112
Target Milestone: --- → 3.31
Updated•4 years ago
|
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Assignee: nobody → jbeich
You need to log in
before you can comment on or make changes to this bug.
Description
•