Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 449370 - media-gfx/gimp-2.8.2-r1 does not compile with clang
Summary: media-gfx/gimp-2.8.2-r1 does not compile with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Sebastian Pipping
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2012-12-30 23:43 UTC by Julian Ospald
Modified: 2014-01-25 18:55 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gimp-2.8.2-r1:20121230-233609.log.xz (gimp-2.8.2-r1:20121230-233609.log.xz,51.73 KB, application/x-xz)
2012-12-30 23:45 UTC, Julian Ospald
Details
use sed in the ebuild to exchange -u against -Wl,-u in Makefiles (gimp-clang.patch,554 bytes, patch)
2013-11-17 10:57 UTC, Walter Meinl
Details | Diff
patch for the ebuild (gimp-ebuild.patch,493 bytes, patch)
2013-12-01 22:48 UTC, Walter Meinl
Details | Diff
gimp-clang.patch (gimp-clang.patch,7.94 KB, patch)
2013-12-01 22:53 UTC, Walter Meinl
Details | Diff
patch for 2.8.10-r1.ebuild (gimp-clang.patch,569 bytes, patch)
2014-01-25 10:01 UTC, Walter Meinl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ospald 2012-12-30 23:43:53 UTC
# clang --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-pc-linux-gnu
Thread model: posix

# cat /etc/portage/env/clang
FEATURES="-ccache -buildpkg -distcc -splitdebug"
USE="clang"
CC=clang
CXX=clang++
CFLAGS="-march=core2 -O3 -Wall"
CXXFLAGS="${CFLAGS}"
Comment 1 Julian Ospald 2012-12-30 23:45:03 UTC
Created attachment 333814 [details]
gimp-2.8.2-r1:20121230-233609.log.xz
Comment 2 Sebastian Pipping gentoo-dev 2013-01-03 00:14:10 UTC
Honestly low priority to me right now.  Feel free to take over, patches welcome.
Comment 3 Julian Ospald 2013-01-03 05:27:17 UTC
I agree, it's actually an enhancement.
Comment 4 Walter Meinl 2013-11-17 10:51:19 UTC
The build failure was filed to upstream quite a while ago
https://bugzilla.gnome.org/show_bug.cgi?id=676389
It is because in a few Makefiles they use the option -u Symbol for linking which seems to work for gcc but not for clang.
Upstream fixed it for the trunk

https://git.gnome.org/browse/gimp/commit/?id=b0581371450284d92a990d219dd5888985ac8149
However, the 2.8 branch never has gotten that fix.
I tried to apply the patch for the trunk to gimp-2.8.8 but it didn't apply cleanly probably due to new funcitons on the trunk.
I could have backport the fixes to 2.8, but I found that FreeBSD ports just use sed to exchange that -u Symbol against -Wl,-u,Symbol
I will upload a patch for the gimp ebuild doing the same using sed and 2.8.8 compiles fine with clang (even with lto).
Comment 5 Walter Meinl 2013-11-17 10:57:45 UTC
Created attachment 363400 [details, diff]
use sed in the ebuild to exchange -u against -Wl,-u in Makefiles

sedding both Makefile.am and Makefile.in may be a bit of overkill since we regenerate the am files anyway, but when eautoreconf goes for some reason the Makefile.in's would still work
Comment 6 Walter Meinl 2013-12-01 12:31:20 UTC
ping?
Comment 7 Julian Ospald 2013-12-01 12:37:14 UTC
this looks too fragile to me

better create a real patch.
Comment 8 Walter Meinl 2013-12-01 22:48:44 UTC
Created attachment 364406 [details, diff]
patch for the ebuild

modification of the current gimp-2.8.8-r1.ebuild main patch will follow
Comment 9 Walter Meinl 2013-12-01 22:53:04 UTC
Created attachment 364408 [details, diff]
gimp-clang.patch

(In reply to Julian Ospald (hasufell) from comment #7)
> this looks too fragile to me
> 
> better create a real patch.

here we go
compiled successfully with both clang-3.3 and gcc-4.8.2
BTW, I just checked the gimp-2.8 branch again and the fix will not be contained in gimp-2.8.10
Comment 10 Walter Meinl 2014-01-25 10:01:03 UTC
Created attachment 368666 [details, diff]
patch for 2.8.10-r1.ebuild

(In reply to Julian Ospald (hasufell) from comment #7)
> this looks too fragile to me
> 
> better create a real patch.

I've updated the patch for the ebuild after recent changes for MacOSX. Hopefully, you'll find time to check it in. The other patch for the exchange of -u to -Wl,-u still applies and works cleanly. Build succeded using clang-3.3 clang-3.4 as well as gcc-4.8.2 - and, of course, gimp is working after being built with each of the compilers.
Comment 11 Julian Ospald 2014-01-25 18:55:08 UTC
+  25 Jan 2014; Julian Ospald <hasufell@gentoo.org>
+  +files/gimp-2.8.10-clang.patch, gimp-2.8.10-r1.ebuild:
+  fix build with clang wrt #449370