Closed Bug 135027 Opened 23 years ago Closed 23 years ago

Invalid Flag Passed To ld on NetBSD/i386 using TOT source

Categories

(Directory :: LDAP C SDK, defect, P4)

x86
NetBSD
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.0.1

People

(Reporter: scott, Assigned: dmosedale)

References

()

Details

(Keywords: topembed-)

Attachments

(1 file, 5 obsolete files)

Using "top-of-tree" source checked out 04-02-2002, a NetBSD/i386 fails building because of an attempt to pass a C/C++ compiler option to /usr/bin/ld while building libldap50.so Repro steps: 1.Get top-of-tree source from CVS using gmake -f client.mk checkout 2. Set up a "snapshot" build environment per the instructions for "Building a Mozilla Release" on mozilla.org 3. gmake -f client.mk build Actual result: ======= making ./libldap50.so /usr/bin/ld -shared -Wl,-soname,libldap50.so -o libldap50.so ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o /usr/bin/ld: unrecognized option `-Wl,-soname,libldap50.so' gmake[6]: *** [libldap50.so] Error 1 gmake[6]: Leaving directory `/usr/local/src/mozilla/directory/c-sdk/ldap/libraries/libldap' gmake[5]: *** [install] Error 2 gmake[5]: Leaving directory `/usr/local/src/mozilla/directory/c-sdk/ldap/libraries' gmake[4]: *** [install] Error 2 gmake[4]: Leaving directory `/usr/local/src/mozilla/directory/c-sdk/ldap' gmake[3]: *** [install] Error 2 gmake[3]: Leaving directory `/usr/local/src/mozilla/directory/c-sdk' gmake[2]: *** [ldap] Error 2 gmake[2]: Leaving directory `/usr/local/src/mozilla' gmake[1]: *** [default] Error 2 gmake[1]: Leaving directory `/usr/local/src/mozilla' gmake: *** [build] Error 2 Expected result: A successful build with no errors. Additional information: 1. I am running NetBSD/i386 1.5.3_ALPHA. Don't let the ALPHA fool you. This is along the NetBSD 1.5 branch, where very few changes are made, and the code is always kept in a high-quality state. I'm fairly certain that this would repro on NetBSD/i386 1.5.2. 2. I set BUILD_OFFICIAL=1 and MOZILLA_OFFICIAL=1 3. My .mozconfig ac_add_options --disable-debug ac_add_options --disable-tests ac_add_options --enable-optimize ac_add_options --enable-crypto ac_add_options --without-system-jpeg ac_add_options --without-system-png ac_add_options --without-system-mng ac_add_options --without-system-zlib ac_add_options --without-system-nspr 4. This exact same source code builds fine on Linux, which is using a later version of GNU ld (2.11.2 vs 2.9.1 on NetBSD). As the later version of ld doesn't appear to take the "-Wl" flag, either, I'm assuming the configure script hosed up, and generated a makefile that uses ld for linking shared objects instead of cc/c++, as the -Wl flag is actually an option to the compiler, telling it to pass a flag along to the linker. 5. A full build log, along with any other information, is available upon request.
More LDAP bustage. We should really use the same defaults that were copied over from NSPR.
Assignee: seawood → mcs
Status: UNCONFIRMED → NEW
Component: Build Config → LDAP C SDK
Ever confirmed: true
Product: Browser → Directory
QA Contact: granrose → nobody
-> dmose
Assignee: mcs → dmose
Comment on attachment 77517 [details] [diff] [review] update config/NetBSD.mk to latest nsprpub version sr=sspitzer
Attachment #77517 - Flags: superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Per bug 138532, this fix needs to also go onto the 1.0 branch.
Blocks: 138348
Status: RESOLVED → REOPENED
Keywords: adt1.0.0, mozilla1.0
Resolution: FIXED → ---
Is this needed for the MachV beta, or can it be checked in after MachV branches from 1.0.
Keywords: topembed
Per drivers, this can wait until after MachV branches.
adding adt1.0.0- since this can wait until after Mach V branches.
Keywords: adt1.0.0adt1.0.0-
Comment on attachment 77517 [details] [diff] [review] update config/NetBSD.mk to latest nsprpub version a=asa (on behalf of drivers) for checkin to the 1.0 branch
Attachment #77517 - Flags: approval+
Whiteboard: [fixed on ldapcsdk_50_client_branch, trunk]
Target Milestone: --- → mozilla1.0
Status: REOPENED → ASSIGNED
Keywords: mozilla1.0mozilla1.0+
topembed- since this has no impact on embedding customers.
Keywords: topembedtopembed-
Scott, can you verify that this patch fixed your build problem on the trunk? (I thought that we didn't use the <arch>.mk files any longer but I could be mistaken wrt ldap.)
*** Bug 143990 has been marked as a duplicate of this bug. ***
I tried building the trunk, pulled today 05/13/2002 on NetBSD/i386 (1.5.3_RC2), and got the same error: /usr/bin/ld -shared -Wl,-soname,libldap50.so -o libldap50.so ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o /usr/bin/ld: unrecognized option `-Wl,-soname,libldap50.so'
Doh! Alright, I'll take another run at this.
Whiteboard: [fixed on ldapcsdk_50_client_branch, trunk]
Attached patch patch v2 (obsolete) — Splinter Review
OK, this patch tweaks configure.in. Scott, can you try it out? Specifically, you'll need to apply the patch to cd mozilla/directory/c-sdk patch < patch2.txt autoconf Then re-run the toplevel (mozilla/) configure, which will cause this configure to re-run, and then rebuild.
Attachment #77517 - Attachment is obsolete: true
I attempted to build with a clean RC2 tarball with the second proposed patch. I ran autoconf in the directory/c-sdk directory after applying the patch and configure in the mozilla/ directory. On make and got further problems: ======= making ./libldap50.so /usr/bin/ld -soname,libldap50.so -o libldap50.so ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048074 ./abandon.o: In function `do_abandon': ./abandon.o(.text+0x3eb): undefined reference to `ber_printf' ./abandon.o(.text+0x47c): undefined reference to `ber_free' ./add.o: In function `ldap_add_ext': ./add.o(.text+0x323): undefined reference to `ber_printf' ./add.o(.text+0x373): undefined reference to `ber_printf' ./add.o(.text+0x394): undefined reference to `ber_printf' ./add.o(.text+0x3bd): undefined reference to `ber_free' ./add.o(.text+0x3fe): undefined reference to `ber_free' ./cache.o: In function `nsldapi_add_result_to_cache': ./cache.o(.text+0x135): undefined reference to `ber_free' ./cache.o(.text+0x1ac): undefined reference to `time' ./cache.o(.text+0x1bf): undefined reference to `sprintf' <snip 150 to 200 lines of undefined referances>
Attached patch patch v3 (obsolete) — Splinter Review
Sounds like we're getting closer. This latest patch may fix the liblber problem; can someone with NetBSD give it a try? Thanks!
Attachment #83801 - Attachment is obsolete: true
The second hunk of patch v3 didn't apply cleanly to my tree, which is still from 5/13. I patched the three added lines in to the right spot in directory/c-sdk/ldap/libraries/libldap/Makefile.in myself, ran autoconf, and did a gmake -f client.mk build from the top of the tree, and this time I got: ======= making ./libldap50.a rm -f libldap50.a; /usr/bin/ar cr libldap50.a ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o; ranlib libldap50.a -L/usr/local/src/mozilla/dist/lib -llber50 ranlib: -L/usr/local/src/mozilla/dist/lib: No such file or directory That looks really weird, so I'm going to pull a whole new tree and take it home with me tonight (I pay for bandwidth by the KB so large transfers go over sneakernet) and see if I can get the patch to apply cleanly.
Well, that patch made a difference, but it appears that there are still problems. The first time I did a make I got this: ======= making ./libldap50.a rm -f libldap50.a; /usr/bin/ar cr libldap50.a ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o; ranlib libldap50.a -L/usr/chris/compile/mozilla/dist/lib -llber50 ranlib: -L/usr/chris/compile/mozilla/dist/lib: No such file or directory gmake[5]: *** [libldap50.a] Error 9 gmake[5]: Leaving directory `/usr/chris/compile/mozilla/directory/c-sdk/ldap/libraries/libldap' But interestingly the second time I ran make to reproduce the output, I got: ======= making ./libldap50.so /usr/bin/ld -soname,libldap50.so -o libldap50.so ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o -L/usr/chris/compile/mozilla/dist/lib -llber50 /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048074 ./cache.o: In function `nsldapi_add_result_to_cache': ./cache.o(.text+0x1ac): undefined reference to `time' ./cache.o(.text+0x1bf): undefined reference to `sprintf' ./charray.o: In function `ldap_charray_inlist': ./charray.o(.text+0x1c0): undefined reference to `strcasecmp' ./charray.o: In function `ldap_str2charray': ./charray.o(.text+0x2ad): undefined reference to `strchr' ./charray.o(.text+0x333): undefined reference to `strtok' ./charray.o: In function `ldap_charray_position': ./charray.o(.text+0x378): undefined reference to `strcasecmp' ./control.o: In function `ldap_control_copy_contents': ./control.o(.text+0x73b): undefined reference to `memmove' <Snip about 200 lines of undefined references> All of this was done on a clean RC2 tree.
Attached patch patch v4 (obsolete) — Splinter Review
This time for sure! :-)
Attachment #83852 - Attachment is obsolete: true
OK, added libc into the linkage. If someone could test, that'd be great...
Keywords: adt1.0.0-adt1.0.0, nsbeta1
Well, that helped in a way. I am still getting the following: ======= making ./libldap50.a rm -f libldap50.a; /usr/bin/ar cr libldap50.a ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o; ranlib libldap50.a -L/usr/chris/compile/mozilla/dist/lib -llber50 -lc ranlib: -L/usr/chris/compile/mozilla/dist/lib: No such file or directory gmake[5]: *** [libldap50.a] Error 9 gmake[5]: Leaving directory `/usr/chris/compile/mozilla/directory/c-sdk/ldap/libraries/libldap' If I attempt to make it again, I end up with undefined referances again. This time only about 5 of them showed up which all appear to be in libcompat. I went ahead and added -lcompat and got different errors: (keep in mind that this is the 2nd time I tried to run make, not the first) ======= making ./libldap50.so /usr/bin/ld -soname,libldap50.so -o libldap50.so ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o -L/usr/chris/compile/mozilla/dist/lib -llber50 -lc -lcompat /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048d50 /usr/lib/libc.so: undefined reference to `environ' /usr/lib/libc.so: undefined reference to `__progname' gmake[5]: *** [libldap50.so] Error 1 gmake[5]: Leaving directory `/usr/chris/compile/mozilla/directory/c-sdk/ldap/libraries/libldap'
Comment on attachment 83949 [details] [diff] [review] patch v4 OK, a friend set me up with an account on his NetBSD machine, and I think I see what's going on here. The short answer is that on NetBSD we should really be linking with $(CC), not $(LD). I'll try and poke at this more tommorrow.
Attachment #83949 - Flags: needs-work+
I'm still getting the same error with patch v4: ======= making ./libldap50.a rm -f libldap50.a; /usr/bin/ar cr libldap50.a ./abandon.o ./add.o ./bind.o ./cache.o ./charray.o ./charset.o ./compare.o ./compat.o ./control.o ./countvalues.o ./delete.o ./disptmpl.o ./dsparse.o ./error.o ./extendop.o ./free.o ./freevalues.o ./friendly.o ./getattr.o ./getdn.o ./getdxbyname.o ./getentry.o ./getfilter.o ./getoption.o ./getvalues.o ./memcache.o ./message.o ./modify.o ./open.o ./os-ip.o ./proxyauthctrl.o ./psearch.o ./referral.o ./regex.o ./rename.o ./request.o ./reslist.o ./result.o ./saslbind.o ./sbind.o ./search.o ./setoption.o ./sort.o ./sortctrl.o ./srchpref.o ./tmplout.o ./ufn.o ./unbind.o ./unescape.o ./url.o ./utf8.o ./vlistctrl.o; ranlib libldap50.a -L/usr/local/src/mozilla/dist/lib -llber50 -lc ranlib: -L/usr/local/src/mozilla/dist/lib: No such file or directory and since Chirs Ewert is getting that, as well, I guess it's a real problem and not just that crack I've been smoking.
Attached patch patch v5 (obsolete) — Splinter Review
This one compiles for me; more testing would be appreciated.
Attachment #83949 - Attachment is obsolete: true
I was able to successfuly build with this patch on NetBSD-1.5.2
Removing adt1.0.0 as there is no sr= for the latest patch.
Keywords: adt1.0.0
Discussed in mail news bug meeting. Decided to minus this bug because it is not required, strictly speaking. If you have a fix we can try to get it in.
Keywords: nsbeta1nsbeta1-
Target Milestone: mozilla1.0 → mozilla1.0.1
Priority: -- → P4
Attached patch patch v6Splinter Review
Merged to CVS tip.
Attachment #84092 - Attachment is obsolete: true
Comment on attachment 87572 [details] [diff] [review] patch v6 Carrying forward r=
Attachment #87572 - Flags: review+
Fix checked into the ldapcsdk_50_client_branch and the trunk. Still needs to land on the 1.0.1 branch.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Added adt1.0.1+
Keywords: adt1.0.1adt1.0.1+
Comment on attachment 87572 [details] [diff] [review] patch v6 Please land this on the 1.0.1 branch. Once there, replace the "mozilla1.0.1+" keyword with the "fixed1.0.1" keyword.
Attachment #87572 - Flags: approval+
Fix checked into the branch. I had to check version 5 into the branch, because cls' OpenBSD has not (yet?) landed there.
Spam for bug 129472
QA Contact: nobody → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: