Bug 509795

Summary: Unresolved allegro-dependency when linking with DevIL library
Product: [Fedora] Fedora Reporter: k-r.ernst
Component: DevILAssignee: Hans de Goede <hdegoede>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: hdegoede
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-15 17:34:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description k-r.ernst 2009-07-06 09:18:49 UTC
Description of problem:
Trying to link a program against one of the DevIL-libraries results in an unresolved-symbol error, which only goes away by linking in allegro too. This is bad, because the program doesn't use allegro at all, and such a workaround is not needed on any other distro.


Version-Release number of selected component (if applicable):
Happens in Fedora 11, but was also reported in earlier versions.

Steps to Reproduce:
1. Link a program with DevIL, but not allegro

Actual results:
Linker fails due to unresolved symbols.

Expected results:
DevIL should either not depend on allegro, like in other distributions, or should be linked against it by itself.

Additional info:
This is based on numerous user reports, so I apologize in advance if I made something up here.

Comment 1 Hans de Goede 2009-07-06 09:34:26 UTC
Hi,

Thanks for the report. First of all, can you provide some more details,
such as which program you're trying to compile, and if possible compiler output,
or if you've only got users saying so but don't use Fedora yourself, some
simple build instructions ?

About what you're seeing your program is most likely using DevIL's ILUT
(this is the only part which requires allegro). Which can do things such as
create windows, get keyboard input for you, etc. If it is not, then you
should not use -lILUT while linking.

It can do this using either allegro or SDL and Fedora's version supports
both methods.

The reason this makes it require allegro being linked into the binary using
it is that allegro uses some non PIC asm bits, which are part
of a library called liballeg_unsharable.a . Since libraries cannot contain non
PIC code, these bits need to put in the binary itself. So the fix
is to add -lalleg_unsharable when compiling on Fedora. I know this aint pretty,
but this is not Fedora specific (probably the other distro's have compiled DevIL without allegro support).

The good news is that liballeg_unsharable and does this problem is going away in
the next upstream allegro release for which allegro upstream currently has a testing release available.

Comment 2 k-r.ernst 2009-07-15 14:05:50 UTC
The program in question was the Spring RTS engine (http://springrts.com/). We use SDL for window / input handling, and it turned out that linking ILUT was unnecessary, IL and ILU where the only parts needed. Sorry for the trouble.

And yes, I don't have any fedora installation to test, so unfortunately I cannot test. Also, bugreports weren't that detailed.

Comment 3 Hans de Goede 2009-07-15 17:34:54 UTC
(In reply to comment #2)
> The program in question was the Spring RTS engine (http://springrts.com/). We
> use SDL for window / input handling, and it turned out that linking ILUT was
> unnecessary, IL and ILU where the only parts needed. Sorry for the trouble.
> 
> And yes, I don't have any fedora installation to test, so unfortunately I
> cannot test. Also, bugreports weren't that detailed.  

Ok, thanks for letting me know this is fixed now, closing this bug.