Closed Bug 101249 Opened 23 years ago Closed 14 years ago

security/manager/Makefile.in doesn't effectively pass optimizer flags to NSS

Categories

(Core :: Security: PSM, defect, P3)

1.8 Branch
x86
Linux
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: frb, Assigned: KaiE)

References

Details

Attachments

(1 file)

I ran configure with --enable-optimize="-O -gstabs" on solaris so I can debug NSS is compiling opt code without -gstabs the expected behaviour is for the CFLAGS to be global across the tree Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4)
Myth, it's difficult to do what you want. NSS cannot use Mozilla client's CFLAGS as is. It may work to combine Mozilla client's CFLAGS with NSS's CFLAGS, but the common compiler flags would appear twice on the command line. One reasonable compromise is to pass the value of CFLAGS that is specified in the environment when Mozilla's configure is invoked to NSS as XCFLAGS. NSS's build system appends $(XCFLAGS) to its CFLAGS. This means you will have to specify -gstabs in the CFLAGS environment variable, not in the argument to --enable-optimize, for Mozilla's configure. Note: the XCFLAGS variable of NSS's build system is equivalent to the CFLAGS variable as described in Sec. 14.3 of GNU Make Version 3.75 Beta documentation (page 134). Perhaps NSS's build system should follow the suggestion in that section: use ALL_CFLAGS in makefile rules for C compilation and use CFLAGS (as opposed to the "non-standard" XCFLAGS) for users to specify additional C compiler options.
Status: NEW → ASSIGNED
Summary: NSS doesn't take CFLAGS set with configure → NSS doesn't take CFLAGS set with configure
*** Bug 157545 has been marked as a duplicate of this bug. ***
Priority: -- → P3
Version: unspecified → 3.2
I've tried using XCFLAGS and nss doesn't seem to respect them.
How about OPTIMIZER?
*** Bug 235266 has been marked as a duplicate of this bug. ***
Attached patch v1.0Splinter Review
Setting XCFLAGS seems to work but I don't think that's what we really want since XCFLAGS appends the flags to the commandline. Setting OPTIMIZER overrides the default optimize/debug flags which is what we'd expect when setting CFLAGS or --enable-optimize. This patch fixes the bug when using --enable-optimize. To make it work when setting CFLAGS, we'd have to also use $(OS_CFLAGS) which can contain other potentially troublesome flags set by mozilla (-pedantic & -pthread come to mind).
Attachment #143477 - Flags: review?(wchang0222)
Wan-Teh, what do you think about this patch? It would be nice to have it.
QA Contact: wtchang → build
Attachment #143477 - Flags: review?(nelson)
mozilla/security/manager/Makefile.in is not part of NSS. This bug is filed against NSS, but the patch offered is not a patch to NSS.
Assignee: wtchang → kengert
Status: ASSIGNED → NEW
Component: Build → Security: PSM
Product: NSS → Core
QA Contact: build
Summary: NSS doesn't take CFLAGS set with configure → security/manager/Makefile.in doesn't effectively pass optimizer flags to NSS
Version: 3.2 → 1.8 Branch
Comment on attachment 143477 [details] [diff] [review] v1.0 I generally don't review patches to files outside of NSS, except at the request of the module/component owner.
Attachment #143477 - Flags: review?(nelson)
QA Contact: psm
Patch is 6 years old, patch no longer applies, code has completely changed, code no longer mentions OPTIMIZER. If you still want a change, please reopen. Marking wontfix.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Attachment #143477 - Flags: review?(wtc)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: