gcc: poison default sysroot path
PATCH 1/1 gcc: poison default sysroot path
Various pieces of the code assume that the --sysroot option gets passed into the compiler tools. By having a "sane" default, we don't always spot when this occurs and this can later show up as breakage in sstate, or in usage of the external toolchain.
We've long since talked about poisoning the default such that it will break unless the correct option is specified. This patch does just that.
If this patch causes something to fail to build, it most likely means the various compiler flags and commands are not correctly being passed through to the underlying piece of software and that there is a real problem that needs fixing, its not the fault of this patch.
meta/recipes-devtools/gcc/gcc-4.9.inc +2 -2
@@ -121,8 +121,8 @@ EXTRA_OECONF_INTERMEDIATE = "\ EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float " EXTRA_OECONF_PATHS = "\ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ "
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +2 -2
@@ -10,9 +10,9 @@ GCCMULTILIB = "--enable-multilib" require gcc-configure-common.inc EXTRA_OECONF_PATHS = "\ - --with-gxx-include-dir=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${target_includedir}/c++/${BINV} \ + --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ - --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ " # We have to point gcc at a sysroot but we don't need to rebuild if this changes
meta/recipes-devtools/gcc/gcc-cross-initial.inc +1 -1
@@ -21,7 +21,7 @@ EXTRA_OECONF = "\ --enable-languages=c \ ${OPTSPACE} \ --program-prefix=${TARGET_PREFIX} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \ ${EXTRA_OECONF_INITIAL} \ ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
meta/recipes-devtools/gcc/gcc-cross.inc +2 -2
@@ -25,8 +25,8 @@ EXTRA_OECONF += "\ " EXTRA_OECONF_PATHS = "\ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ "
meta/recipes-devtools/gcc/gcc-runtime.inc +1 -1
@@ -4,7 +4,7 @@ CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}" EXTRA_OECONF_PATHS = "\ --with-gxx-include-dir=${includedir}/c++/${BINV} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ "
meta/recipes-devtools/gcc/libgfortran.inc +1 -1
@@ -1,7 +1,7 @@ require gcc-configure-common.inc EXTRA_OECONF_PATHS = "\ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ "
Quoted 8 lines
Op 24 okt. 2014, om 16:10 heeft Richard Purdie <[email protected]> het volgende geschreven:
Various pieces of the code assume that the --sysroot option gets passed into the compiler tools. By having a "sane" default, we don't always spot when this occurs and this can later show up as breakage in sstate, or in usage of the external toolchain.
Quoted 7 lines
We've long since talked about poisoning the default such that it will break unless the correct option is specified. This patch does just that.
If this patch causes something to fail to build, it most likely means the various compiler flags and commands are not correctly being passed through to the underlying piece of software and that there is a real problem that needs fixing, its not the fault of this patch.
So hopefully this won't be needed anymore in my autobuilders:
export GCCARCH=$(MACHINE=${machine} bitbake -e | grep TARGET_ARCH\= | awk -F'"' '{print $2}') MACHINE=$machine bitbake gcc-cross-${GCCARCH} -c cleansstate || true
Current offenders are: u-boot, linux and on x86 only, opencv.
regards,
Koen