Last Comment Bug 899948 - Build bustage on Windows when --disable-optimize is specified but not --enable-debug
: Build bustage on Windows when --disable-optimize is specified but not --enabl...
Status: RESOLVED WORKSFORME
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 All
-- normal (vote)
: ---
Assigned To: Makoto Kato [:m_kato]
:
: Jason Orendorff [:jorendorff]
Mentors:
: 900135 (view as bug list)
Depends on: 926760
Blocks: 853301
  Show dependency treegraph
 
Reported: 2013-07-31 02:05 PDT by :Gijs
Modified: 2014-01-27 07:24 PST (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description User image :Gijs 2013-07-31 02:05:35 PDT
Building with a mozconfig file that has --disable-optimize but not --enable-debug fails with this error:

11:20.38 msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: static double __cdecl std::numeric_limits<double>::max(void)" (?max@?$numeric_limits@N@std@@SANXZ) already defined in icuin.lib(digitlst.obj)
11:20.38
11:20.40    Creating library mozjs.lib and object mozjs.exp
11:20.40
11:20.40 mozjs.dll : fatal error LNK1169: one or more multiply defined symbols found

Removing --disable-optimize fixes it, and reports from IRC from markh indicate that builds with --enable-debug do also work.

(I also see:

11:20.40 LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
11:20.40

but I think I see that normally and it's unrelated)
Comment 1 User image Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-31 13:16:29 PDT
Hmm.  We're just building ICU the "normal" way, not doing anything special here.  There's probably some sort of Windows-specific oddness to do that will fix this.  Ted, maybe you know something about Windows and can help, or at least can suggest someone better-suited to helping?
Comment 2 User image Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-31 13:30:45 PDT
*** Bug 900135 has been marked as a duplicate of this bug. ***
Comment 3 User image Ted Mielczarek [:ted.mielczarek] 2013-08-12 09:16:06 PDT
Waldo and I looked at this in the office on Friday, it boils down to:
http://mxr.mozilla.org/mozilla-central/source/js/src/configure.in#4320

Passing --disable-release (but not --enable-debug) to ICU's runConfigureICU script, which means it won't wind up using either of {RELEASE,DEBUG}_{CFLAGS,CXXFLAGS}:
http://mxr.mozilla.org/mozilla-central/source/intl/icu/source/runConfigureICU#244
http://mxr.mozilla.org/mozilla-central/source/intl/icu/source/runConfigureICU#345

...which means that it doesn't wind up passing any CRT options to the compiler, so it winds up with the default (static) CRT, which conflicts with our selection of the CRT DLL.

This is arguably a bug in upstream ICU, but we could work around it by only passing --disable-release when MOZ_DEBUG is true. I suggested removing lines 4323 and 4324 in js/src/configure.in to collapse those two conditionals, which should work around this issue.
Comment 4 User image Frank Wein [:mcsmurf] 2013-10-13 00:31:38 PDT
BTW: I think this bug got a bit worse now that Bug 853301 is also enabled for normal desktop builds. This also breaks MSVC 2012/Windows 8 with a MT_StaticRelease vs. MD_DynamicRelease mismatch error when trying to link mozjs.dll. Unfortunately I do not have the exact error message handy anymore, but I can provide it if needed (it was certainly related to ICU). Maybe Bug 926083 is related, I'll try to find out (libxul fails to link for me with a very similiar error message even with normal optimize flags), but see that bug for more information.
Comment 5 User image Frank Wein [:mcsmurf] 2013-10-13 14:46:01 PDT
For reference: I think you can ignore the "is related" part in Comment 4, that bug was actually uncovered by another bug (even though it has a very similar error message).
Comment 6 User image Frank Wein [:mcsmurf] 2013-10-15 13:30:43 PDT
Note Bug 915735, this might fix this bug here as I understand it. ICU might get a seperate shared library to fix another bug.
Comment 7 User image Tim Abraldes [:TimAbraldes] [:tabraldes] 2013-11-07 21:55:42 PST
ping

Ted - are we still considering the option presented in comment 3?

Frank - Will the bug mentioned in comment 6 actually fix this issue?

Can I work around this issue by doing something sneaky like:
  ac_add_options --enable-optimize="-Od"
The above should disable optimization [1] but would trick configure into thinking we're still performing optimizations (maybe?). I started a build with this but I'll be asleep by the time it finishes so I'll let you know tomorrow whether it's a functioning workaround.

[1] http://msdn.microsoft.com/en-us/library/vstudio/aafb762y%28v=vs.100%29.aspx
Comment 8 User image Tim Abraldes [:TimAbraldes] [:tabraldes] 2013-11-07 23:09:38 PST
I'm still awake! Also my build seems to have successfully completed!

Yay workarounds!
Comment 9 User image Frank Wein [:mcsmurf] 2013-11-07 23:41:57 PST
Tim: I think so, but to be sure we could ask in the mentioned bug ;)
Comment 10 User image Ted Mielczarek [:ted.mielczarek] 2013-11-08 04:45:34 PST
Tim: feel free to implement my suggestion there. It seems like the most reasonable way to work around this. Also note bug 926760 which wants to get rid of runConfigureICU entirely (and may get fixed by way of bug 912371).
Comment 11 User image Tim Abraldes [:TimAbraldes] [:tabraldes] 2013-11-08 09:52:28 PST
I've got my workaround, so I'm happy. I'll just mark this bug as depending on bug 926760. If others want this issue fixed before bug 926760 lands, we can revisit the suggestion in comment 3.
Comment 12 User image Tim Abraldes [:TimAbraldes] [:tabraldes] 2013-11-19 13:14:57 PST
Well, my workaround no longer works.

 0:14.47 msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: static double __cdecl std::numeric_limits<double>::infinity(void)" (?infinity@?$numeric_limits@N@std@@SANXZ) already defined in js_static.lib(digitlst.obj)
 0:14.47
 0:14.48    Creating library jsapi-tests.lib and object jsapi-tests.exp
 0:14.49
 0:14.50 LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
 0:14.50
 0:14.51 jsapi-tests.exe : fatal error LNK1169: one or more multiply defined symbols found
 0:14.52
 0:14.53 c:/src/mc2/js/src/config/rules.mk:768: recipe for target 'jsapi-tests.exe' failed
 0:14.53 mozmake.EXE[4]: *** [jsapi-tests.exe] Error 1169
 0:14.53 c:/src/mc2/js/src/config/recurse.mk:99: recipe for target 'jsapi-tests/binaries' failed
 0:14.54 mozmake.EXE[3]: *** [jsapi-tests/binaries] Error 2

I guess it's time to actually try to fix this
Comment 13 User image Makoto Kato [:m_kato] 2013-12-09 01:49:51 PST
I think that this is fixed by bug 912371.  Does this issue still occur?
Comment 14 User image Rodrigo Silveira [:rsilveira] [:rodms] 2013-12-10 09:35:26 PST
I was able to compile fine with --disable-optimize on latest fx-team.
Comment 15 User image Makoto Kato [:m_kato] 2013-12-10 17:13:44 PST
(In reply to Rodrigo Silveira [:rsilveira] from comment #14)
> I was able to compile fine with --disable-optimize on latest fx-team.

Thank you for verified.

Note You need to log in before you can comment on or make changes to this bug.