From patchwork Tue Apr 26 10:16:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] bitbake.conf: use HOST_CC_ARCH in CPP Date: Tue, 26 Apr 2011 10:16:32 -0000 From: Enrico Scholz X-Patchwork-Id: 2871 Message-Id: <1303812993-6107-1-git-send-email-enrico.scholz@sigma-chemnitz.de> To: openembedded-devel@lists.openembedded.org Cc: Enrico Scholz Using plain 'gcc -E' for CPP is wrong because some macros are defined only for certain ${HOST_CC_ARCH} flags. Checks using ${CPP} might return wrong results hence. Omitting ${HOST_CC_ARCH} from 'gcc -E' can also break builds for compilers configured e.g. for '-mcpu=cortex-m3'. Such gccs require '-mthumb'; even when invoked with '-E': | $ arm-linux-uclibceabi-gcc -E - < /dev/null | # 1 "" | :1:0: error: target CPU does not support ARM mode | $ | $ arm-linux-uclibceabi-gcc -mthumb -E - < /dev/null | # 1 "" | # 1 "" | # 1 "" | # 1 "" | $ Signed-off-by: Enrico Scholz --- conf/bitbake.conf | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/bitbake.conf b/conf/bitbake.conf index 17a494d..5fb90e2 100644 --- a/conf/bitbake.conf +++ b/conf/bitbake.conf @@ -473,7 +473,7 @@ TOOLCHAIN_SYSPATH ?= "${TOOLCHAIN_PATH}/${TARGET_SYS}" export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" -export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS}" +export CPP = "${HOST_PREFIX}gcc -E ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" export LD = "${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS}" export CCLD = "${CC}" export AR = "${HOST_PREFIX}ar" @@ -488,7 +488,7 @@ PYTHON = "${@sys.executable}" export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}" export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}" export BUILD_F77 = "${CCACHE}${BUILD_PREFIX}g77 ${BUILD_CC_ARCH}" -export BUILD_CPP = "${BUILD_PREFIX}cpp" +export BUILD_CPP = "${BUILD_PREFIX}cpp ${BUILD_CC_ARCH}" export BUILD_LD = "${BUILD_PREFIX}ld" export BUILD_CCLD = "${BUILD_PREFIX}gcc" export BUILD_AR = "${BUILD_PREFIX}ar"