[Patch] Problem in building with 'ld -Wl,--as-needed'

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
evyscr
Atmospheric Pilot
Atmospheric Pilot
Posts: 1
Joined: Tue Mar 10, 2009 8:15 pm

[Patch] Problem in building with 'ld -Wl,--as-needed'

Post by evyscr »

Good daytime!

Since March 2006 in ALT Linux we have `ld -Wl,--as-needed` [*] by default. And with this configuration I get an error when building vegastrike caused by undefined references to libgtk+2 symbols. Reason is that gtk libs added to linker flags, while with ld with --as-needed will omit libraries not required by _previos_ objects.(Also, same behavior is with static linking.) Small patch (against 0.5.0) has fixed building for me:

Code: Select all

--- vegastrike-0.5.0/Makefile.am.orig   2008-04-24 16:16:50 +0400 
+++ vegastrike-0.5.0/Makefile.am        2009-03-07 19:44:53 +0300 
@@ -1074,7 +1074,7 @@ 
   tools/vsrextract.cpp \ 
   tools/vsrtools.h 
  
-vssetup_LDFLAGS = $(GTK_LIBS) 
+vssetup_LDADD = $(GTK_LIBS) 
  vssetup_CXXFLAGS= $(GTK_CFLAGS) 
  vssetup_SOURCES = \ 
     setup/src/c/setup.cpp \ 
[*] http://www.gentoo.org/proj/en/qa/asneeded.xml - some info about --as-needed and errors it detects in english

PS. I compiled vegastrike without OGRE, linking with which looks to have similar problem.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: [Patch] Problem in building with 'ld -Wl,--as-needed'

Post by loki1950 »

And welcome evyscr good idea to disable OGRE as we currently don't use any of it's functions :wink:
i think that the make files have been maybe taken for granted as we slowly get cmake working across all the platforms we support as i imaging you have gathered from the commit logs :wink: I think one of the dev group will pick this up soon.

Edit: Just remembered that building all packages as static is part of ALT's package/app management system 8)glad an other distro has found us hopefully we can find some way of putting the data set on a diet as we are a big download but the artists keep on producing content :wink:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Post Reply