Opened 9 years ago

Closed 9 years ago

Last modified 10 months ago

#4833 closed defect

BUILD: Link error when building without engines

Reported by: salty-horse Owned by: fingolfin
Priority: normal Component: Port: Linux
Keywords: build Cc:
Game:

Description

Using latest svn.

Building without engines is useful for testing non-engine functionality quickly.
However, when configuring scummvm with --disable-all-engines, the final linking operation fails:

$ g++ -lm backends/platform/sdl/events.o backends/platform/sdl/graphics.o backends/platform/sdl/hardwarekeys.o backends/platform/sdl/main.o backends/platform/sdl/sdl.o base/libbase.a engines/libengines.a gui/libgui.a graphics/libgraphics.a sound/libsound.a backends/libbackends.a common/libcommon.a sound/softsynth/mt32/libmt32.a -lvorbisfile -lvorbis -logg -lFLAC -logg -lmad -lasound -lz -lfluidsynth -L/usr/lib -lSDL -o scummvm

/home/ori/clang-crash/scummvm-git/gui/saveload.cpp:247: undefined reference to `SaveStateDescriptor::getBool(Common::String const&) const'
/home/ori/clang-crash/scummvm-git/backends/events/default/default-events.cpp:107: undefined reference to `g_engine'

I managed to fix this by moving engines/libengines.a and graphics/libgraphics.a (on which some engines, like gob, depend) to be right after backends/libbackends.a.

The attached patch changes the order of the "engines" module to be after "backends".
I have tested that this successfully builds both --disable-all-engines and --enable-all-engines

Ticket imported from: #2976619. Ticket imported from: bugs/4833.

Attachments (1)

module-order.patch (373 bytes) - added by salty-horse 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by salty-horse

Attachment: module-order.patch added

comment:1 Changed 9 years ago by fingolfin

I cannot reproduce the issue on Mac OS X, but this is not the first time the OS X linker accepts stuff which Linux / GNU ld does not like. Since the patch has no negative effects for me, and you say it fixes issues on Linux, I just committed it.

Thanks!

comment:2 Changed 9 years ago by fingolfin

Owner: set to fingolfin
Status: newclosed

comment:3 Changed 10 months ago by digitall

Component: Port: Linux
Note: See TracTickets for help on using tickets.