Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 516854

Summary: sys-libs/e2fsprogs-libs-1.42.10 does not cross compile - .../work/e2fsprogs-libs-1.42.10/util/subst.c:8:20: fatal error: config.h: No such file or directory
Product: Gentoo Linux Reporter: Ian Stakenvicius (RETIRED) <axs>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: zlogene
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=549926
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: fix fatal cross-compile issue

Description Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-10 18:02:19 UTC
Created attachment 380550 [details, diff]
fix fatal cross-compile issue

Actual error on cross compile is:

make V=1 -j1 
cd ./util ; make subst
make[1]: Entering directory `/usr/powerpc-unknown-linux-gnu/tmp/portage/sys-libs/e2fsprogs-libs-1.42.10/work/e2fsprogs-libs-1.42.10-abi_ppc_32.ppc/util'
echo "/* fake dirpaths.h for config.h */" > dirpaths.h
gcc -c  /usr/powerpc-unknown-linux-gnu/tmp/portage/sys-libs/e2fsprogs-libs-1.42.10/work/e2fsprogs-libs-1.42.10/util/subst.c -o subst.o
/usr/powerpc-unknown-linux-gnu/tmp/portage/sys-libs/e2fsprogs-libs-1.42.10/work/e2fsprogs-libs-1.42.10/util/subst.c:8:20: fatal error: config.h: No such file or directory
compilation terminated.
make[1]: *** [subst.o] Error 1


(note, it's a PITA to see this when V=1 is unset on emake!)

The reason for the error is that configure.in set BUILD_CFLAGS="... $INCLUDES .." , which contains the path to config.h , but this is only set when 'test cross-compiler = no'.  Otherwise, BUILD_CFLAGS is set to nothing.

The following patch against the tree fixes the issue.  Note it also includes setting CC and BUILD_CC properly in the ebuild (BUILD_CC is just 'gcc' as shown above, instead of the CHOST-CC), and calling emake with V=1 to drop the quiet output.
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-10 19:39:16 UTC
  10 Jul 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org>
  +files/e2fsprogs-libs-1.42.10-fix-build-cflags.patch,
  e2fsprogs-libs-1.42.10.ebuild:
  fixed cross-compiling, bug 516854, with Poly-C's blessing
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-11 13:56:08 UTC
*** Bug 516894 has been marked as a duplicate of this bug. ***