[oe] [Jethro] Can't compile gcc-cross when gcc-6 is the host compiler

Jérémy Rosen jeremy.rosen at smile.fr
Thu Aug 11 12:40:27 UTC 2016


Hello everybody

I am working on a jethro-based project on my Debian/testing machine, and 
debian just migrated it's default gcc from gcc-5 to gcc-6

As expected, this caused all sort of errors in my build, starting by 
pkgconfig-native not being compilable anymore (new gcc warnings coupled 
with -Werror)


That's OK. I don't expect jethro to support future compilers out of the 
box so I installed gcc-5 in parallel to gcc-6 while keeping gcc-6 as the 
default compiler.

I then set the following variables in local.conf

#gcc-5
export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc-5 ${BUILD_CC_ARCH}"
export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++-5 ${BUILD_CC_ARCH}"
export BUILD_FC = "${CCACHE}${BUILD_PREFIX}gfortran-5 ${BUILD_CC_ARCH}"
export BUILD_CPP = "${BUILD_PREFIX}gcc-5 ${BUILD_CC_ARCH} -E"
export BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
export BUILD_CCLD = "${BUILD_PREFIX}gcc-5 ${BUILD_CC_ARCH}"
export BUILD_AR = "${BUILD_PREFIX}gcc-ar-5"
export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
export BUILD_RANLIB = "${BUILD_PREFIX}gcc-ranlib-5"
export BUILD_STRIP = "${BUILD_PREFIX}strip"
export BUILD_NM = "${BUILD_PREFIX}gcc-nm-5"

This helped, and allowed me to go much further in my build, but the 
recipe gcc-cross-arm still failed. To be able to compile my build I had 
to add the following to my local.conf

CC_pn-gcc-cross-arm= "${BUILD_CC}"
CXX_pn-gcc-cross-arm= "${BUILD_CXX}"
CC_pn-gcc-crosssdk-x86_64= "${BUILD_CC}"
CXX_pn-gcc-crosssdk-x86_64= "${BUILD_CXX}"


So apparently, gcc still has some reference to $CC and $CXX hardcoded 
somewhere (I think it's in do_configure)

It seems to set $CC in the do_compile correctly, but not in 
do_configure. And it never sets $CXX

I tried to understand what the GCC recipe was doing wrong, but I 
couldn't find out on first look and it's a really complicated recipe


I hope this is enough clues to allow someone more knowledgeable to 
create a proper fix...


Regards

Jeremy Rosen




More information about the Openembedded-devel mailing list