Closed Bug 458366 Opened 16 years ago Closed 8 years ago

CFLAGS set breaks jemalloc build

Categories

(Firefox Build System :: General, defect)

1.9.0 Branch
x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: swsnyder, Unassigned)

References

Details

Having the CFLAGS environment variable set at Firefox v3.0.3 build time breaks the build of jemalloc. The value of CFLAGS doesn't seem to matter. Without CFLAGS set : cl -D_CRT_NOFORCE_MANIFEST -D_STL_NOFORCE_MANIFEST -MP2 -O2 -DMOZ_MEMORY=1 -DMOZ_MEMORY_WINDOWS=1 -Z7 -Wp64 -D_X86_ -d1Binl -EHsc -GR -Istdhpp -I. -Fobuild\intel\dll_obj\ ti_inst.cpp ti_inst.cpp link -lib -nologo -out:build\intel\dll_obj\dllstuff.lib @build\intel\dll_obj\dllstuff.rsp With CFLAGS="-nologo" : cl -D_CRT_NOFORCE_MANIFEST -D_STL_NOFORCE_MANIFEST -nologo -TC -nologo -W3 -Gy -Fdmozcrt19.pdb -DNDEBUG -DTRIMMED -O1 -MP2 -O2 -DMOZ_MEMORY=1 -DMOZ_MEMORY_WINDOWS=1 -Z7 -Wp64 -D_X86_ -d1Binl -EHsc -GR -Istdhpp -I. -Fobuild\intel\dll_obj\ ti_inst.cpp ^M cl : Command line warning D9025 : overriding '/Fdbuild\intel\msvcrt.pdb' with '/Fdmozcrt19.pdb'^M cl : Command line warning D9025 : overriding '/O1' with '/O2'^M ti_inst.cpp^M c1 : fatal error C1007: unrecognized flag '-Binl' in 'c1'^M link -lib -nologo -out:build\intel\dll_obj\dllstuff.lib @build\intel\dll_obj\dllstuff.rsp^M LINK : fatal error LNK1181: cannot open input file 'build\intel\dll_obj\ti_inst.obj'^M In the second case that 1st instaance of the -nologo switch is the value of the defined CFLAGS environment variable. The 2nd instanace is among the extraneous switches inserted by ~/configure. This is building the official Firefox v3.0.3 source code with the VS2005/SP1 compiler. (For you non-MSVC people: the -nologo switch simply supresses the Microsoft banner on compiler execution. It is the most innocuous switch I could think of for testing this problem with CFLAGS/jemalloc.)
The CRT build is controlled by a bunch of goofy nmake build scripts. The default scripts don't actually build correctly, so we patch them to make them work, and to add in jemalloc. It's possible that there's some weirdness in one of them that does something wrong when CFLAGS is set.
Product: Firefox → Core
QA Contact: build.config → build-config
Version: 3.0 Branch → 1.9.0 Branch
Speaking of goofiness, this is enough to fix it: --- mozilla/memory/jemalloc/Makefile.in.original 2008-05-08 05:20:45.000000000 -0400 +++ mozilla/memory/jemalloc/Makefile.in 2008-10-06 09:21:43.000000000 -0400 @@ -103,9 +103,10 @@ # See bug 419470 NO_PROFILE_GUIDED_OPTIMIZE = 1 endif include $(topsrcdir)/config/rules.mk +CFLAGS= ifeq (Darwin,$(OS_TARGET)) LDFLAGS += -init _jemalloc_darwin_init endif I'm not submitting a patch because I'm sure there's a more elegant solution. Still, just the addition of the tweak above is enough to allow the build to complete.
(In reply to comment #2) > include $(topsrcdir)/config/rules.mk > +CFLAGS= > > ifeq (Darwin,$(OS_TARGET)) Note to anyone reading. That should be: +ifeq (WINNT,$(OS_TARGET)) +# bug #458366 +CFLAGS= +endif as just clearing CFLAGS will also disable compiler optimizations on non-Win32 builds.
Blocks: 586962
Let's just put this to bed.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.