Open Bug 980169 Opened 6 years ago

Use of invalid -OPT compiler flags causing a build warning

Categories

(NSS :: Build, defect)

x86
Windows 7
defect
Not set

Tracking

(Not tracked)

People

(Reporter: RyanVM, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

WIN32.mk attempts to set -OPT:REF on both DLLFLAGS and LDFLAGS [1]. However, MSVC dropped support for -OPT being sent to cl.exe a few versions back. Therefore, it produces a warning like this:
> 2:57.43 cl : Command line warning D9002 : ignoring unknown option '-OP'
> 2:57.43 cl : Command line warning D9002 : ignoring unknown option '-OT'
> 2:57.43 cl : Command line warning D9002 : ignoring unknown option '-O:'
> 2:57.43 cl : Command line warning D9002 : ignoring unknown option '-OR'
> 2:57.43 cl : Command line warning D9002 : ignoring unknown option '-OE'
> 2:57.43 cl : Command line warning D9002 : ignoring unknown option '-OF'

The only way that passing these flags via cl.exe is supported is via the -link flag, which then forwards them on to the linker. However, there are a set of conditions which need to be met for that to even work. And given that we set LDFLAGS at the same time, I think it's safe to just drop the DLLFLAGS declaration outright. Sending -OPT to the MSVC linker was supported as far back as at least MSVC2003.

[1] http://mxr.mozilla.org/mozilla-central/source/security/nss/coreconf/WIN32.mk#141
You need to log in before you can comment on or make changes to this bug.