After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 545427 - valac fails to link on Cygwin/MinGW
valac fails to link on Cygwin/MinGW
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.3.x
Other Cygwin
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-30 04:23 UTC by Yaakov Selkowitz
Modified: 2008-07-30 21:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0.3.4 as-needed patch (824 bytes, patch)
2008-07-30 04:28 UTC, Yaakov Selkowitz
committed Details | Review

Description Yaakov Selkowitz 2008-07-30 04:23:03 UTC
valac fails to link on Cygwin (and MinGW).  This occurs because it puts the link flags before the compiled object files, and binutils in PE/COFF requires the required libraries to be on the command line after the object files requiring their symbols.  (This is similar to -as-needed on Linux.)

I'm attaching a patch which fixes this.
Comment 1 Yaakov Selkowitz 2008-07-30 04:28:20 UTC
Created attachment 115540 [details] [review]
0.3.4 as-needed patch

* gobject/valaccodecompiler.vala (Vala.CCodeCompiler.compile):
Place pkg-config flags and Xcc flags at the end of the command line, so that the object files precede the link libraries.  Required for linking on Cygwin and MinGW.  Fixes bug 545427.
Comment 2 Jürg Billeter 2008-07-30 21:32:28 UTC
2008-07-30  Jürg Billeter  <j@bitron.ch>

	* gobject/valaccodecompiler.vala:

	Fix linking with --as-needed and on Windows,
	patch by Yaakov Selkowitz, fixes bug 545427

Fixed in r1728.