Opened 12 years ago

Closed 11 years ago

Last modified 20 months ago

#3989 closed defect (fixed)

Linking fails when disabling certain engines

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: --Other--
Keywords: Cc:


Latest ScummVM SVN snapshot Unstable Debian (Linux)

If I disable the SCUMM and AGOS engines, I can no longer build ScummVM. (I don't usually disable engines like that, but it's occasionally useful, e.g. when doing regression testing.)

To clarify, --disable-scumm and --disable-agos were the only configuration options I used. The linker claims that:

backends/libbackends.a(compressed-saves.o): In function `wrapOutSaveFile(Common::WriteStream*)': /home/d91tan/src/CVS/scummvm+test/backends/saves/compressed/compressed-saves.cpp:35: undefined reference to `Common::wrapCompressedWriteStream(Common::WriteStream*)' backends/libbackends.a(compressed-saves.o): In function `wrapInSaveFile(Common::SeekableReadStream*)': /home/d91tan/src/CVS/scummvm+test/backends/saves/compressed/compressed-saves.cpp:31: undefined reference to `Common::wrapCompressedReadStream(Common::SeekableReadStream*)' collect2: ld returned 1 exit status make: *** [scummvm] Error 1

Ticket imported from: #2144834. Ticket imported from: bugs/3989.

Attachments (1)

makefile-hack.diff (536 bytes ) - added by jvprat 12 years ago.
Makefile hack

Download all attachments as: .zip

Change History (11)

comment:1 by jvprat, 12 years ago

I can't reproduce the issue with the current HEAD and gcc 4.1.2. Is it still broken for you?

comment:2 by eriktorbjorn, 12 years ago

It still happens for me, but now I have to disable the Broken Sword engines, as well. So this configuration still give me the error: --disable-sword2 --disable-sword1 --disable-agos --disable-scumm

comment:3 by lordhoto, 12 years ago

Configuring ScummVM with --disable-zlib will lead to the same linking problems later on.

comment:4 by jvprat, 12 years ago

There's a cyclic dependency between the "common" and "backends" modules, so changing the link order just gives this other error:

common/libcommon.a(system.o): In function `OSystem::getEventManager()': common/system.cpp:95: undefined reference to `DefaultEventManager::DefaultEventManager(OSystem*)'

I'm attaching a hack for the makefile which links "common" twice (before and after "backends") to solve this.

I'll continue evaluating other possible solutions but I guess this would involve moving code between those modules.

by jvprat, 12 years ago

Attachment: makefile-hack.diff added

Makefile hack

comment:5 by fingolfin, 11 years ago

We had to deal with similar issues in the past. The issues do not occur on Mac OS X, which is why I usually have a hard time catching them (I need to remote login to some Linux machine to fix such stuff).

Anyway, linking common & backend twice is of course a workaround, but not a proper solution for the problem, so I wouldn't accept it into trunk. I'll take a peek at the issue and how to resolve it.

comment:6 by eriktorbjorn, 11 years ago

I thought I'd give this one another try, after Fingolfin's recent barrage of patches. At the very least, the problem has changed. Doing systematic testing of which engines do and don't work is super-boring, but as an experiment I tried compiling ScummVM with only the AGOS engine, and got this linking error:

/home/d91tan/src/CVS/scummvm+test/engines/advancedDetector.cpp:353: undefined reference to `Common::md5_file_string(Common::FSNode const&, char*, unsigned int)' collect2: ld returned 1 exit status make: *** [scummvm] Error 1

comment:7 by fingolfin, 11 years ago

What is the status of this item?

comment:8 by eriktorbjorn, 11 years ago

I wasn't aware anything had been changed with regards to this, but the problem seems to be gone now. I was able to build every supported engine without any linking error. (I may have missed some, and I'm not going to try every combination) So I guess this can be closed.

comment:9 by eriktorbjorn, 11 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:10 by digitall, 20 months ago

Component: --Other--
Note: See TracTickets for help on using tickets.