Created attachment 390572 [details] build.log ./setup build Building cairo-0.12.5.0... Preprocessing library cairo-0.12.5.0... In file included from ./Graphics/Rendering/Cairo.hs:9:0: /usr/include/cairo/cairo-features.h:43:3: error: #error "No ABI matched, please report a bug to bugs.gentoo.org" # error "No ABI matched, please report a bug to bugs.gentoo.org" ^
Yeah, ghc calls gcc's preprocessor with '-undef': > x86_64-pc-linux-gnu-gcc -E -undef -traditional -include dist/build/autogen/cabal_macros.h -I dist/build -I dist/build -I dist/build/autogen -I dist/build -I dist/build/autogen -I dist/build -I . -I /usr/include/cairo -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libdrm -I /usr/include/libpng16 -I /usr/lib64/ghc-7.8.3.20141119/bytestring-0.10.4.0/include -I /usr/lib64/ghc-7.8.3.20141119/base-4.7.0.2/include -I /usr/lib64/ghc-7.8.3.20141119/integer-gmp-0.5.1.0/include -I /usr/lib64/ghc-7.8.3.20141119/include -I /usr/lib64/libffi-3.1/include '-D__GLASGOW_HASKELL__=708' '-Dlinux_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Dx86_64_HOST_ARCH=1' '-D__SSE__=1' '-D__SSE2__=1' -x assembler-with-cpp ./Graphics/Rendering/Cairo.hs -o /tmp/ghc24899_0/ghc24899_1.hscpp Would be nice if multilib eclass would export what '-Dwhatever=it-wants' to be set for current ABI. Or would have another #ifdef in wrapped header for platform checks so we could skip it. Currently we use this non-worker: https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-haskell/cairo/cairo-0.13.0.4.ebuild#L33
(In reply to Sergei Trofimovich from comment #1) > Yeah, ghc calls gcc's preprocessor with '-undef': > > > x86_64-pc-linux-gnu-gcc -E -undef -traditional -include dist/build/autogen/cabal_macros.h -I dist/build -I dist/build -I dist/build/autogen -I dist/build -I dist/build/autogen -I dist/build -I . -I /usr/include/cairo -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libdrm -I /usr/include/libpng16 -I /usr/lib64/ghc-7.8.3.20141119/bytestring-0.10.4.0/include -I /usr/lib64/ghc-7.8.3.20141119/base-4.7.0.2/include -I /usr/lib64/ghc-7.8.3.20141119/integer-gmp-0.5.1.0/include -I /usr/lib64/ghc-7.8.3.20141119/include -I /usr/lib64/libffi-3.1/include '-D__GLASGOW_HASKELL__=708' '-Dlinux_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Dx86_64_HOST_ARCH=1' '-D__SSE__=1' '-D__SSE2__=1' -x assembler-with-cpp ./Graphics/Rendering/Cairo.hs -o /tmp/ghc24899_0/ghc24899_1.hscpp > > Would be nice if multilib eclass would export what '-Dwhatever=it-wants' to > be set for current ABI. I doubt it would be nice. GCC macros are to be exported by GCC :). If ghc is doing something really, really stupid, it's ghc's fault. How can one expect packages to compile sanely if they are ran in randomly wiped environment? > Or would have another #ifdef in wrapped header for platform checks so we > could skip it. Any suggestion what to depend on? __GLASGOW_HASKELL__?
(In reply to Michał Górny from comment #2) > (In reply to Sergei Trofimovich from comment #1) > > Yeah, ghc calls gcc's preprocessor with '-undef': > > > > > x86_64-pc-linux-gnu-gcc -E -undef -traditional -include dist/build/autogen/cabal_macros.h -I dist/build -I dist/build -I dist/build/autogen -I dist/build -I dist/build/autogen -I dist/build -I . -I /usr/include/cairo -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libdrm -I /usr/include/libpng16 -I /usr/lib64/ghc-7.8.3.20141119/bytestring-0.10.4.0/include -I /usr/lib64/ghc-7.8.3.20141119/base-4.7.0.2/include -I /usr/lib64/ghc-7.8.3.20141119/integer-gmp-0.5.1.0/include -I /usr/lib64/ghc-7.8.3.20141119/include -I /usr/lib64/libffi-3.1/include '-D__GLASGOW_HASKELL__=708' '-Dlinux_BUILD_OS=1' '-Dx86_64_BUILD_ARCH=1' '-Dlinux_HOST_OS=1' '-Dx86_64_HOST_ARCH=1' '-D__SSE__=1' '-D__SSE2__=1' -x assembler-with-cpp ./Graphics/Rendering/Cairo.hs -o /tmp/ghc24899_0/ghc24899_1.hscpp > > > > Would be nice if multilib eclass would export what '-Dwhatever=it-wants' to > > be set for current ABI. > > I doubt it would be nice. GCC macros are to be exported by GCC :). If ghc is > doing something really, really stupid, it's ghc's fault. How can one expect > packages to compile sanely if they are ran in randomly wiped environment? GHC uses gcc's cpp to preprocess haskell sources. It translates .hs to .hs with help of cpp and then strips off what came from #includes. The result is as original .hs file, but without #directives. Then GHC compiles final .hs file without help of gcc. Example use: http://hackage.haskell.org/package/cairo-0.12.0/docs/src/Graphics-Rendering-Cairo.html It only tries to settle with those #ifdef bits. I agree that piggybacking on cpp a bad idea (cpp can't parse full set of haskell for example, thus why -traditionla is used). We will try to remove -undef in the long run, but the hack in use for like 10 years. > > Or would have another #ifdef in wrapped header for platform checks so we > > could skip it. > > Any suggestion what to depend on? __GLASGOW_HASKELL__? I'd propose someting more awkward to ease grep for uses like '__GENTOO_FOR_CPP_UNDEF_'. And our use of workaround in "bad" ebuilds would be: HCFLAGS+=" -optP-D__GENTOO_FOR_CPP_UNDEF_=1"
Ah, so it's including the header file to get CPP macros from it? Very ugly, I dare say. So I've got another solution for ya: +*cairo-1.12.16-r4 (29 Nov 2014) + + 29 Nov 2014; Michał Górny <mgorny@gentoo.org> +cairo-1.12.16-r4.ebuild: + Stop wrapping cairo-features.h. Now that we pass consistent configure options, + it should be the same on all ABIs. Fixes compatibility with dev-haskell/cairo + hackery, bug #531120. Now you just need a proper dep (and maybe an update to the stablereq).