Last Comment Bug 717224 - Misc libraries fail to link on mingw due to missing -luserenv
: Misc libraries fail to link on mingw due to missing -luserenv
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86 Windows 7
: -- normal (vote)
: mozilla12
Assigned To: Jacek Caban
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-11 06:08 PST by Jacek Caban
Modified: 2012-01-14 01:19 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix v1.0 (1.06 KB, patch)
2012-01-11 06:08 PST, Jacek Caban
netzen: review+
Details | Diff | Splinter Review

Description Jacek Caban 2012-01-11 06:08:57 PST
Created attachment 587676 [details] [diff] [review]
fix v1.0

MSVC builds use |#pragma comment(lib, "userenv.lib")| that is not supported in mingw. Since that file is compiled with many targets, maintaining it in OS_LIBS would be tricky. My patch adds userenv to default linked libraries. It won't affect targets that don't use it as it's skipped by linker if userenv is not used.
Comment 1 Brian R. Bondy [:bbondy] 2012-01-12 06:42:53 PST
If we're going to put it there I think we should remove the #pragma comment(lib, "userenv.lib") pls.
Comment 2 Jacek Caban 2012-01-13 01:59:03 PST
(In reply to Brian R. Bondy [:bbondy] from comment #1)
> If we're going to put it there I think we should remove the #pragma
> comment(lib, "userenv.lib") pls.

Note that with my patch it's still needed. I've added linker option in configure only for mingw builds, MSVC builds still use #pragma. I can move MSVC imports to configure as well if you prefer.
Comment 3 Brian R. Bondy [:bbondy] 2012-01-13 04:37:19 PST
Comment on attachment 587676 [details] [diff] [review]
fix v1.0

Review of attachment 587676 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry I didn't notice that, this looks good to me.
Comment 4 Brian R. Bondy [:bbondy] 2012-01-13 04:37:32 PST
Thanks for the patch.
Comment 5 Jacek Caban 2012-01-13 04:57:31 PST
Thanks for the review, pushed to m-i:

https://hg.mozilla.org/integration/mozilla-inbound/rev/d13c738c54ce
Comment 6 Marco Bonardo [::mak] 2012-01-14 01:19:19 PST
https://hg.mozilla.org/mozilla-central/rev/d13c738c54ce

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