FS#20805 - [freeimage] has to be compiled with -fvisibility=hidden flag

Attached to Project: Community Packages
Opened by Sebastian Ziebarth (voeck) - Friday, 10 September 2010, 20:33 GMT
Last edited by Stefan Husmann (stefanhusmann) - Tuesday, 14 September 2010, 03:17 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Stefan Husmann (stefanhusmann)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
freeimage links against its own static versions of libjpeg, libpng etc. The symbols in these libraries are exposed if the -fvisibility=hidden flag is missing. In the Makefile the required flag is set but the CFLAGS get overwritten by makepkg's CFLAGS from /etc/makepkg.conf. The Makefile needs to be patched to make sure that -fvisibility=hidden will still be in the CFLAGS. Otherwise a program linked to libjpeg and freeimage will most probably segfault.

Steps to reproduce:
- Use the freeimage package from the community repository
- Link a program against libjpeg and freeimage
- Call functions from libjpeg

This might not directly happen in reality. But the issue also matters if a program links against libjpeg and a library which is linked against freeimage (i.e. OGRE).
This task depends upon

Closed by  Stefan Husmann (stefanhusmann)
Tuesday, 14 September 2010, 03:17 GMT
Reason for closing:  Fixed
Comment by Stefan Husmann (stefanhusmann) - Saturday, 11 September 2010, 02:17 GMT
Does it help to simply put !makeflags to the options array in the PKGBUILD?
Comment by Sebastian Ziebarth (voeck) - Sunday, 12 September 2010, 20:33 GMT
No, that has no effect. The CFLAGS are still overwritten.

I guess some patch should be applied to Makefile.gnu which replaces their "-O3" by the flags from /etc/makepkg.conf
Comment by Stefan Husmann (stefanhusmann) - Sunday, 12 September 2010, 21:14 GMT
Maybe you can test the attached files. This seems to work, but further testing cannot harm.
Comment by Stefan Husmann (stefanhusmann) - Sunday, 12 September 2010, 21:40 GMT
I guess i will have to do the same for Makefile.fip, for the c++ lib.
Comment by Stefan Husmann (stefanhusmann) - Sunday, 12 September 2010, 22:18 GMT
-2 should do it.

Loading...