Closed Bug 1405326 Opened 3 years ago Closed 3 years ago

check for linker fails on Solaris

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox58 fixed)

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: petr.sumbera, Assigned: petr.sumbera)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170921064520

Steps to reproduce:

 0:14.78 checking for linker...
 0:14.78 DEBUG: Executing: `/usr/bin/gcc -print-prog-name=ld.gold`
 0:14.78 DEBUG: Executing: `/usr/bin/gcc -std=gnu99 -Wl,--version`
 0:14.78 DEBUG: The command returned non-zero exit status 1.
 0:14.78 DEBUG: Its error output was:
 0:14.78 DEBUG: | collect2 version 5.4.0
 0:14.78 DEBUG: | /usr/bin/ld -Y P,/lib/amd64:/usr/lib/amd64 -Qy /usr/lib/amd64/crt1.o /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/crtp.o /usr/lib/amd64/crti.o /usr/lib/amd64/values-Xa.o /usr/lib/amd64/values-xpg6.o /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/crtbegin.o -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0 -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../amd64 -L/lib/amd64 -L/usr/lib/amd64 -L/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../.. --version -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/crtend.o /usr/lib/amd64/crtn.o
 0:14.78 DEBUG: | ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.3120
 0:14.78 DEBUG: | Undefined                     first referenced
 0:14.78 DEBUG: |  symbol                           in file
 0:14.78 DEBUG: | main                                /usr/lib/amd64/crt1.o
 0:14.78 DEBUG: | ld: fatal: symbol referencing errors
 0:14.78 DEBUG: | collect2: error: ld returned 1 exit status
 0:14.78 ERROR: Command `/usr/bin/gcc -std=gnu99 -Wl,--version` failed with exit status 1.

This was already discussed here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1382364

The problem with the check is:
- Solaris ld continues to process with linking even when '--version' is present.
- version output is put on stderr
Component: Untriaged → Build Config
Product: Firefox → Core
Attached patch Bug1405326.patchSplinter Review
This is not ideal but for now it should be hopefully enough.
Attachment #8914758 - Flags: review?(sledru)
Comment on attachment 8914758 [details] [diff] [review]
Bug1405326.patch

You confirm that it works for you?
We should probably rename the function as it is no longer true
Yes. This work for me. Not sure about the name. The function is little bit confusing in general...
Assignee: nobody → petr.sumbera
Comment on attachment 8914758 [details] [diff] [review]
Bug1405326.patch

Works for me but Mike is the official reviewer.
I opened bug 1405982 to rename the method.
Attachment #8914758 - Flags: review?(sledru)
Attachment #8914758 - Flags: review?(mh+mozilla)
Attachment #8914758 - Flags: feedback+
Maybe my patch is wrong. After enabling more ldflags via:

https://bugzilla.mozilla.org/show_bug.cgi?id=1405345#c7

I see that I'm getting options safeguarded with 'cc_use_gnu_ld==1' (--version-script).
Ok probably not related. It's being set probably here:
https://searchfox.org/mozilla-central/source/security/nss/coreconf/config.gypi#41
Attachment #8914758 - Flags: review?(mh+mozilla) → review+
Keywords: checkin-needed
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/83b70c4e4ef9
check for linker fails on Solaris r=glandium
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/83b70c4e4ef9
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.