Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 516854 - 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
Summary: sys-libs/e2fsprogs-libs-1.42.10 does not cross compile - .../work/e2fsprogs-l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-07-10 18:02 UTC by Ian Stakenvicius (RETIRED)
Modified: 2015-05-25 10:23 UTC (History)
1 user (show)

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


Attachments
fix fatal cross-compile issue (patch,1.71 KB, patch)
2014-07-10 18:02 UTC, Ian Stakenvicius (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***