Skip to contentSkip to conversation

Specify GCC version for building native applications

DISCUSSION Matt Schuckmann 2 participants 2 messages Mar 22, 2016 – Mar 23, 2016

lore
Share & tools
lore
#0 lore raw

My Ubuntu system has GCC 5.x installed but our Fido based OE build has errors unless I use GCC 4.9 for building native recipes.

I can install both gcc 4.9 and gcc 5.0 on my system and use update-alternatives to switch back and forth when I need to but it would be nice if I could just configure bitbake/OE to use gcc 4.9 directly.

So is there a way to tell bitbake/OE what version of GCC on the host to use to build native applications?

Thanks,

Matt S.

#1 lore raw
Quoted 7 lines · Matt Schuckmann

I can install both gcc 4.9 and gcc 5.0 on my system and use update-alternatives to switch back and forth when I need to but it would be nice if I could just configure bitbake/OE to use gcc 4.9 directly.

So is there a way to tell bitbake/OE what version of GCC on the host to use to build native applications?

Yes, looking at native.bbclass shows that it uses BUILD_CC etc. Just assign those in your local.conf or similar, this works on my Debian box to pick gcc5.3 over 4.9:

BUILD_CC = "gcc-5 ${BUILD_CC_ARCH}"
BUILD_CXX = "g++-5 ${BUILD_CC_ARCH}"
BUILD_CPP = "gcc-5 ${BUILD_CC_ARCH} -E"
BUILD_CCLD = "gcc-5 ${BUILD_CC_ARCH}"
BUILD_RANLIB = "gcc-ranlib-5"
BUILD_NM = "gcc-nm-5"

Ross