#35 Compile fails with --as-needed option (patch attached)

0.0.6
closed
Code (13)
5
2013-12-02
2010-07-22
No

opencity fails to link, when compiling with --as-needed option. This happens because some libraries to link included to LDFLAGS and it goes in compilation string before opencity objects.

Atached patch fixing that, moving LDFLAGS to end of link command.

Discussion

  • Duong Khang NGUYEN

    Hi there,

    Thank you for trying OpenCity. Could you give me more details about the way you compile OpenCity from sources ? Please give me the version of the compiler, make and linker you use. By the way, please mention any other information that you believe useful for me to debug.

    Regards

     
  • Vitaliy Tomin

    Vitaliy Tomin - 2010-07-23

    I've compiled it in openSUSE BuildService

    https://build.opensuse.org/package/show?package=opencity&project=games

    Build fails without patch on openSUSE 11.2 with gcc4.4 and openSUSE 11.3 with gcc 4.5.

    Buildlogs

    https://build.opensuse.org/package/rawlog?arch=x86_64&package=opencity&project=games&repository=openSUSE_11.3

    https://build.opensuse.org/package/rawlog?arch=x86_64&package=opencity&project=games&repository=openSUSE_11.2

    linker string with patch:

    g++ -std=c++98 -I/usr/X11R6/include -DNDEBUG -Wall -Wmissing-braces -Wparentheses -pedantic-errors -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libpng14 -o viewer viewer.o conf.o globalvar.o persistence.o property.o propertymanager.o texture.o ../src/model/libmodel.a ../src/pngfuncs/libpngfuncs.a ../src/structure/libstruct.a ../src/triangulation/libtriangulation.a ../src/tinyxml/libtinyxml.a ../src/tinyxpath/libtinyxpath.a -L/usr/X11R6/lib -L/usr/lib64 -lSDL -lpthread -lSDL_mixer -lpng14 -lSDL_net -lSDL_image -lGLU -lGL

    without it it was like this:

    g++ -std=c++98 -I/usr/X11R6/include -DNDEBUG -Wall -Wmissing-braces -Wparentheses -pedantic-errors -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/libpng14 -L/usr/X11R6/lib -L/usr/lib64 -lSDL -lpthread -lSDL_mixer -lpng14 -o viewer viewer.o conf.o globalvar.o persistence.o property.o propertymanager.o texture.o ../src/model/libmodel.a ../src/pngfuncs/libpngfuncs.a ../src/structure/libstruct.a ../src/triangulation/libtriangulation.a ../src/tinyxml/libtinyxml.a ../src/tinyxpath/libtinyxpath.a -lSDL_net -lSDL_image -lGLU -lGL

     
  • Duong Khang NGUYEN

    Hi there,

    Thank you for your quick reply. I have to investigate the problem because your patch modifies the Makefile.in files which are generated by automake. In the meaning time could you rerun the autogen.sh script to regenerate those files and try again ?

    Regards

     
  • Duong Khang NGUYEN

    • status: open --> pending
     
  • Duong Khang NGUYEN

    Hi there,

    Thank you for trying OpenCity.

    Concerning the --as-needed linker flag, you can now enable it with configure by using the --enable-as-needed prefix. This feature is only available in the SVN trunk and in the 0.0.6.4stable release.

    Could you tell me if it fixes your problem ?

    Thanks.

     
  • Duong Khang NGUYEN

    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks