When the version of file on the host is different from the version being cross-compiled, the ebuild will build itself a file to use for cross_compilation: ac_cv_header_zlib_h=no \ ac_cv_lib_z_gzopen=no \ CHOST=${CBUILD} \ CFLAGS=${BUILD_CFLAGS} \ CXXFLAGS=${BUILD_CXXFLAGS} \ CPPFLAGS=${BUILD_CPPFLAGS} \ LDFLAGS="${BUILD_LDFLAGS} -static" \ do_configure --disable-shared But CC and CXX were missed here. If they are set, it will try to use the cross compiler to build a native executable, and fail. Fix is to also add: CC=${BUILD_CC} \ CXX=${BUILD_CXX} \ I've confirmed that this fixes it. Reproducible: Always
Created attachment 324090 [details] emerge output This is emerge output from failing compile. The setup is as I describe on http://code.google.com/p/ambro-cross-overlay/
try this patch: --- file-5.11.ebuild 26 Jul 2012 16:35:01 -0000 1.8 +++ file-5.11.ebuild 19 Sep 2012 05:01:53 -0000 @@ -47,6 +47,7 @@ src_configure() { # because people often don't keep matching host/target # file versions #362941 if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then + tc-export_build_env BUILD_C{C,XX} ac_cv_header_zlib_h=no \ ac_cv_lib_z_gzopen=no \ CHOST=${CBUILD} \ @@ -54,6 +55,8 @@ src_configure() { CXXFLAGS=${BUILD_CXXFLAGS} \ CPPFLAGS=${BUILD_CPPFLAGS} \ LDFLAGS="${BUILD_LDFLAGS} -static" \ + CC=${BUILD_CC} \ + CXX=${BUILD_CXX} \ do_configure --disable-shared fi
It works. (yes, I made sure file on host is still different version)
should be all set now in the tree; thanks for the report! Commit message: Use BUILD_{CC,CXX} when cross-compiling http://sources.gentoo.org/sys-apps/file/file-5.11.ebuild?r1=1.8&r2=1.9