Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 2012 16:07:15 GMT
From:      Lee Thomas <lee_thomas@lthomas.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/164285: graphics/freeimage port has incorrect build flags, leading to conflicts with gtk
Message-ID:  <201201181607.q0IG7FOI084793@red.freebsd.org>
Resent-Message-ID: <201201181610.q0IGA91s093288@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164285
>Category:       ports
>Synopsis:       graphics/freeimage port has incorrect build flags, leading to conflicts with gtk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 18 16:10:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Lee Thomas
>Release:        FreeBSD 9.0-STABLE
>Organization:
>Environment:
FreeBSD Anon 9.0-STABLE FreeBSD 9.0-STABLE #0: Tue Jan 17 08:17:57 EST 2012     anon@Anon:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
FreeImage must be built with "-fvisibility=hidden" or its internal versions of libJPEG and libPNG will conflict with the system versions, when a program attempts to use both FreeImage and any library which itself uses those libraries - e.g. gtk or Qt. This yields run-time errors like "JPEG parameter struct mismatch: library thinks size is 632, caller expects 600". The FreeImage makefile has this flag, but it is overridden by the port's makefile. The attached patch simply adds it, and -fexceptions, which FreeImage also expects, back in. I don't know if any ports rely on both FreeImage and Gtk or Qt, but I ran into this issue using both FreeImage and Gtk from ports in our own codebase.
>How-To-Repeat:
Build freeimage from ports. Write a simple gtk app that links with gtk and freeimage. Depending on the link order, none of the icons (toolbar buttons, etc) will show up, and either gtk or freeimage will complain about library mismatches.
>Fix:


Patch attached with submission follows:

diff -u old/graphics/freeimage/Makefile fixed/graphics/freeimage/Makefile
--- old/graphics/freeimage/Makefile     2012-01-17 16:56:00.000000000 -0500
+++ fixed/graphics/freeimage/Makefile   2012-01-17 16:58:18.000000000 -0500
@@ -28,6 +28,8 @@
 
 .include <bsd.port.pre.mk>
 
+CFLAGS+= -fexceptions -fvisibility=hidden
+
 .if ${ARCH} == "amd64"
 CFLAGS+=	-fPIC
 .endif


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201181607.q0IG7FOI084793>