# 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}"
Created attachment 333814 [details] gimp-2.8.2-r1:20121230-233609.log.xz
Honestly low priority to me right now. Feel free to take over, patches welcome.
I agree, it's actually an enhancement.
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).
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
ping?
this looks too fragile to me better create a real patch.
Created attachment 364406 [details, diff] patch for the ebuild modification of the current gimp-2.8.8-r1.ebuild main patch will follow
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
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.
+ 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