diff options
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-common.inc | 32 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-configure-common.inc | 48 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-configure-cross.inc | 4 | ||||
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-crosssdk.inc | 6 |
4 files changed, 61 insertions, 29 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc index a3fa23442..7bf036cd8 100644 --- a/meta/recipes-devtools/gcc/gcc-common.inc +++ b/meta/recipes-devtools/gcc/gcc-common.inc @@ -37,10 +37,38 @@ ${GNU_MIRROR}/gcc/ http://gcc.get-software.com/releases/ \n \ # gcclibdir = "${libdir}/gcc" BINV = "${PV}" -S = "${WORKDIR}/gcc-${PV}" -B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" +#S = "${WORKDIR}/gcc-${PV}" +S = "${TMPDIR}/work-shared/gcc-${PV}/gcc-${PV}" +B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" + +# SS means Shared Stamps directory +SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}" +do_fetch[stamp-base] = "${SS}" +do_unpack[stamp-base] = "${SS}" +do_patch[stamp-base] = "${SS}" + +# SW means Shared Work directory +SW = "${TMPDIR}/work-shared/gcc-${PV}" +WORKDIR_task-unpack = "${SW}" +WORKDIR_task-patch = "${SW}" target_includedir ?= "${includedir}" target_libdir ?= "${libdir}" target_base_libdir ?= "${base_libdir}" target_prefix ?= "${prefix}" + +CLEANFUNCS += "workshared_clean" +# The do_clean should be exclusive since share ${S} +do_clean[lockfiles] = "${TMPDIR}/stamps/work-shared/gcc-${PV}.clean.lock" + +python workshared_clean () { + """clear the source directory""" + dir = bb.data.expand("${SW}", d) + bb.note("Removing " + dir) + oe.path.remove(dir) + + """clear the the stamps in work-shared""" + dir = "%s.*" % bb.data.expand(d.getVarFlag('do_fetch', 'stamp-base', True), d) + bb.note("Removing " + dir) + oe.path.remove(dir) +} diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc index f7b5836c4..9f5ba335c 100644 --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc @@ -61,6 +61,34 @@ SYSTEMHEADERS = "${target_includedir}" SYSTEMLIBS = "${target_base_libdir}/" SYSTEMLIBS1 = "${target_libdir}/" +do_configure_prepend () { + # Change the default dynamic linker path, only useful for SDK, other's value + # are not changed according to the SYSTEMLIBS_DIR + sed -i ${S}/gcc/config/*/linux*.h -e \ + 's#\(GLIBC_DYNAMIC_LINKER[^ ]*\)\( *"/lib.*\)#\1 SYSTEMLIBS_DIR\2#' + + SYSTEMLIBS_DIR=`dirname ${SYSTEMLIBS}` + [ "$SYSTEMLIBS_DIR" = "/" ] && SYSTEMLIBS_DIR="" + # teach gcc to find correct target includedir when checking libc ssp support + mkdir -p ${B}/gcc + echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe + cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new + cat >>${B}/gcc/defaults.h.new <<_EOF +#ifndef STANDARD_INCLUDE_DIR +#define STANDARD_INCLUDE_DIR "${SYSTEMHEADERS}" +#endif +#ifndef STANDARD_STARTFILE_PREFIX_1 +#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}" +#endif +#ifndef STANDARD_STARTFILE_PREFIX_2 +#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}" +#endif +#define SYSTEMLIBS_DIR "$SYSTEMLIBS_DIR" +#endif /* ! GCC_DEFAULTS_H */ +_EOF + mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h +} + do_configure () { # Setup these vars for cross building only # ... because foo_FOR_TARGET apparently gets misinterpreted inside the @@ -86,27 +114,7 @@ do_configure () { export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" (cd ${S} && gnu-configize) || die "failure running gnu-configize" - - # teach gcc to find correct target includedir when checking libc ssp support - sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure.ac - sed -i 's:^\([ ]*\)glibc_header_dir=\"${with_build_sysroot}/usr/include\":\1glibc_header_dir=\"${with_build_sysroot}${SYSTEMHEADERS}\":g' ${S}/gcc/configure - # splice our idea of where the headers live into gcc's world - echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe - sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new - mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in - cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new - echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new - echo "#define STANDARD_INCLUDE_DIR \"${SYSTEMHEADERS}\"" >> ${S}/gcc/defaults.h.new - echo "#endif" >> ${S}/gcc/defaults.h.new - echo "#ifndef STANDARD_STARTFILE_PREFIX_1" >> ${S}/gcc/defaults.h.new - echo "#define STANDARD_STARTFILE_PREFIX_1 \"${SYSTEMLIBS}\"" >> ${S}/gcc/defaults.h.new - echo "#endif" >> ${S}/gcc/defaults.h.new - echo "#ifndef STANDARD_STARTFILE_PREFIX_2" >> ${S}/gcc/defaults.h.new - echo "#define STANDARD_STARTFILE_PREFIX_2 \"${SYSTEMLIBS1}\"" >> ${S}/gcc/defaults.h.new - echo "#endif" >> ${S}/gcc/defaults.h.new - echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new - mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h oe_runconf } diff --git a/meta/recipes-devtools/gcc/gcc-configure-cross.inc b/meta/recipes-devtools/gcc/gcc-configure-cross.inc index 346d1640d..36edb81e1 100644 --- a/meta/recipes-devtools/gcc/gcc-configure-cross.inc +++ b/meta/recipes-devtools/gcc/gcc-configure-cross.inc @@ -2,7 +2,9 @@ require gcc-configure-common.inc USE_NLS = '${@base_conditional( "TARGET_OS", "linux-uclibc", "no", "", d )}' -EXTRA_OECONF += " --enable-poison-system-directories " +EXTRA_OECONF += " --enable-poison-system-directories \ + --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \ + " EXTRA_OECONF_PATHS = "--with-local-prefix=${STAGING_DIR_TARGET}${target_exec_prefix} \ --with-gxx-include-dir=${target_includedir}/c++ \ diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/meta/recipes-devtools/gcc/gcc-crosssdk.inc index 6e7d5a73f..0fd82a6fd 100644 --- a/meta/recipes-devtools/gcc/gcc-crosssdk.inc +++ b/meta/recipes-devtools/gcc/gcc-crosssdk.inc @@ -8,9 +8,3 @@ GCCMULTILIB = "--disable-multilib" DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk virtual/${TARGET_PREFIX}libc-for-gcc-nativesdk gettext-native" PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk" - -do_configure_prepend () { - # Change the default dynamic linker path to the one in the SDK - sed -i ${S}/gcc/config/*/linux*.h -e 's#\(GLIBC_DYNAMIC_LINKER.*\)/lib/#\1${SYSTEMLIBS}#' - sed -i ${S}/gcc/config/*/linux*.h -e 's#\(GLIBC_DYNAMIC_LINKER.*\)/lib64/#\1${SYSTEMLIBS}#' -} |