]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc-configure: Pass distinct target flags
authorKhem Raj <raj.khem@gmail.com>
Wed, 28 Mar 2012 14:22:44 +0000 (07:22 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Apr 2012 13:48:47 +0000 (14:48 +0100)
When building gcc-cross-canadian libgcc is built using
headers from gcc-crosssdk and not the target sysroot
because we do not pass proper CFLAGS for target bits
so it ends up using CFLAGS that were meant for compiling
canadian gcc itself. It does not show up as a problem
when building SDK with eglibc because eglibc-nativesdk
and eglibc have identical headers. The problem shows
up clearly when you try to build uclibc based meta-toolchain
since then nativesdk libc and target libc are different

Signed-off-by: Khem Raj <raj.khem@gmail.com>
meta/recipes-devtools/gcc/gcc-configure-common.inc
meta/recipes-devtools/gcc/gcc-configure-cross.inc
meta/recipes-devtools/gcc/gcc-configure-sdk.inc

index 9542dc9301766b45e629a11141771e6f0a1deb83..39b5f5223e01cd698e786ce12250a5768d19ced6 100644 (file)
@@ -111,6 +111,10 @@ do_configure () {
        # in the config.log files (which might not get generated until do_compile
        # hence being missed by the insane do_configure check).
        export gcc_cv_collect2_libs="none required"
+       export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+       export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+       export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+       export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
        (cd ${S} && gnu-configize) || die "failure running gnu-configize"
 
        oe_runconf
index 774dadb89f15f8c8a032dcaf07765c3b7b9b72ab..98961923ba46fb0f0abdd6396f30776756acae6a 100644 (file)
@@ -20,6 +20,10 @@ do_compile_prepend () {
        export LD_FOR_TARGET="${TARGET_SYS}-ld"
        export NM_FOR_TARGET="${TARGET_SYS}-nm"
        export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}"
+       export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+       export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+       export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+       export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
 }
 
 LIBGCCS_VAR = "-lgcc_s"
index eb6757cdc8f0511e37672a022e66413a369047d4..6aac0ad88787f672b72aa786e1f193df386051a7 100644 (file)
@@ -39,6 +39,10 @@ do_configure () {
        export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
        export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
        export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+       export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+       export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+       export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+       export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
        (cd ${S} && gnu-configize) || die "failure running gnu-configize"
        oe_runconf
 }