Closed Bug 311236 Opened 19 years ago Closed 1 year ago

Use the GNU linker flag --as-needed

Categories

(NSS :: Build, defect)

3.10.2
x86
Linux
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: wtc, Unassigned)

Details

Attachments

(4 files, 1 obsolete file)

In bug 297802, Julien added the Solaris linker flag
-z ignore to coreconf/SunOS5.mk (rev. 1.18).

I learned today that GNU linker has a --as-needed flag
that is equivalent to -z ignore.  But it seems that
it is a new feature and therefore is not supported
by all versions of GNU ld.  For example, I found that
--as-needed is documented in the ld(1) man page on
Red Hat Enterprise Linux 4 but not in the ld(1) man
page on RHEL 3.
QA Contact: wtchang → build
This is a patch for those who are using --as-needed support on linux to have proper linking, the --as-needed is only enabled if LDFLAGS are configured on a linux machine. This does not break anything if --as-needed is not enabled. I just ensures proper linking.
Jory, please submit your patch as an ordinary text file, the output of 
cvs diff -u5
and do not compress it before submitting it.  The server is quite capable
of compressing the file itself, and compressing it before submitting it 
defeats all of bugzilla's numerous patch analysis tools.
Attached patch as-neededSplinter Review
sorry about that ... I normally do not compress my patches but that was for gentoo ( oops ) ... here is a new one.
Attachment #242227 - Attachment is obsolete: true
Comment on attachment 250252 [details] [diff] [review]
as-needed

This attachment doesn't appear to be in the right format for a patch, but I'm going to try to set the patch flag on it anyway, just to see how bugzilla will handle it.
Attachment #250252 - Attachment is patch: true
Jory, did you attach the right patch?
This bug is about NSS, but your patch does not patch any file in NSS.
(In reply to comment #5)
> Jory, did you attach the right patch?
> This bug is about NSS, but your patch does not patch any file in NSS.
> 

That is cause most distros are using system nss/nspr which makes that patch completely userless. nss/nspr built out side of mozilla products such as firefox/thunderbird have no issues with as-need.
Here is one of two patches
Both patches convert to rpath wich is porper solution IMHO. it also enabled the proper linking for as-needed
Attached patch z defintionSplinter Review
Should also be applied for consistancy with the compiler
Attachment #250275 - Attachment is patch: true
Attachment #250276 - Attachment is patch: true
Attachment #250277 - Attachment is patch: true
Severity: normal → S3

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: wtc → nobody
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: