All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: Remove hardcoded PACKAGE_ARCHS from the class
@ 2017-01-25 11:40 Richard Purdie
  2017-01-25 11:40 ` [PATCH 2/4] gcc: Split builddir saving into its own sstate task Richard Purdie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Purdie @ 2017-01-25 11:40 UTC (permalink / raw)
  To: openembedded-core

The code was making an assumption that the only PACKAGE_ARCH in use
was TUNE_PKGARCH. This is incorrect so iterate over the list from
PACKAGE_EXTRA_ARCH instead.

[Thanks to Andrew Goodbody <andrew.goodbody@cambrionix.com> for
testing/fixing]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/staging.bbclass | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index fc387ea..db99518 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -304,7 +304,9 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
         pkgarchs = ['${BUILD_ARCH}', '${BUILD_ARCH}_*']
         targetdir = nativesysroot
     else:
-        pkgarchs = ['${MACHINE_ARCH}', '${TUNE_PKGARCH}', 'allarch']
+        pkgarchs = ['${MACHINE_ARCH}']
+        pkgarchs = pkgarchs + list(reversed(d.getVar("PACKAGE_EXTRA_ARCHS").split()))
+        pkgarchs.append('allarch')
         targetdir = targetsysroot
 
     bb.utils.mkdirhier(targetdir)
@@ -528,11 +530,13 @@ python extend_recipe_sysroot() {
             manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
             native = True
         else:
-            manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${MACHINE_ARCH}-%s.populate_sysroot" % c)
-            if not os.path.exists(manifest):
-                manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${TUNE_PKGARCH}-%s.populate_sysroot" % c)
-            if not os.path.exists(manifest):
-                manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-allarch-%s.populate_sysroot" % c)
+            pkgarchs = ['${MACHINE_ARCH}']
+            pkgarchs = pkgarchs + list(reversed(d.getVar("PACKAGE_EXTRA_ARCHS").split()))
+            pkgarchs.append('allarch')
+            for pkgarch in pkgarchs:
+                manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-%s-%s.populate_sysroot" % (pkgarch, c))
+                if os.path.exists(manifest):
+                    break
         if not os.path.exists(manifest):
             bb.warn("Manifest %s not found?" % manifest)
         else:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/4] gcc: Split builddir saving into its own sstate task
  2017-01-25 11:40 [PATCH 1/4] staging: Remove hardcoded PACKAGE_ARCHS from the class Richard Purdie
@ 2017-01-25 11:40 ` Richard Purdie
  2017-01-25 11:40 ` [PATCH 3/4] gcc/gcc-source: Move libcc1 manipulation into gcc-source Richard Purdie
  2017-01-25 11:40 ` [PATCH 4/4] gcc: Clean up unnecessary variable confusion Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2017-01-25 11:40 UTC (permalink / raw)
  To: openembedded-core

When we stashed the gcc build directory for use in generating the various runtimes
we were being lazy and just used the staging directory. With recipe specific
sysroots this means we're copying a large chunk of data around with the cross
compiler which we don't really need in most cases.

Separate out the data into its own task and inject this into the configure
step. We have to do that here since autotools will wipe out ${B} if it thinks
we're rebuilding and we therefore have to time its recreation after that.

This also takes the opportunity to remove some pointless (as far as I can tell)
conditionals from the do_install code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-common.inc        | 10 +++++++++
 meta/recipes-devtools/gcc/gcc-cross-initial.inc | 10 ++-------
 meta/recipes-devtools/gcc/gcc-cross.inc         | 29 +++++++++++++++----------
 meta/recipes-devtools/gcc/gcc-runtime.inc       |  7 +++---
 meta/recipes-devtools/gcc/gcc-sanitizers.inc    |  6 ++---
 meta/recipes-devtools/gcc/libgcc-common.inc     |  3 ++-
 meta/recipes-devtools/gcc/libgcc-initial.inc    |  2 +-
 meta/recipes-devtools/gcc/libgcc.inc            |  2 --
 meta/recipes-devtools/gcc/libgfortran.inc       |  4 ++--
 9 files changed, 41 insertions(+), 32 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index d17ba29..44e7c28 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -8,6 +8,16 @@ NATIVEDEPS = ""
 inherit autotools gettext texinfo
 
 BPN = "gcc"
+COMPILERINITIAL = ""
+COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc${COMPILERINITIAL}:do_gcc_stash_builddir"
+COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc${COMPILERINITIAL}-crosssdk:do_gcc_stash_builddir"
+
+python extract_stashed_builddir () {
+    src = d.expand("${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
+    dest = d.getVar("B")
+    oe.path.copyhardlinktree(src, dest)
+    staging_processfixme([src + "/fixmepath"], dest, dest, dest, d)
+}
 
 def get_gcc_float_setting(bb, d):
     if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm":
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
index d47f42e..dd35681 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -75,14 +75,6 @@ do_install () {
 	# so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
 	# to get rid references to real limits.h
 	cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
-
-	# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
-	case ${PN} in
-		*gcc-cross-initial-${TARGET_ARCH}|*gcc-crosssdk-initial-${SDK_SYS})
-			dest=${D}/${includedir}/gcc-build-internal-initial-${TARGET_SYS}
-			hardlinkdir . $dest
-		;;
-	esac
 }
 #
 # Override the default sysroot staging copy since this won't look like a target system
@@ -99,3 +91,5 @@ do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/
 do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/${PN}"
 
 inherit nopackages
+
+COMPILERINITIAL = "-initial"
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index c4f7084..9afa554 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -185,21 +185,28 @@ do_install () {
 	# We use libiberty from binutils
 	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
 	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
-	# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
-	case ${PN} in
-		*gcc-cross-${TARGET_ARCH}|*gcc-crosssdk-${SDK_SYS})
-			dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS}
-			hardlinkdir . $dest
-		;;
-	esac
 }
-# This is reflected in the recipe name and target gcc shouldn't depend 
-# on SDK settings either
-do_install[vardepsexclude] += "SDK_SYS"
 
 do_package[noexec] = "1"
 do_packagedata[noexec] = "1"
 do_package_write_ipk[noexec] = "1"
 do_package_write_rpm[noexec] = "1"
 do_package_write_deb[noexec] = "1"
+
+BUILDDIRSTASH = "${WORKDIR}/stashed-builddir"
+do_gcc_stash_builddir[dirs] = "${B}"
+do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir () {
+	dest=${BUILDDIRSTASH}
+	hardlinkdir . $dest
+}
+addtask do_gcc_stash_builddir after do_compile
+SSTATETASKS += "do_gcc_stash_builddir"
+do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-fixmedir] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+
+python do_gcc_stash_builddir_setscene () {
+    sstate_setscene(d)
+}
+addtask do_gcc_stash_builddir_setscene
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index d56f82a..00856ad 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -32,9 +32,8 @@ RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
 
 do_configure () {
 	export CXX="${CXX} -nostdinc++ -nostdlib++"
-	mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+	target=${TARGET_SYS}
+
 	for d in libgcc ${RUNTIMETARGET}; do
 		echo "Configuring $d"
 		rm -rf ${B}/$target/$d/
@@ -45,6 +44,8 @@ do_configure () {
 		$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	done
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
 	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index df4e297..ae3afe0 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -12,11 +12,7 @@ EXTRA_OECONF_PATHS = "\
 "
 
 do_configure () {
-    mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
     target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then
-        hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
-    fi
 
     echo "Configuring libsanitizer"
     rm -rf ${B}/$target/libsanitizer/
@@ -31,6 +27,8 @@ do_configure () {
     # Link to the sysroot's libstdc++ instead of one gcc thinks it just built
     sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/$target/libsanitizer/*/Makefile
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
     target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index 7a3b410..c0efc29 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -7,7 +7,6 @@ INHIBIT_DEFAULT_DEPS = "1"
 do_configure () {
 	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	install -d ${D}${base_libdir} ${D}${libdir}
-	hardlinkdir ${STAGING_INCDIR_NATIVE}/${LIBGCCBUILDTREENAME}$target/ ${B}
 	mkdir -p ${B}/${BPN}
 	mkdir -p ${B}/$target/${BPN}/
 	cd ${B}/${BPN}
@@ -15,6 +14,8 @@ do_configure () {
 	relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
 	$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
 	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc
index aa32185..5b4bc3b 100644
--- a/meta/recipes-devtools/gcc/libgcc-initial.inc
+++ b/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -12,6 +12,6 @@ PACKAGES = ""
 
 EXTRA_OECONF += "--disable-shared"
 
-LIBGCCBUILDTREENAME = "gcc-build-internal-initial-"
+COMPILERINITIAL = "-initial"
 
 inherit nopackages
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index 4770394..38d1643 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -33,8 +33,6 @@ FILES_${PN}-dev = "\
     ${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \
 "
 
-LIBGCCBUILDTREENAME = "gcc-build-internal-"
-
 do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
 do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc
index 1943635..d3e2b41 100644
--- a/meta/recipes-devtools/gcc/libgfortran.inc
+++ b/meta/recipes-devtools/gcc/libgfortran.inc
@@ -6,9 +6,7 @@ EXTRA_OECONF_PATHS = "\
 "
 
 do_configure () {
-	mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
 
 	echo "Configuring libgfortran"
 	rm -rf ${B}/$target/libgfortran/
@@ -21,6 +19,8 @@ do_configure () {
 	# broken libtool here
 	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool
 }
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
 	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/4] gcc/gcc-source: Move libcc1 manipulation into gcc-source
  2017-01-25 11:40 [PATCH 1/4] staging: Remove hardcoded PACKAGE_ARCHS from the class Richard Purdie
  2017-01-25 11:40 ` [PATCH 2/4] gcc: Split builddir saving into its own sstate task Richard Purdie
@ 2017-01-25 11:40 ` Richard Purdie
  2017-01-25 11:40 ` [PATCH 4/4] gcc: Clean up unnecessary variable confusion Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2017-01-25 11:40 UTC (permalink / raw)
  To: openembedded-core

Currently there is a race where if you build -cross-canadian without building gcc (target)
you see QA errors about RPATHS. I've tracked this down to this manipulation where the
target gcc recipe changes libcc1 in the shared sources directory. As long as you build
things in the right order, the problem doesn't occur.

Since its changing ${S} move it to gcc-source and avoid the race, saving RP
some head scratching about why unrelated changes failed to build cleanly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-source.inc | 5 +++++
 meta/recipes-devtools/gcc/gcc_5.4.bb     | 6 ------
 meta/recipes-devtools/gcc/gcc_6.3.bb     | 6 ------
 3 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-source.inc b/meta/recipes-devtools/gcc/gcc-source.inc
index 0d0edb5..fab99f2 100644
--- a/meta/recipes-devtools/gcc/gcc-source.inc
+++ b/meta/recipes-devtools/gcc/gcc-source.inc
@@ -26,6 +26,11 @@ python do_preconfigure () {
     bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
     cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
     subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+
+    # Easiest way to stop bad RPATHs getting into the library since we have a
+    # broken libtool here (breaks cross-canadian and target at least)
+    cmd = d.expand("sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure")
+    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
 }
 addtask do_preconfigure after do_patch
 do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
diff --git a/meta/recipes-devtools/gcc/gcc_5.4.bb b/meta/recipes-devtools/gcc/gcc_5.4.bb
index b0a523c..2c618df 100644
--- a/meta/recipes-devtools/gcc/gcc_5.4.bb
+++ b/meta/recipes-devtools/gcc/gcc_5.4.bb
@@ -6,10 +6,4 @@ require gcc-target.inc
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
 ARM_INSTRUCTION_SET_armv4 = "arm"
 
-do_configure_prepend() {
-	# Easiest way to stop bad RPATHs getting into the library since we have a
-	# broken libtool here
-	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure
-}
-
 BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/gcc/gcc_6.3.bb b/meta/recipes-devtools/gcc/gcc_6.3.bb
index b0a523c..2c618df 100644
--- a/meta/recipes-devtools/gcc/gcc_6.3.bb
+++ b/meta/recipes-devtools/gcc/gcc_6.3.bb
@@ -6,10 +6,4 @@ require gcc-target.inc
 # | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
 ARM_INSTRUCTION_SET_armv4 = "arm"
 
-do_configure_prepend() {
-	# Easiest way to stop bad RPATHs getting into the library since we have a
-	# broken libtool here
-	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure
-}
-
 BBCLASSEXTEND = "nativesdk"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/4] gcc: Clean up unnecessary variable confusion
  2017-01-25 11:40 [PATCH 1/4] staging: Remove hardcoded PACKAGE_ARCHS from the class Richard Purdie
  2017-01-25 11:40 ` [PATCH 2/4] gcc: Split builddir saving into its own sstate task Richard Purdie
  2017-01-25 11:40 ` [PATCH 3/4] gcc/gcc-source: Move libcc1 manipulation into gcc-source Richard Purdie
@ 2017-01-25 11:40 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2017-01-25 11:40 UTC (permalink / raw)
  To: openembedded-core

SDKPKGSUFFIX could only really be "nativesdk" and TARGET_SYS never contains
that so the code manipulating TARGET_SYS is pointless. I suspect this once
worked against MULTIMACH_TARGET_SYS which would be a different question but
it no longer does. Its been cut and pasted everywhere.

This patch cleans up the variable references to make things a little more
readable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-runtime.inc    | 19 ++++++++-----------
 meta/recipes-devtools/gcc/gcc-sanitizers.inc | 25 ++++++++++---------------
 meta/recipes-devtools/gcc/libgcc-common.inc  |  9 +++------
 meta/recipes-devtools/gcc/libgfortran.inc    | 23 +++++++++--------------
 4 files changed, 30 insertions(+), 46 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 00856ad..745cf74 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -32,15 +32,14 @@ RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
 
 do_configure () {
 	export CXX="${CXX} -nostdinc++ -nostdlib++"
-	target=${TARGET_SYS}
 
 	for d in libgcc ${RUNTIMETARGET}; do
 		echo "Configuring $d"
-		rm -rf ${B}/$target/$d/
-		mkdir -p ${B}/$target/$d/
-		cd ${B}/$target/$d/
+		rm -rf ${B}/${TARGET_SYS}/$d/
+		mkdir -p ${B}/${TARGET_SYS}/$d/
+		cd ${B}/${TARGET_SYS}/$d/
 		chmod a+x ${S}/$d/configure
-		relpath=${@os.path.relpath("${S}/$d", "${B}/$target/$d")}
+		relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
 		$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	done
 }
@@ -48,18 +47,16 @@ EXTRACONFFUNCS += "extract_stashed_builddir"
 do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	for d in libgcc ${RUNTIMETARGET}; do
-		cd ${B}/$target/$d/
-		oe_runmake MULTIBUILDTOP=${B}/$target/$d/
+		cd ${B}/${TARGET_SYS}/$d/
+		oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
 	done
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	for d in ${RUNTIMETARGET}; do
-		cd ${B}/$target/$d/
-		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
+		cd ${B}/${TARGET_SYS}/$d/
+		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
 	done
 	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
 	rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index ae3afe0..f97885b 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -12,34 +12,29 @@ EXTRA_OECONF_PATHS = "\
 "
 
 do_configure () {
-    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-
-    echo "Configuring libsanitizer"
-    rm -rf ${B}/$target/libsanitizer/
-    mkdir -p ${B}/$target/libsanitizer/
-    cd ${B}/$target/libsanitizer/
+    rm -rf ${B}/${TARGET_SYS}/libsanitizer/
+    mkdir -p ${B}/${TARGET_SYS}/libsanitizer/
+    cd ${B}/${TARGET_SYS}/libsanitizer/
     chmod a+x ${S}/libsanitizer/configure
-    relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/$target/libsanitizer")}
+    relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/${TARGET_SYS}/libsanitizer")}
     $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
     # Easiest way to stop bad RPATHs getting into the library since we have a
     # broken libtool here
-    sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool
+    sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libsanitizer/libtool
     # Link to the sysroot's libstdc++ instead of one gcc thinks it just built
-    sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/$target/libsanitizer/*/Makefile
+    sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/${TARGET_SYS}/libsanitizer/*/Makefile
 }
 EXTRACONFFUNCS += "extract_stashed_builddir"
 do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    cd ${B}/$target/libsanitizer/
-    oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/
+    cd ${B}/${TARGET_SYS}/libsanitizer/
+    oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/
 }
 
 do_install () {
-    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-    cd ${B}/$target/libsanitizer/
-    oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install
+    cd ${B}/${TARGET_SYS}/libsanitizer/
+    oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install
     if [ -d ${D}${infodir} ]; then
         rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
     fi
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index c0efc29..848a476 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -5,10 +5,9 @@ require gcc-configure-common.inc
 INHIBIT_DEFAULT_DEPS = "1"
 
 do_configure () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	install -d ${D}${base_libdir} ${D}${libdir}
 	mkdir -p ${B}/${BPN}
-	mkdir -p ${B}/$target/${BPN}/
+	mkdir -p ${B}/${TARGET_SYS}/${BPN}/
 	cd ${B}/${BPN}
 	chmod a+x ${S}/${BPN}/configure
 	relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
@@ -18,15 +17,13 @@ EXTRACONFFUNCS += "extract_stashed_builddir"
 do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
-	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
+	oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/ install
 
 	# Move libgcc_s into /lib
 	mkdir -p ${D}${base_libdir}
diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc
index d3e2b41..4846dec 100644
--- a/meta/recipes-devtools/gcc/libgfortran.inc
+++ b/meta/recipes-devtools/gcc/libgfortran.inc
@@ -6,32 +6,27 @@ EXTRA_OECONF_PATHS = "\
 "
 
 do_configure () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-
-	echo "Configuring libgfortran"
-	rm -rf ${B}/$target/libgfortran/
-	mkdir -p ${B}/$target/libgfortran/
-	cd ${B}/$target/libgfortran/
+	rm -rf ${B}/${TARGET_SYS}/libgfortran/
+	mkdir -p ${B}/${TARGET_SYS}/libgfortran/
+	cd ${B}/${TARGET_SYS}/libgfortran/
 	chmod a+x ${S}/libgfortran/configure
-	relpath=${@os.path.relpath("${S}/libgfortran", "${B}/$target/libgfortran")}
+	relpath=${@os.path.relpath("${S}/libgfortran", "${B}/${TARGET_SYS}/libgfortran")}
 	$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 	# Easiest way to stop bad RPATHs getting into the library since we have a
 	# broken libtool here
-	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool
+	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libgfortran/libtool
 }
 EXTRACONFFUNCS += "extract_stashed_builddir"
 do_configure[depends] += "${COMPILERDEP}"
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/$target/libgfortran/
-	oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
+	cd ${B}/${TARGET_SYS}/libgfortran/
+	oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/$target/libgfortran/
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libgfortran/ install
+	cd ${B}/${TARGET_SYS}/libgfortran/
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/ install
 	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
 		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
 	fi
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-25 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 11:40 [PATCH 1/4] staging: Remove hardcoded PACKAGE_ARCHS from the class Richard Purdie
2017-01-25 11:40 ` [PATCH 2/4] gcc: Split builddir saving into its own sstate task Richard Purdie
2017-01-25 11:40 ` [PATCH 3/4] gcc/gcc-source: Move libcc1 manipulation into gcc-source Richard Purdie
2017-01-25 11:40 ` [PATCH 4/4] gcc: Clean up unnecessary variable confusion Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.