FS#31761 - [freeimage] cannot be used with libjpeg in the same program

Attached to Project: Community Packages
Opened by J. Berger (jmb) - Tuesday, 02 October 2012, 07:50 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 18 November 2014, 15:52 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
============

FreeImage includes its own copy of the image processing libraries (libjpeg, libpng, etc.) This will cause conflicts for programs that link against both FreeImage and the system libraries. In order to avoid these conflicts, upstream uses the "-fvisibility=hidden" flag to hide the private copies of the image libs from the users. Unfortunately, Arch's package overrides the compilation flags which removes the visibility flag.

I believe the following line should be added to the PKGBUILD:

export CFLAGS="$CFLAGS -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS"


Additional info:
================

* package version(s): 3.15.3-1


Steps to reproduce:
===================

This command should not print anything:

nm -D /usr/lib/libfreeimage.so | grep jpeg
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Tuesday, 18 November 2014, 15:52 GMT
Reason for closing:  Fixed
Comment by Doug Newgard (Scimmia) - Thursday, 06 November 2014, 15:17 GMT
The CFLAGS got removed from the package and it seems this problem is back.  FS#42696 
Comment by Alex (nylocx) - Thursday, 06 November 2014, 16:52 GMT
From the freeimage gnu makefile of the project I get the following two declarations.

CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -DNO_LCMS
CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy

I looked it up and the ?= assignment only does something if the left side isn't allready defined, which is not the case if using the makepkg tool.
So I guess the exports really are necessary.

Loading...