All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages
@ 2013-08-22 11:29 Richard Purdie
  2013-08-22 11:29 ` [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk Richard Purdie
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

When copying the sources for the debug source package we use cpio -Ll
which means to copy files as hardlinks and to dereference symlinks.
It appears there is a bug in cpio since -Ll will copy symlinks and
not dereference them. We therefore do a second pass over copied symlinks
resolving them into files. Ideally we would copy these as hardlinks as well
however it doesn't seem worth the extra code and effort for what amounts
to a corner case for a minor space improvement.

This means that the -dbg packages no longer contain broken symlinks.

[YOCTO #5020]

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

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2460d0a..f6f9310 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -316,6 +316,12 @@ def copydebugsources(debugsrcdir, d):
         #if retval:
         #    bb.fatal("debug source copy failed with exit code %s (cmd was %s)" % (retval, cmd))
 
+        # cpio seems to have a bug with -lL together and symbolic links are just copied, not dereferenced.
+        # Work around this by manually finding and copying any symbolic links that made it through.
+        cmd = "find %s%s -type l -print0 -delete | sed s#%s%s/##g | (cd '%s' ; cpio -pd0mL --no-preserve-owner '%s%s' 2>/dev/null)" % (dvar, debugsrcdir, dvar, debugsrcdir, workparentdir, dvar, debugsrcdir)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        if retval:
+            bb.fatal("debugsrc symlink fixup failed with exit code %s (cmd was %s)" % (retval, cmd))
 
         # The copy by cpio may have resulted in some empty directories!  Remove these
         cmd = "find %s%s -empty -type d -delete" % (dvar, debugsrcdir)
-- 
1.8.1.2



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

* [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 03/28] populate_sdk_base: Allow sdk tar options to be overridden Richard Purdie
                   ` (26 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

${exec_prefix_nativesdk} doesn't exist so use prefix_nativesdk instead.
This resolves issues for code which attepts to use target_exec_prefix.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/crosssdk.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/crosssdk.bbclass b/meta/classes/crosssdk.bbclass
index 32b14d3..810f61d 100644
--- a/meta/classes/crosssdk.bbclass
+++ b/meta/classes/crosssdk.bbclass
@@ -23,7 +23,7 @@ target_libdir = "${SDKPATHNATIVE}${libdir_nativesdk}"
 target_includedir = "${SDKPATHNATIVE}${includedir_nativesdk}"
 target_base_libdir = "${SDKPATHNATIVE}${base_libdir_nativesdk}"
 target_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
-target_exec_prefix = "${SDKPATHNATIVE}${exec_prefix_nativesdk}"
+target_exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
 baselib = "lib"
 
 do_populate_sysroot[stamp-extra-info] = ""
-- 
1.8.1.2



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

* [PATCH 03/28] populate_sdk_base: Allow sdk tar options to be overridden
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
  2013-08-22 11:29 ` [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 04/28] gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian Richard Purdie
                   ` (25 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

It can be useful to override or append options to the SDK tarball creation command
so add a variable to allow this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/populate_sdk_base.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index aa3c2fa..998280e 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -108,11 +108,13 @@ fakeroot create_sdk_files() {
 	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
 }
 
+SDKTAROPTS = "--owner=root --group=root -j"
+
 fakeroot tar_sdk() {
 	# Package it up
 	mkdir -p ${SDK_DEPLOY}
 	cd ${SDK_OUTPUT}/${SDKPATH}
-	tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+	tar ${SDKTAROPTS} -c --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
 }
 
 fakeroot create_shar() {
-- 
1.8.1.2



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

* [PATCH 04/28] gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
  2013-08-22 11:29 ` [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk Richard Purdie
  2013-08-22 11:29 ` [PATCH 03/28] populate_sdk_base: Allow sdk tar options to be overridden Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 05/28] libiconv: Extend to nativesdk and support non-linux targets Richard Purdie
                   ` (24 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

The gettext handling of USE_NLS has become a bit tricky to understand, or
alter from the SDK context. This patch introduces a SDKUSE_NLS which can
be set to configure a given SDK/ADT to use NLS or not. This is independent
of the target system NLS usage.

The code in gettext.bbclass is therefore simplified and the classes
themselves now set USE_NLS to appropriate values. No NLS is used
for native, cross and crosssdk since it is never used there and
would just increase build time.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/cross-canadian.bbclass | 2 ++
 meta/classes/cross.bbclass          | 2 ++
 meta/classes/crosssdk.bbclass       | 2 ++
 meta/classes/gettext.bbclass        | 8 +++-----
 meta/classes/native.bbclass         | 2 ++
 meta/classes/nativesdk.bbclass      | 2 ++
 meta/conf/bitbake.conf              | 1 +
 7 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index 7ab36ac..fa2ab70 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -94,3 +94,5 @@ SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/
 SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/"
 
 do_populate_sysroot[stamp-extra-info] = ""
+
+USE_NLS = "${SDKUSE_NLS}"
diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 54584fe..f6e7dc1 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -75,3 +75,5 @@ cross_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 }
+
+USE_NLS = "no"
diff --git a/meta/classes/crosssdk.bbclass b/meta/classes/crosssdk.bbclass
index 810f61d..635c0c4 100644
--- a/meta/classes/crosssdk.bbclass
+++ b/meta/classes/crosssdk.bbclass
@@ -30,3 +30,5 @@ do_populate_sysroot[stamp-extra-info] = ""
 
 # Need to force this to ensure consitency accross architectures
 EXTRA_OECONF_FPU = ""
+
+USE_NLS = "no"
diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
index 17c894f..03b89b2 100644
--- a/meta/classes/gettext.bbclass
+++ b/meta/classes/gettext.bbclass
@@ -1,17 +1,15 @@
 def gettext_dependencies(d):
-    if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d, 'native', 'nativesdk', 'cross'):
-        return ""
     if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
         return ""
-    if oe.utils.inherits(d, 'native', 'cross'):
+    if d.getVar('USE_NLS', True) == 'no':
         return "gettext-minimal-native"
     return d.getVar('DEPENDS_GETTEXT', False)
 
 def gettext_oeconf(d):
-    if oe.utils.inherits(d, 'native', 'cross'):
+    if d.getVar('USE_NLS', True) == 'no':
         return '--disable-nls'
     # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
-    if (d.getVar('USE_NLS', True) == 'no' or d.getVar('INHIBIT_DEFAULT_DEPS', True)) and not oe.utils.inherits(d, 'nativesdk', 'cross-canadian'):
+    if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
         return '--disable-nls'
     return "--enable-nls"
 
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index 04f0d06..102dfb8 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -158,3 +158,5 @@ do_package_write_deb[noexec] = "1"
 do_package_write_rpm[noexec] = "1"
 
 do_populate_sysroot[stamp-extra-info] = ""
+
+USE_NLS = "no"
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index 96e1b42..5b9d1f5 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -89,3 +89,5 @@ addhandler nativesdk_virtclass_handler
 nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
 
 do_populate_sysroot[stamp-extra-info] = ""
+
+USE_NLS = "${SDKUSE_NLS}"
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 07eb473..8ae3ad2 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -110,6 +110,7 @@ TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}"
 LIBCEXTENSION ??= ""
 ABIEXTENSION ??= ""
 USE_NLS ??= "yes"
+SDKUSE_NLS ??= "yes"
 
 TARGET_ARCH = "${TUNE_ARCH}"
 TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
-- 
1.8.1.2



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

* [PATCH 05/28] libiconv: Extend to nativesdk and support non-linux targets
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (2 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 04/28] gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 06/28] gcc-cross-canadian-4.8: Enable PARALLEL_MAKE Richard Purdie
                   ` (23 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

This library is currently only available when targeting non-libc. This patch
also makes it available when targetting non-linux since it is likely of use
then.

It also adds a BBCLASSEXTEND for nativesdk since again, it can be useful
in that context.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-support/libiconv/libiconv_1.14.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-support/libiconv/libiconv_1.14.bb b/meta/recipes-support/libiconv/libiconv_1.14.bb
index b1d2612..470900b 100644
--- a/meta/recipes-support/libiconv/libiconv_1.14.bb
+++ b/meta/recipes-support/libiconv/libiconv_1.14.bb
@@ -22,6 +22,8 @@ S = "${WORKDIR}/libiconv-${PV}"
 inherit autotools pkgconfig gettext
 
 python __anonymous() {
+    if d.getVar("TARGET_OS", True) != "linux":
+        return
     if d.getVar("TCLIBC", True) == "eglibc":
         raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - eglibc already provides iconv")
 }
@@ -44,3 +46,5 @@ do_install_append () {
 	rm -rf ${D}${libdir}/preloadable_libiconv.so
 	rm -rf ${D}${libdir}/charset.alias
 }
+
+BBCLASSEXTEND = "nativesdk"
-- 
1.8.1.2



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

* [PATCH 06/28] gcc-cross-canadian-4.8: Enable PARALLEL_MAKE
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (3 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 05/28] libiconv: Extend to nativesdk and support non-linux targets Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 07/28] gcc-package-sdk.inc: Use relative symlinks in libexec dir Richard Purdie
                   ` (22 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

This disabling of PARALLEL_MAKE has been forward ported for gcc-cross-canadian
since at least 2009-09 and gcc 4.3.3, probably older.

I've tested this with high values of parallel make and it all seems to work and
we usually build gcc with parallel make so it seems unlikely there are issues.
Lets therefore enable it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
index 53c4632..278a529 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
@@ -20,7 +20,5 @@ EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \
 # to find libmpfr
 # export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}"
 
-PARALLEL_MAKE = ""
-
 # gcc 4.7 needs -isystem
 export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
-- 
1.8.1.2



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

* [PATCH 07/28] gcc-package-sdk.inc: Use relative symlinks in libexec dir
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (4 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 06/28] gcc-cross-canadian-4.8: Enable PARALLEL_MAKE Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 08/28] gcc-package-sdk.inc: Allow executable extension to be overridden Richard Purdie
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

We already use relative links for other gcc libexec links, this changes the sdk
do_install to match elsewhere and use relative symlinks too. This makes things
slightly easier in the SDK installation process and standardises.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-package-sdk.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/gcc/gcc-package-sdk.inc b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
index bb6dfde..b546d5c 100644
--- a/meta/recipes-devtools/gcc/gcc-package-sdk.inc
+++ b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
@@ -28,6 +28,9 @@ FILES_${PN}-doc = "\
     ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
     "
 
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}"
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install-host
 
@@ -64,7 +67,7 @@ do_install () {
 			continue
 		fi
 
-		ln -sf ${bindir}/${TARGET_PREFIX}$t $dest$t
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
 	done
 
 	chown -R root:root ${D}
-- 
1.8.1.2



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

* [PATCH 08/28] gcc-package-sdk.inc: Allow executable extension to be overridden
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (5 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 07/28] gcc-package-sdk.inc: Use relative symlinks in libexec dir Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 09/28] gcc-configure-sdk.inc: Don't build target-libgcc Richard Purdie
                   ` (20 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

On platforms like windows, executables have extensions. Whilst I'm not proposing
we wholesale support windows extensions, this small tweak allows a cross compiler
targetting mingw to be built which does seem like a good use case.

The patch therefore adds an EXEEXT which the mingw layer can set for the libexec
symlinks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-package-sdk.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-package-sdk.inc b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
index b546d5c..21beccc 100644
--- a/meta/recipes-devtools/gcc/gcc-package-sdk.inc
+++ b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
@@ -28,6 +28,8 @@ FILES_${PN}-doc = "\
     ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
     "
 
+EXEEXT = ""
+
 # Compute how to get from libexecdir to bindir in python (easier than shell)
 BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}"
 
@@ -62,12 +64,13 @@ do_install () {
 	# found.
 	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
 	install -d $dest
+	suffix=${EXEEXT}
 	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t ]; then
+		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
 			continue
 		fi
 
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
 	done
 
 	chown -R root:root ${D}
-- 
1.8.1.2



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

* [PATCH 09/28] gcc-configure-sdk.inc: Don't build target-libgcc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (6 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 08/28] gcc-package-sdk.inc: Allow executable extension to be overridden Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 10/28] gcc: Drop gcc-cross4.inc, its pointless now Richard Purdie
                   ` (19 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

I don't understand why we're building the target libgcc in the canadian-cross build
since it should have been built elsewhere. The compiler configuration isn't correct
to build a working target libgcc in all cases anyway.

To avoid various weird build errors, stop building it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-configure-sdk.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/gcc/gcc-configure-sdk.inc b/meta/recipes-devtools/gcc/gcc-configure-sdk.inc
index 51c0217..6c55bc7 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-sdk.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-sdk.inc
@@ -43,5 +43,5 @@ do_configure () {
 }
 
 do_compile () {
-	oe_runmake all-host all-target-libgcc
+	oe_runmake all-host
 }
-- 
1.8.1.2



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

* [PATCH 10/28] gcc: Drop gcc-cross4.inc, its pointless now
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (7 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 09/28] gcc-configure-sdk.inc: Don't build target-libgcc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 11/28] gcc-cross-canadian-4.8: Allow elfutils to be a configurable dependency Richard Purdie
                   ` (18 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

The include was useful historically, its not anymore so lets remove it.
This should have no functional change except on any layers directly depending
on it or gcc-cross.inc but even then it would only impact sh4 and is easily
fixed if there was a problem.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross.inc    | 2 ++
 meta/recipes-devtools/gcc/gcc-cross4.inc   | 3 ---
 meta/recipes-devtools/gcc/gcc-cross_4.7.bb | 2 +-
 meta/recipes-devtools/gcc/gcc-cross_4.8.bb | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-cross4.inc

diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 9d29f56..2913df7 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -106,3 +106,5 @@ STOP
 	chmod +x ${B}/${TARGET_PREFIX}testgcc
 
 }
+
+EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
diff --git a/meta/recipes-devtools/gcc/gcc-cross4.inc b/meta/recipes-devtools/gcc/gcc-cross4.inc
deleted file mode 100644
index 4a20818..0000000
--- a/meta/recipes-devtools/gcc/gcc-cross4.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-require gcc-cross.inc
-
-EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.7.bb b/meta/recipes-devtools/gcc/gcc-cross_4.7.bb
index d605235..b02ea13 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.7.bb
@@ -1,5 +1,5 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-cross4.inc
+require gcc-cross.inc
 
 EXTRA_OECONF += "--disable-libunwind-exceptions \
                  --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
index d605235..b02ea13 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
@@ -1,5 +1,5 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-cross4.inc
+require gcc-cross.inc
 
 EXTRA_OECONF += "--disable-libunwind-exceptions \
                  --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
-- 
1.8.1.2



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

* [PATCH 11/28] gcc-cross-canadian-4.8: Allow elfutils to be a configurable dependency
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (8 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 10/28] gcc: Drop gcc-cross4.inc, its pointless now Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 12/28] gcc-cross-canadian-4.8: Add missing dependency on nativesdk-zlib Richard Purdie
                   ` (17 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Some SDK platforms have elfutils support, some do not, therefore allow
this to be configured.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
index 278a529..49ba75f 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
@@ -5,8 +5,9 @@ require gcc-cross-canadian.inc
 require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
-DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils"
-RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils"
+ELFUTILS = "nativesdk-elfutils"
+DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
+RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
 
 SYSTEMHEADERS = "/usr/include"
 SYSTEMLIBS = "${target_base_libdir}/"
-- 
1.8.1.2



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

* [PATCH 12/28] gcc-cross-canadian-4.8: Add missing dependency on nativesdk-zlib
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (9 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 11/28] gcc-cross-canadian-4.8: Allow elfutils to be a configurable dependency Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 13/28] gcc-cross-canadian: Merge 4.7 and 4.8 recipes into common include Richard Purdie
                   ` (16 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
index 49ba75f..bf49c3d 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
@@ -6,7 +6,7 @@ require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
 ELFUTILS = "nativesdk-elfutils"
-DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
+DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
 RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
 
 SYSTEMHEADERS = "/usr/include"
-- 
1.8.1.2



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

* [PATCH 13/28] gcc-cross-canadian: Merge 4.7 and 4.8 recipes into common include
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (10 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 12/28] gcc-cross-canadian-4.8: Add missing dependency on nativesdk-zlib Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 14/28] Revert "nativesdk: inherit relocatable" Richard Purdie
                   ` (15 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

This removes duplication and follows the pattern of the other gcc recipes.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc   | 19 ++++++++++++++++++
 .../recipes-devtools/gcc/gcc-cross-canadian_4.7.bb | 23 ----------------------
 .../recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 20 -------------------
 3 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 10ddacf..85c3166 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -7,3 +7,22 @@ BPN = "gcc"
 DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext"
 
 GCCMULTILIB = "--enable-multilib"
+
+require gcc-configure-sdk.inc
+require gcc-package-sdk.inc
+
+ELFUTILS = "nativesdk-elfutils"
+DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
+RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
+
+SYSTEMHEADERS = "/usr/include"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \
+		--disable-libgomp --disable-libmudflap \
+		--with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
+		--with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}"
+
+# gcc 4.7 needs -isystem
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.7.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.7.bb
index 53c4632..355757c 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.7.bb
@@ -1,26 +1,3 @@
-inherit cross-canadian
-
 require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-cross-canadian.inc
-require gcc-configure-sdk.inc
-require gcc-package-sdk.inc
-
-DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils"
-RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils"
-
-SYSTEMHEADERS = "/usr/include"
-SYSTEMLIBS = "${target_base_libdir}/"
-SYSTEMLIBS1 = "${target_libdir}/"
-
-EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \
-		--disable-libgomp --disable-libmudflap \
-		--with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
-		--with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}"
-
-# to find libmpfr
-# export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}"
-
-PARALLEL_MAKE = ""
 
-# gcc 4.7 needs -isystem
-export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
index bf49c3d..bf53c5c 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
@@ -1,25 +1,5 @@
-inherit cross-canadian
-
 require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-cross-canadian.inc
-require gcc-configure-sdk.inc
-require gcc-package-sdk.inc
-
-ELFUTILS = "nativesdk-elfutils"
-DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
-RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
-
-SYSTEMHEADERS = "/usr/include"
-SYSTEMLIBS = "${target_base_libdir}/"
-SYSTEMLIBS1 = "${target_libdir}/"
 
-EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \
-		--disable-libgomp --disable-libmudflap \
-		--with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
-		--with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}"
 
-# to find libmpfr
-# export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}"
 
-# gcc 4.7 needs -isystem
-export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
-- 
1.8.1.2



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

* [PATCH 14/28] Revert "nativesdk: inherit relocatable"
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (11 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 13/28] gcc-cross-canadian: Merge 4.7 and 4.8 recipes into common include Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 15/28] bitbake.conf/classes/gcc: Don't hardcode -nativesdk Richard Purdie
                   ` (14 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

This reverts commit f93ddea31fcf18833c9bc6e93d93ad223c62eded.

We never run nativesdk binaries so it doesn't make sense to use the relocatable
class. The chrpath calls at packaging time will ensure the binaries are relocated
in the final packages. The binaries in the sysroot are never used.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/nativesdk.bbclass | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index 5b9d1f5..0d5cba4 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -1,5 +1,3 @@
-inherit relocatable
-
 # SDK packages are built either explicitly by the user,
 # or indirectly via dependency.  No need to be in 'world'.
 EXCLUDE_FROM_WORLD = "1"
-- 
1.8.1.2



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

* [PATCH 15/28] bitbake.conf/classes/gcc: Don't hardcode -nativesdk
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (12 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 14/28] Revert "nativesdk: inherit relocatable" Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 16/28] gcc-cross: Fold common configuration into gcc-cross.inc Richard Purdie
                   ` (13 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Hardcoding -nativesdk as the sdk package architecture is inflexible. We may have
multiple different target OS and we need a way to be able to separate them. Turning
this into a configurable value allows the flexibility we need to build different
SDKMACHINEs with different OS targets.

The commit should have no behaviour change, just makes things more configurable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/cross-canadian.bbclass                 | 16 ++++++++--------
 meta/classes/crosssdk.bbclass                       |  2 +-
 meta/classes/nativesdk.bbclass                      |  2 +-
 meta/conf/bitbake.conf                              |  3 ++-
 meta/recipes-devtools/gcc/gcc-configure-runtime.inc |  8 ++++----
 meta/recipes-devtools/gcc/libgcc_4.7.bb             |  6 +++---
 meta/recipes-devtools/gcc/libgcc_4.8.bb             |  6 +++---
 7 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index fa2ab70..87dd994 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -14,25 +14,25 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S
 #
 # Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
 #
-PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
 python () {
     archs = d.getVar('PACKAGE_ARCHS', True).split()
     sdkarchs = []
     for arch in archs:
-        sdkarchs.append(arch + '-nativesdk')
+        sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
     d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
 }
 MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
+STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
 
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
 
 PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
-PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
-PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/"
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
 
 HOST_ARCH = "${SDK_ARCH}"
 HOST_VENDOR = "${SDK_VENDOR}"
@@ -90,8 +90,8 @@ export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
 export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
 
 # Cross-canadian packages need to pull in nativesdk dynamic libs
-SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/"
-SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/"
+SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/"
+SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/"
 
 do_populate_sysroot[stamp-extra-info] = ""
 
diff --git a/meta/classes/crosssdk.bbclass b/meta/classes/crosssdk.bbclass
index 635c0c4..bcc285b 100644
--- a/meta/classes/crosssdk.bbclass
+++ b/meta/classes/crosssdk.bbclass
@@ -7,7 +7,7 @@ python () {
 	d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH', True))
 }
 
-STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}"
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 
 TARGET_ARCH = "${SDK_ARCH}"
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index 0d5cba4..26d1e4a 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -11,7 +11,7 @@ CLASSOVERRIDE = "class-nativesdk"
 #
 # Update PACKAGE_ARCH and PACKAGE_ARCHS
 #
-PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
 PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
 
 #
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 8ae3ad2..4535f68 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -127,7 +127,8 @@ SDK_VENDOR = "-oesdk"
 SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' or 'custom')]}"
 SDK_PREFIX = "${SDK_SYS}-"
 SDK_CC_ARCH = "${BUILD_CC_ARCH}"
-SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-nativesdk"
+SDKPKGSUFFIX = "nativesdk"
+SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}"
 SDK_LD_ARCH = "${BUILD_LD_ARCH}"
 SDK_AS_ARCH = "${BUILD_AS_ARCH}"
 
diff --git a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
index 977a98a..f89ca6b 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
@@ -15,8 +15,8 @@ RUNTIMETARGET = "libssp libstdc++-v3 libgomp"
 
 do_configure () {
 	export CXX="${CXX} -nostdinc++ -nostdlib++"
-	mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B}
 	for d in libgcc ${RUNTIMETARGET}; do
 		echo "Configuring $d"
@@ -29,7 +29,7 @@ do_configure () {
 }
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	for d in libgcc ${RUNTIMETARGET}; do
 		cd ${B}/$target/$d/
 		oe_runmake MULTIBUILDTOP=${B}/$target/$d/
@@ -37,7 +37,7 @@ do_compile () {
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	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
diff --git a/meta/recipes-devtools/gcc/libgcc_4.7.bb b/meta/recipes-devtools/gcc/libgcc_4.7.bb
index 47669a2..3b5bb43 100644
--- a/meta/recipes-devtools/gcc/libgcc_4.7.bb
+++ b/meta/recipes-devtools/gcc/libgcc_4.7.bb
@@ -26,7 +26,7 @@ FILES_libgcov-dev = " \
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
 do_configure () {
-	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	install -d ${D}${base_libdir} ${D}${libdir}
 	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
 	mkdir -p ${B}/${BPN}
@@ -36,13 +36,13 @@ do_configure () {
 }
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
 	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
 	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
 
diff --git a/meta/recipes-devtools/gcc/libgcc_4.8.bb b/meta/recipes-devtools/gcc/libgcc_4.8.bb
index 47669a2..3b5bb43 100644
--- a/meta/recipes-devtools/gcc/libgcc_4.8.bb
+++ b/meta/recipes-devtools/gcc/libgcc_4.8.bb
@@ -26,7 +26,7 @@ FILES_libgcov-dev = " \
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
 do_configure () {
-	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	install -d ${D}${base_libdir} ${D}${libdir}
 	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
 	mkdir -p ${B}/${BPN}
@@ -36,13 +36,13 @@ do_configure () {
 }
 
 do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
 	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
 }
 
 do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
 	cd ${B}/${BPN}
 	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
 
-- 
1.8.1.2



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

* [PATCH 16/28] gcc-cross: Fold common configuration into gcc-cross.inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (13 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 15/28] bitbake.conf/classes/gcc: Don't hardcode -nativesdk Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 17/28] gcc-cross-initial: Fold common configuration into gcc-cross-initial.inc Richard Purdie
                   ` (12 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross.inc    | 12 ++++++++++++
 meta/recipes-devtools/gcc/gcc-cross_4.7.bb | 11 -----------
 meta/recipes-devtools/gcc/gcc-cross_4.8.bb | 11 -----------
 3 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 2913df7..c3542e2 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -108,3 +108,15 @@ STOP
 }
 
 EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
+
+EXTRA_OECONF += "--disable-libunwind-exceptions \
+                 --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
+                 --with-system-zlib "
+
+EXTRA_OECONF_PATHS = " \
+                      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
+                      --with-sysroot=${STAGING_DIR_TARGET} \
+                      --with-build-sysroot=${STAGING_DIR_TARGET}"
+
+
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.7.bb b/meta/recipes-devtools/gcc/gcc-cross_4.7.bb
index b02ea13..b43cca0 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.7.bb
@@ -1,14 +1,3 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-cross.inc
 
-EXTRA_OECONF += "--disable-libunwind-exceptions \
-                 --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
-                 --with-system-zlib "
-
-EXTRA_OECONF_PATHS = " \
-                      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
-                      --with-sysroot=${STAGING_DIR_TARGET} \
-                      --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
index b02ea13..b43cca0 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
@@ -1,14 +1,3 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-cross.inc
 
-EXTRA_OECONF += "--disable-libunwind-exceptions \
-                 --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
-                 --with-system-zlib "
-
-EXTRA_OECONF_PATHS = " \
-                      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
-                      --with-sysroot=${STAGING_DIR_TARGET} \
-                      --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
-- 
1.8.1.2



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

* [PATCH 17/28] gcc-cross-initial: Fold common configuration into gcc-cross-initial.inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (14 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 16/28] gcc-cross: Fold common configuration into gcc-cross.inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 18/28] gcc-runtime: Fold common configuration into gcc-configure-runtime.inc Richard Purdie
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross-initial.inc       | 2 ++
 meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb | 1 -
 meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
index 1ac1db6..8184538 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -24,6 +24,8 @@ EXTRA_OECONF = "--with-newlib \
 		${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
 		${EXTRA_OECONF_FPU}"
 
+EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
+
 GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot"
 
 do_configure_prepend () {
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb
index 39c90ca..fd90e11 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb
@@ -1,4 +1,3 @@
 require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
-EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
 
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb
index 39c90ca..fd90e11 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb
@@ -1,4 +1,3 @@
 require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
-EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
 
-- 
1.8.1.2



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

* [PATCH 18/28] gcc-runtime: Fold common configuration into gcc-configure-runtime.inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (15 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 17/28] gcc-cross-initial: Fold common configuration into gcc-cross-initial.inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 19/28] libgcc: Move common code to libgcc.inc Richard Purdie
                   ` (10 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-configure-runtime.inc | 5 +++++
 meta/recipes-devtools/gcc/gcc-runtime_4.7.bb        | 4 ----
 meta/recipes-devtools/gcc/gcc-runtime_4.8.bb        | 4 ----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
index f89ca6b..2ff8561 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
@@ -7,6 +7,11 @@ EXTRA_OECONF_PATHS = " \
     --with-sysroot=${STAGING_DIR_TARGET} \
     --with-build-sysroot=${STAGING_DIR_TARGET}"
 
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
+
+EXTRA_OECONF += "--disable-libunwind-exceptions"
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
 RUNTIMETARGET = "libssp libstdc++-v3 libgomp"
 #  ?
 # libiberty
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb
index fbaf057..c16d27e 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb
@@ -2,7 +2,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-configure-runtime.inc
 require gcc-package-runtime.inc
 
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
-
-EXTRA_OECONF += "--disable-libunwind-exceptions"
-EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
index fbaf057..c16d27e 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
@@ -2,7 +2,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc
 require gcc-configure-runtime.inc
 require gcc-package-runtime.inc
 
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
-
-EXTRA_OECONF += "--disable-libunwind-exceptions"
-EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
-- 
1.8.1.2



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

* [PATCH 19/28] libgcc: Move common code to libgcc.inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (16 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 18/28] gcc-runtime: Fold common configuration into gcc-configure-runtime.inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 20/28] gcc-target: Combine gcc-target-configure.inc, gcc-target-package.inc and other common code Richard Purdie
                   ` (9 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/libgcc.inc    | 143 +++++++++++++++++++++++++++++++
 meta/recipes-devtools/gcc/libgcc_4.7.bb | 144 +------------------------------
 meta/recipes-devtools/gcc/libgcc_4.8.bb | 145 +-------------------------------
 3 files changed, 145 insertions(+), 287 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/libgcc.inc

diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
new file mode 100644
index 0000000..fe98238
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -0,0 +1,143 @@
+INHIBIT_DEFAULT_DEPS = "1"
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+PACKAGES = "\
+  ${PN} \
+  ${PN}-dev \
+  ${PN}-dbg \
+  libgcov-dev \
+  "
+
+FILES_${PN} = "${base_libdir}/libgcc*.so.*"
+FILES_${PN}-dev = " \
+  ${base_libdir}/libgcc*.so \
+  ${libdir}/${TARGET_SYS}/${BINV}/*crt* \
+  ${libdir}/${TARGET_SYS}/${BINV}/64 \
+  ${libdir}/${TARGET_SYS}/${BINV}/32 \
+  ${libdir}/${TARGET_SYS}/${BINV}/x32 \
+  ${libdir}/${TARGET_SYS}/${BINV}/n32 \
+  ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
+FILES_libgcov-dev = " \
+  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
+  "
+FILES_${PN}-dbg += "${base_libdir}/.debug/"
+
+do_configure () {
+	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	install -d ${D}${base_libdir} ${D}${libdir}
+	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
+	mkdir -p ${B}/${BPN}
+	cd ${B}/${BPN}
+	chmod a+x ${S}/${BPN}/configure
+	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+
+do_compile () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cd ${B}/${BPN}
+	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
+}
+
+do_install () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cd ${B}/${BPN}
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
+
+	# Move libgcc_s into /lib
+	mkdir -p ${D}${base_libdir}
+	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
+		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
+	else
+		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
+	fi
+
+	# install the runtime in /usr/lib/ not in /usr/lib/gcc on target
+	# so that cross-gcc can find it in the sysroot
+
+	mv ${D}${libdir}/gcc/* ${D}${libdir}
+	rm -rf ${D}${libdir}/gcc/
+	# unwind.h is installed here which is shipped in gcc-cross
+	# as well as target gcc and they are identical so we dont
+	# ship one with libgcc here
+	rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
+}
+
+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"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+
+BBCLASSEXTEND = "nativesdk"
+
+INSANE_SKIP_${PN}-dev = "staticdev"
+INSANE_SKIP_${MLPREFIX}libgcov-dev = "staticdev"
+
+addtask multilib_install after do_install before do_package do_populate_sysroot
+# this makes multilib gcc files findable for target gcc
+# e.g.
+#    /usr/lib/i586-pokymllib32-linux/4.7/
+# by creating this symlink to it
+#    /usr/lib64/x86_64-poky-linux/4.7/32
+
+python do_multilib_install() {
+    import re
+
+    multilibs = d.getVar('MULTILIB_VARIANTS', True)
+    if not multilibs or bb.data.inherits_class('nativesdk', d):
+        return
+
+    binv = d.getVar('BINV', True)
+
+    mlprefix = d.getVar('MLPREFIX', True)
+    if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
+        return
+
+    if mlprefix:
+        orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
+        orig_tune_params = get_tune_parameters(orig_tune, d)
+        orig_tune_baselib = orig_tune_params['baselib']
+        orig_tune_bitness = orig_tune_baselib.replace('lib', '')
+        if not orig_tune_bitness:
+            orig_tune_bitness = '32'
+
+        src = '../../../' + orig_tune_baselib + '/' + \
+            d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
+
+        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
+
+        if os.path.lexists(dest):
+            os.unlink(dest)
+        os.symlink(src, dest)
+        return
+
+
+    for ml in multilibs.split():
+        tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
+        if not tune:
+            bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
+            continue
+
+        tune_parameters = get_tune_parameters(tune, d)
+        tune_baselib = tune_parameters['baselib']
+        if not tune_baselib:
+            bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+            continue
+
+        tune_arch = tune_parameters['arch']
+        tune_bitness = tune_baselib.replace('lib', '')
+        if not tune_bitness:
+            tune_bitness = '32' # /lib => 32bit lib
+
+        src = '../../../' + tune_baselib + '/' + \
+            tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
+            '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
+
+        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
+
+        if os.path.lexists(dest):
+            os.unlink(dest)
+        os.symlink(src, dest)
+}
diff --git a/meta/recipes-devtools/gcc/libgcc_4.7.bb b/meta/recipes-devtools/gcc/libgcc_4.7.bb
index 3b5bb43..9716e2e 100644
--- a/meta/recipes-devtools/gcc/libgcc_4.7.bb
+++ b/meta/recipes-devtools/gcc/libgcc_4.7.bb
@@ -1,145 +1,3 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
 
-INHIBIT_DEFAULT_DEPS = "1"
-
-DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
-
-PACKAGES = "\
-  ${PN} \
-  ${PN}-dev \
-  ${PN}-dbg \
-  libgcov-dev \
-  "
-
-FILES_${PN} = "${base_libdir}/libgcc*.so.*"
-FILES_${PN}-dev = " \
-  ${base_libdir}/libgcc*.so \
-  ${libdir}/${TARGET_SYS}/${BINV}/*crt* \
-  ${libdir}/${TARGET_SYS}/${BINV}/64 \
-  ${libdir}/${TARGET_SYS}/${BINV}/32 \
-  ${libdir}/${TARGET_SYS}/${BINV}/x32 \
-  ${libdir}/${TARGET_SYS}/${BINV}/n32 \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
-FILES_libgcov-dev = " \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
-  "
-FILES_${PN}-dbg += "${base_libdir}/.debug/"
-
-do_configure () {
-	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	install -d ${D}${base_libdir} ${D}${libdir}
-	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
-	mkdir -p ${B}/${BPN}
-	cd ${B}/${BPN}
-	chmod a+x ${S}/${BPN}/configure
-	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
-}
-
-do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/${BPN}
-	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
-}
-
-do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/${BPN}
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
-
-	# Move libgcc_s into /lib
-	mkdir -p ${D}${base_libdir}
-	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
-		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
-	else
-		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
-	fi
-
-	# install the runtime in /usr/lib/ not in /usr/lib/gcc on target
-	# so that cross-gcc can find it in the sysroot
-
-	mv ${D}${libdir}/gcc/* ${D}${libdir}
-	rm -rf ${D}${libdir}/gcc/
-	# unwind.h is installed here which is shipped in gcc-cross
-	# as well as target gcc and they are identical so we dont
-	# ship one with libgcc here
-	rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
-}
-
-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"
-do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
-
-BBCLASSEXTEND = "nativesdk"
-
-INSANE_SKIP_${PN}-dev = "staticdev"
-INSANE_SKIP_${MLPREFIX}libgcov-dev = "staticdev"
-
-addtask multilib_install after do_install before do_package do_populate_sysroot
-# this makes multilib gcc files findable for target gcc
-# e.g.
-#    /usr/lib/i586-pokymllib32-linux/4.7/
-# by creating this symlink to it
-#    /usr/lib64/x86_64-poky-linux/4.7/32
-
-python do_multilib_install() {
-    import re
-
-    multilibs = d.getVar('MULTILIB_VARIANTS', True)
-    if not multilibs or bb.data.inherits_class('nativesdk', d):
-        return
-
-    binv = d.getVar('BINV', True)
-
-    mlprefix = d.getVar('MLPREFIX', True)
-    if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
-        return
-
-    if mlprefix:
-        orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
-        orig_tune_params = get_tune_parameters(orig_tune, d)
-        orig_tune_baselib = orig_tune_params['baselib']
-        orig_tune_bitness = orig_tune_baselib.replace('lib', '')
-        if not orig_tune_bitness:
-            orig_tune_bitness = '32'
-
-        src = '../../../' + orig_tune_baselib + '/' + \
-            d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
-
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
-            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
-
-        if os.path.lexists(dest):
-            os.unlink(dest)
-        os.symlink(src, dest)
-        return
-
-
-    for ml in multilibs.split():
-        tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
-        if not tune:
-            bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
-            continue
-
-        tune_parameters = get_tune_parameters(tune, d)
-        tune_baselib = tune_parameters['baselib']
-        if not tune_baselib:
-            bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
-            continue
-
-        tune_arch = tune_parameters['arch']
-        tune_bitness = tune_baselib.replace('lib', '')
-        if not tune_bitness:
-            tune_bitness = '32' # /lib => 32bit lib
-
-        src = '../../../' + tune_baselib + '/' + \
-            tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
-            '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
-
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
-            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
-
-        if os.path.lexists(dest):
-            os.unlink(dest)
-        os.symlink(src, dest)
-}
diff --git a/meta/recipes-devtools/gcc/libgcc_4.8.bb b/meta/recipes-devtools/gcc/libgcc_4.8.bb
index 3b5bb43..a5152f2 100644
--- a/meta/recipes-devtools/gcc/libgcc_4.8.bb
+++ b/meta/recipes-devtools/gcc/libgcc_4.8.bb
@@ -1,145 +1,2 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-
-INHIBIT_DEFAULT_DEPS = "1"
-
-DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
-
-PACKAGES = "\
-  ${PN} \
-  ${PN}-dev \
-  ${PN}-dbg \
-  libgcov-dev \
-  "
-
-FILES_${PN} = "${base_libdir}/libgcc*.so.*"
-FILES_${PN}-dev = " \
-  ${base_libdir}/libgcc*.so \
-  ${libdir}/${TARGET_SYS}/${BINV}/*crt* \
-  ${libdir}/${TARGET_SYS}/${BINV}/64 \
-  ${libdir}/${TARGET_SYS}/${BINV}/32 \
-  ${libdir}/${TARGET_SYS}/${BINV}/x32 \
-  ${libdir}/${TARGET_SYS}/${BINV}/n32 \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
-FILES_libgcov-dev = " \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
-  "
-FILES_${PN}-dbg += "${base_libdir}/.debug/"
-
-do_configure () {
-	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	install -d ${D}${base_libdir} ${D}${libdir}
-	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
-	mkdir -p ${B}/${BPN}
-	cd ${B}/${BPN}
-	chmod a+x ${S}/${BPN}/configure
-	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
-}
-
-do_compile () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/${BPN}
-	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
-}
-
-do_install () {
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cd ${B}/${BPN}
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
-
-	# Move libgcc_s into /lib
-	mkdir -p ${D}${base_libdir}
-	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
-		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
-	else
-		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
-	fi
-
-	# install the runtime in /usr/lib/ not in /usr/lib/gcc on target
-	# so that cross-gcc can find it in the sysroot
-
-	mv ${D}${libdir}/gcc/* ${D}${libdir}
-	rm -rf ${D}${libdir}/gcc/
-	# unwind.h is installed here which is shipped in gcc-cross
-	# as well as target gcc and they are identical so we dont
-	# ship one with libgcc here
-	rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
-}
-
-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"
-do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
-
-BBCLASSEXTEND = "nativesdk"
-
-INSANE_SKIP_${PN}-dev = "staticdev"
-INSANE_SKIP_${MLPREFIX}libgcov-dev = "staticdev"
-
-addtask multilib_install after do_install before do_package do_populate_sysroot
-# this makes multilib gcc files findable for target gcc
-# e.g.
-#    /usr/lib/i586-pokymllib32-linux/4.7/
-# by creating this symlink to it
-#    /usr/lib64/x86_64-poky-linux/4.7/32
-
-python do_multilib_install() {
-    import re
-
-    multilibs = d.getVar('MULTILIB_VARIANTS', True)
-    if not multilibs or bb.data.inherits_class('nativesdk', d):
-        return
-
-    binv = d.getVar('BINV', True)
-
-    mlprefix = d.getVar('MLPREFIX', True)
-    if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
-        return
-
-    if mlprefix:
-        orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
-        orig_tune_params = get_tune_parameters(orig_tune, d)
-        orig_tune_baselib = orig_tune_params['baselib']
-        orig_tune_bitness = orig_tune_baselib.replace('lib', '')
-        if not orig_tune_bitness:
-            orig_tune_bitness = '32'
-
-        src = '../../../' + orig_tune_baselib + '/' + \
-            d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
-
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
-            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
-
-        if os.path.lexists(dest):
-            os.unlink(dest)
-        os.symlink(src, dest)
-        return
-
-
-    for ml in multilibs.split():
-        tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
-        if not tune:
-            bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
-            continue
-
-        tune_parameters = get_tune_parameters(tune, d)
-        tune_baselib = tune_parameters['baselib']
-        if not tune_baselib:
-            bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
-            continue
-
-        tune_arch = tune_parameters['arch']
-        tune_bitness = tune_baselib.replace('lib', '')
-        if not tune_bitness:
-            tune_bitness = '32' # /lib => 32bit lib
-
-        src = '../../../' + tune_baselib + '/' + \
-            tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
-            '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
-
-        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
-            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
-
-        if os.path.lexists(dest):
-            os.unlink(dest)
-        os.symlink(src, dest)
-}
+require libgcc.inc
-- 
1.8.1.2



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

* [PATCH 20/28] gcc-target: Combine gcc-target-configure.inc, gcc-target-package.inc and other common code
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (17 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 19/28] libgcc: Move common code to libgcc.inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 21/28] gcc-*-cross.inc: Fold common configuration into gcc-cross.inc Richard Purdie
                   ` (8 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-configure-target.inc |   8 --
 meta/recipes-devtools/gcc/gcc-package-target.inc   | 142 -------------------
 meta/recipes-devtools/gcc/gcc-target.inc           | 153 +++++++++++++++++++++
 meta/recipes-devtools/gcc/gcc_4.7.bb               |   5 +-
 meta/recipes-devtools/gcc/gcc_4.8.bb               |   5 +-
 5 files changed, 155 insertions(+), 158 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-target.inc
 delete mode 100644 meta/recipes-devtools/gcc/gcc-package-target.inc
 create mode 100644 meta/recipes-devtools/gcc/gcc-target.inc

diff --git a/meta/recipes-devtools/gcc/gcc-configure-target.inc b/meta/recipes-devtools/gcc/gcc-configure-target.inc
deleted file mode 100644
index 5f608d6..0000000
--- a/meta/recipes-devtools/gcc/gcc-configure-target.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-GCCMULTILIB = "--enable-multilib"
-require gcc-configure-common.inc
-
-EXTRA_OECONF_PATHS = " \
-    --with-sysroot=/ \
-    --with-build-sysroot=${STAGING_DIR_TARGET} \
-    --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
-    --with-gxx-include-dir=${includedir}/c++/ --enable-dependency-tracking"
diff --git a/meta/recipes-devtools/gcc/gcc-package-target.inc b/meta/recipes-devtools/gcc/gcc-package-target.inc
deleted file mode 100644
index 95a92c1..0000000
--- a/meta/recipes-devtools/gcc/gcc-package-target.inc
+++ /dev/null
@@ -1,142 +0,0 @@
-PACKAGES = "\
-  ${PN} ${PN}-plugins ${PN}-symlinks \
-  g++ g++-symlinks \
-  cpp cpp-symlinks \
-  g77 g77-symlinks \
-  gfortran gfortran-symlinks \
-  gcov gcov-symlinks \
-  ${PN}-plugin-dev \
-  ${PN}-doc \
-  ${PN}-dev \
-  ${PN}-dbg \
-"
-
-FILES_${PN} = "\
-  ${bindir}/${TARGET_PREFIX}gcc* \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
-"
-INSANE_SKIP_${PN} += "dev-so"
-
-FILES_${PN}-dbg += "\
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
-"
-FILES_${PN}-dev = "\
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
-"
-FILES_${PN}-plugin-dev = "\
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
-"
-FILES_${PN}-symlinks = "\
-  ${bindir}/cc \
-  ${bindir}/gcc \
-  ${bindir}/gccbug \
-"
-
-FILES_${PN}-plugins = "\
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
-"
-ALLOW_EMPTY_${PN}-plugins = "1"
-
-FILES_g77 = "\
-  ${bindir}/${TARGET_PREFIX}g77 \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
-"
-FILES_g77-symlinks = "\
-  ${bindir}/g77 \
-  ${bindir}/f77 \
-"
-FILES_gfortran = "\
-  ${bindir}/${TARGET_PREFIX}gfortran \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
-"
-FILES_gfortran-symlinks = "\
-  ${bindir}/gfortran \
-  ${bindir}/f95"
-
-FILES_cpp = "\
-  ${bindir}/${TARGET_PREFIX}cpp \
-  ${base_libdir}/cpp \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
-FILES_cpp-symlinks = "${bindir}/cpp"
-
-FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
-FILES_gcov-symlinks = "${bindir}/gcov"
-
-FILES_g++ = "\
-  ${bindir}/${TARGET_PREFIX}g++ \
-  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
-"
-FILES_g++-symlinks = "\
-  ${bindir}/c++ \
-  ${bindir}/g++ \
-"
-
-
-FILES_${PN}-doc = "\
-  ${infodir} \
-  ${mandir} \
-  ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
-"
-
-do_install () {
-	oe_runmake 'DESTDIR=${D}' install-host
-
-	# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
-	rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
-	rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
-	rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
-	rmdir ${D}${includedir}
-
-	# Hack around specs file assumptions
-	test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
-
-	# Cleanup manpages..
-	rm -rf ${D}${mandir}/man7
-
-	cd ${D}${bindir}
-
-	# We care about g++ not c++
-	rm -f *c++
-
-	# We don't care about the gcc-<version> ones for this
-	rm -f *gcc-?.?*
-
-	# We use libiberty from binutils
-	find ${D}${libdir} -name libiberty.a | xargs rm -f
-	find ${D}${libdir} -name libiberty.h | xargs rm -f
-
-	# Not sure why we end up with these but we don't want them...
-	rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
-
-	# Symlinks so we can use these trivially on the target
-	if [ -e ${TARGET_PREFIX}g77 ]; then
-		ln -sf ${TARGET_PREFIX}g77 g77 || true
-		ln -sf g77 f77 || true
-	fi
-	if [ -e ${TARGET_PREFIX}gfortran ]; then
-		ln -sf ${TARGET_PREFIX}gfortran gfortran || true
-		ln -sf gfortran f95 || true
-	fi
-	ln -sf ${TARGET_PREFIX}g++ g++
-	ln -sf ${TARGET_PREFIX}gcc gcc
-	ln -sf ${TARGET_PREFIX}cpp cpp
-	install -d ${D}${base_libdir}
-	ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
-	ln -sf g++ c++
-	ln -sf gcc cc
-
-	chown -R root:root ${D}
-}
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
new file mode 100644
index 0000000..150fbba
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,153 @@
+GCCMULTILIB = "--enable-multilib"
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = " \
+    --with-sysroot=/ \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+    --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
+    --with-gxx-include-dir=${includedir}/c++/ --enable-dependency-tracking"
+
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ "
+
+PACKAGES = "\
+  ${PN} ${PN}-plugins ${PN}-symlinks \
+  g++ g++-symlinks \
+  cpp cpp-symlinks \
+  g77 g77-symlinks \
+  gfortran gfortran-symlinks \
+  gcov gcov-symlinks \
+  ${PN}-plugin-dev \
+  ${PN}-doc \
+  ${PN}-dev \
+  ${PN}-dbg \
+"
+
+FILES_${PN} = "\
+  ${bindir}/${TARGET_PREFIX}gcc* \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+"
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-dbg += "\
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
+"
+FILES_${PN}-dev = "\
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+"
+FILES_${PN}-plugin-dev = "\
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
+"
+FILES_${PN}-symlinks = "\
+  ${bindir}/cc \
+  ${bindir}/gcc \
+  ${bindir}/gccbug \
+"
+
+FILES_${PN}-plugins = "\
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
+"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+FILES_g77 = "\
+  ${bindir}/${TARGET_PREFIX}g77 \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
+"
+FILES_g77-symlinks = "\
+  ${bindir}/g77 \
+  ${bindir}/f77 \
+"
+FILES_gfortran = "\
+  ${bindir}/${TARGET_PREFIX}gfortran \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
+"
+FILES_gfortran-symlinks = "\
+  ${bindir}/gfortran \
+  ${bindir}/f95"
+
+FILES_cpp = "\
+  ${bindir}/${TARGET_PREFIX}cpp \
+  ${base_libdir}/cpp \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
+FILES_cpp-symlinks = "${bindir}/cpp"
+
+FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
+FILES_gcov-symlinks = "${bindir}/gcov"
+
+FILES_g++ = "\
+  ${bindir}/${TARGET_PREFIX}g++ \
+  ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
+"
+FILES_g++-symlinks = "\
+  ${bindir}/c++ \
+  ${bindir}/g++ \
+"
+
+
+FILES_${PN}-doc = "\
+  ${infodir} \
+  ${mandir} \
+  ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install-host
+
+	# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+	rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
+	rmdir ${D}${includedir}
+
+	# Hack around specs file assumptions
+	test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
+
+	# Cleanup manpages..
+	rm -rf ${D}${mandir}/man7
+
+	cd ${D}${bindir}
+
+	# We care about g++ not c++
+	rm -f *c++
+
+	# We don't care about the gcc-<version> ones for this
+	rm -f *gcc-?.?*
+
+	# We use libiberty from binutils
+	find ${D}${libdir} -name libiberty.a | xargs rm -f
+	find ${D}${libdir} -name libiberty.h | xargs rm -f
+
+	# Not sure why we end up with these but we don't want them...
+	rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
+
+	# Symlinks so we can use these trivially on the target
+	if [ -e ${TARGET_PREFIX}g77 ]; then
+		ln -sf ${TARGET_PREFIX}g77 g77 || true
+		ln -sf g77 f77 || true
+	fi
+	if [ -e ${TARGET_PREFIX}gfortran ]; then
+		ln -sf ${TARGET_PREFIX}gfortran gfortran || true
+		ln -sf gfortran f95 || true
+	fi
+	ln -sf ${TARGET_PREFIX}g++ g++
+	ln -sf ${TARGET_PREFIX}gcc gcc
+	ln -sf ${TARGET_PREFIX}cpp cpp
+	install -d ${D}${base_libdir}
+	ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
+	ln -sf g++ c++
+	ln -sf gcc cc
+
+	chown -R root:root ${D}
+}
diff --git a/meta/recipes-devtools/gcc/gcc_4.7.bb b/meta/recipes-devtools/gcc/gcc_4.7.bb
index f68c67a..0ae22e8 100644
--- a/meta/recipes-devtools/gcc/gcc_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.7.bb
@@ -1,5 +1,2 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-configure-target.inc
-require gcc-package-target.inc
-
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ "
+require gcc-target.inc
diff --git a/meta/recipes-devtools/gcc/gcc_4.8.bb b/meta/recipes-devtools/gcc/gcc_4.8.bb
index f68c67a..0ae22e8 100644
--- a/meta/recipes-devtools/gcc/gcc_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.8.bb
@@ -1,5 +1,2 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-configure-target.inc
-require gcc-package-target.inc
-
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ "
+require gcc-target.inc
-- 
1.8.1.2



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

* [PATCH 21/28] gcc-*-cross.inc: Fold common configuration into gcc-cross.inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (18 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 20/28] gcc-target: Combine gcc-target-configure.inc, gcc-target-package.inc and other common code Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 22/28] gcc-*-runtime.inc: Fold configuration into gcc-runtime.inc Richard Purdie
                   ` (7 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-configure-cross.inc | 31 ---------
 meta/recipes-devtools/gcc/gcc-cross.inc           | 84 ++++++++++++++++++++++-
 meta/recipes-devtools/gcc/gcc-package-cross.inc   | 48 -------------
 3 files changed, 81 insertions(+), 82 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-cross.inc
 delete mode 100644 meta/recipes-devtools/gcc/gcc-package-cross.inc

diff --git a/meta/recipes-devtools/gcc/gcc-configure-cross.inc b/meta/recipes-devtools/gcc/gcc-configure-cross.inc
deleted file mode 100644
index db7980b..0000000
--- a/meta/recipes-devtools/gcc/gcc-configure-cross.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-require gcc-configure-common.inc
-
-EXTRA_OECONF += " --enable-poison-system-directories \
-		"
-
-INHIBIT_DEFAULT_DEPS = "1"
-
-EXTRA_OECONF_PATHS = " \
-		      --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \
-		      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
-                      --with-sysroot=${STAGING_DIR_TARGET} \
-                      --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-do_configure_prepend () {
-	sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
-}
-do_compile_prepend () {
-	export CC="${BUILD_CC}"
-	export AR_FOR_TARGET="${TARGET_SYS}-ar"
-	export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
-	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"
-LIBGCCS_VAR_avr32 = ""
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index c3542e2..bf22101 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -3,8 +3,38 @@ inherit cross
 DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 
-require gcc-configure-cross.inc
-require gcc-package-cross.inc
+require gcc-configure-common.inc
+
+EXTRA_OECONF += " --enable-poison-system-directories \
+		"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+EXTRA_OECONF_PATHS = " \
+		      --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \
+		      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
+                      --with-sysroot=${STAGING_DIR_TARGET} \
+                      --with-build-sysroot=${STAGING_DIR_TARGET}"
+
+do_configure_prepend () {
+	sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
+}
+
+do_compile_prepend () {
+	export CC="${BUILD_CC}"
+	export AR_FOR_TARGET="${TARGET_SYS}-ar"
+	export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
+	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"
+LIBGCCS_VAR_avr32 = ""
 
 EXTRADEPENDS = ""
 python () {
@@ -118,5 +148,53 @@ EXTRA_OECONF_PATHS = " \
                       --with-sysroot=${STAGING_DIR_TARGET} \
                       --with-build-sysroot=${STAGING_DIR_TARGET}"
 
-
 ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${MULTIMACH_TARGET_SYS}"))}"
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install-host
+
+	install -d ${D}${target_base_libdir}
+	install -d ${D}${target_libdir}
+    
+	# Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
+	# gfortran is fully backwards compatible. This is a safe and practical solution. 
+	ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
+
+	
+	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+	# found. These need to be relative paths so they work in different locations.
+	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+	install -d $dest
+	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+	done
+
+	# Remove things we don't need but keep share/java
+	for d in info man share/doc share/locale share/man share/info; do
+		rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
+	done
+
+	# 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|*gcc-crosssdk)
+			dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS}
+			cp -fpPR . $dest
+		;;
+	esac
+}
+
+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"
diff --git a/meta/recipes-devtools/gcc/gcc-package-cross.inc b/meta/recipes-devtools/gcc/gcc-package-cross.inc
deleted file mode 100644
index 3d81677..0000000
--- a/meta/recipes-devtools/gcc/gcc-package-cross.inc
+++ /dev/null
@@ -1,48 +0,0 @@
-INHIBIT_PACKAGE_STRIP = "1"
-
-# Compute how to get from libexecdir to bindir in python (easier than shell)
-BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${MULTIMACH_TARGET_SYS}"))}"
-
-do_install () {
-	oe_runmake 'DESTDIR=${D}' install-host
-
-	install -d ${D}${target_base_libdir}
-	install -d ${D}${target_libdir}
-    
-	# Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
-	# gfortran is fully backwards compatible. This is a safe and practical solution. 
-	ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
-
-	
-	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
-	# found. These need to be relative paths so they work in different locations.
-	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
-	install -d $dest
-	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
-	done
-
-	# Remove things we don't need but keep share/java
-	for d in info man share/doc share/locale share/man share/info; do
-		rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
-	done
-
-	# 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|*gcc-crosssdk)
-			dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS}
-			cp -fpPR . $dest
-		;;
-	esac
-}
-
-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"
-- 
1.8.1.2



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

* [PATCH 22/28] gcc-*-runtime.inc: Fold configuration into gcc-runtime.inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (19 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 21/28] gcc-*-cross.inc: Fold common configuration into gcc-cross.inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 23/28] gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc Richard Purdie
                   ` (6 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../recipes-devtools/gcc/gcc-configure-runtime.inc |  64 ---------
 meta/recipes-devtools/gcc/gcc-package-runtime.inc  |  80 ------------
 meta/recipes-devtools/gcc/gcc-runtime.inc          | 145 +++++++++++++++++++++
 meta/recipes-devtools/gcc/gcc-runtime_4.7.bb       |   3 +-
 meta/recipes-devtools/gcc/gcc-runtime_4.8.bb       |   3 +-
 5 files changed, 147 insertions(+), 148 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-runtime.inc
 delete mode 100644 meta/recipes-devtools/gcc/gcc-package-runtime.inc
 create mode 100644 meta/recipes-devtools/gcc/gcc-runtime.inc

diff --git a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
deleted file mode 100644
index 2ff8561..0000000
--- a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
+++ /dev/null
@@ -1,64 +0,0 @@
-require gcc-configure-common.inc
-
-CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
-
-EXTRA_OECONF_PATHS = " \
-    --with-gxx-include-dir=${includedir}/c++/ \
-    --with-sysroot=${STAGING_DIR_TARGET} \
-    --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
-
-EXTRA_OECONF += "--disable-libunwind-exceptions"
-EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
-
-RUNTIMETARGET = "libssp libstdc++-v3 libgomp"
-#  ?
-# libiberty
-# libmudflap
-# libgfortran
-
-do_configure () {
-	export CXX="${CXX} -nostdinc++ -nostdlib++"
-	mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
-	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B}
-	for d in libgcc ${RUNTIMETARGET}; do
-		echo "Configuring $d"
-		rm -rf ${B}/$target/$d/
-		mkdir -p ${B}/$target/$d/
-		cd ${B}/$target/$d/
-		chmod a+x ${S}/$d/configure
-		${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
-	done
-}
-
-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/
-	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
-	done
-	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
-	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
-	if [ -d ${D}${infodir} ]; then
-		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
-	fi
-	chown -R root:root ${D}
-}
-
-INHIBIT_DEFAULT_DEPS = "1"
-DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
-PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
-
-BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/gcc/gcc-package-runtime.inc b/meta/recipes-devtools/gcc/gcc-package-runtime.inc
deleted file mode 100644
index 2e2f75a..0000000
--- a/meta/recipes-devtools/gcc/gcc-package-runtime.inc
+++ /dev/null
@@ -1,80 +0,0 @@
-PACKAGES = "\
-  ${PN}-dbg \
-  libstdc++ \
-  libstdc++-precompile-dev \
-  libstdc++-dev \
-  libstdc++-staticdev \
-  libg2c \
-  libg2c-dev \
-  libssp \
-  libssp-dev \
-  libssp-staticdev \
-  libgfortran \
-  libgfortran-dev \
-  libmudflap \
-  libmudflap-dev \
-  libgomp \
-  libgomp-dev \
-  libgomp-staticdev \
-"
-# The base package doesn't exist, so we clear the recommends.
-RRECOMMENDS_${PN}-dbg = ""
-
-# include python debugging scripts
-FILES_${PN}-dbg += "\
-  ${libdir}/libstdc++.so.*-gdb.py \
-  ${datadir}/gcc-${BINV}/python/libstdcxx"
-
-FILES_libg2c = "${target_libdir}/libg2c.so.*"
-FILES_libg2c-dev = "\
-  ${libdir}/libg2c.so \
-  ${libdir}/libg2c.a \
-  ${libdir}/libfrtbegin.a"
-
-FILES_libstdc++ = "${libdir}/libstdc++.so.*"
-FILES_libstdc++-dev = "\
-  ${includedir}/c++/ \
-  ${libdir}/libstdc++.so \
-  ${libdir}/libstdc++.la \
-  ${libdir}/libsupc++.la"
-FILES_libstdc++-staticdev = "\
-  ${libdir}/libstdc++.a \
-  ${libdir}/libsupc++.a"
-
-FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
-
-FILES_libssp = "${libdir}/libssp.so.*"
-FILES_libssp-dev = " \
-  ${libdir}/libssp*.so \
-  ${libdir}/libssp*_nonshared.a \
-  ${libdir}/libssp*.la \
-  ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp"
-FILES_libssp-staticdev = " \
-  ${libdir}/libssp*.a"
-
-FILES_libgfortran = "${libdir}/libgfortran.so.*"
-FILES_libgfortran-dev = " \
-  ${libdir}/libgfortran.a \
-  ${libdir}/libgfortran.so \
-  ${libdir}/libgfortranbegin.a"
-
-FILES_libmudflap = "${libdir}/libmudflap*.so.*"
-FILES_libmudflap-dev = "\
-  ${libdir}/libmudflap*.so \
-  ${libdir}/libmudflap*.a \
-  ${libdir}/libmudflap*.la"
-
-FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
-FILES_libgomp-dev = "\
-  ${libdir}/libgomp*${SOLIBSDEV} \
-  ${libdir}/libgomp*.la \
-  ${libdir}/libgomp.spec \
-  ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
-  "
-FILES_libgomp-staticdev = "\
-  ${libdir}/libgomp*.a \
-  "
-
-do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
-do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
-do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
new file mode 100644
index 0000000..b882889
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -0,0 +1,145 @@
+require gcc-configure-common.inc
+
+CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
+
+EXTRA_OECONF_PATHS = " \
+    --with-gxx-include-dir=${includedir}/c++/ \
+    --with-sysroot=${STAGING_DIR_TARGET} \
+    --with-build-sysroot=${STAGING_DIR_TARGET}"
+
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}"
+
+EXTRA_OECONF += "--disable-libunwind-exceptions"
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+RUNTIMETARGET = "libssp libstdc++-v3 libgomp"
+#  ?
+# libiberty
+# libmudflap
+# libgfortran
+
+do_configure () {
+	export CXX="${CXX} -nostdinc++ -nostdlib++"
+	mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B}
+	for d in libgcc ${RUNTIMETARGET}; do
+		echo "Configuring $d"
+		rm -rf ${B}/$target/$d/
+		mkdir -p ${B}/$target/$d/
+		cd ${B}/$target/$d/
+		chmod a+x ${S}/$d/configure
+		${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+	done
+}
+
+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/
+	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
+	done
+	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
+	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
+	if [ -d ${D}${infodir} ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+	fi
+	chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
+PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+  ${PN}-dbg \
+  libstdc++ \
+  libstdc++-precompile-dev \
+  libstdc++-dev \
+  libstdc++-staticdev \
+  libg2c \
+  libg2c-dev \
+  libssp \
+  libssp-dev \
+  libssp-staticdev \
+  libgfortran \
+  libgfortran-dev \
+  libmudflap \
+  libmudflap-dev \
+  libgomp \
+  libgomp-dev \
+  libgomp-staticdev \
+"
+# The base package doesn't exist, so we clear the recommends.
+RRECOMMENDS_${PN}-dbg = ""
+
+# include python debugging scripts
+FILES_${PN}-dbg += "\
+  ${libdir}/libstdc++.so.*-gdb.py \
+  ${datadir}/gcc-${BINV}/python/libstdcxx"
+
+FILES_libg2c = "${target_libdir}/libg2c.so.*"
+FILES_libg2c-dev = "\
+  ${libdir}/libg2c.so \
+  ${libdir}/libg2c.a \
+  ${libdir}/libfrtbegin.a"
+
+FILES_libstdc++ = "${libdir}/libstdc++.so.*"
+FILES_libstdc++-dev = "\
+  ${includedir}/c++/ \
+  ${libdir}/libstdc++.so \
+  ${libdir}/libstdc++.la \
+  ${libdir}/libsupc++.la"
+FILES_libstdc++-staticdev = "\
+  ${libdir}/libstdc++.a \
+  ${libdir}/libsupc++.a"
+
+FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
+
+FILES_libssp = "${libdir}/libssp.so.*"
+FILES_libssp-dev = " \
+  ${libdir}/libssp*.so \
+  ${libdir}/libssp*_nonshared.a \
+  ${libdir}/libssp*.la \
+  ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp"
+FILES_libssp-staticdev = " \
+  ${libdir}/libssp*.a"
+
+FILES_libgfortran = "${libdir}/libgfortran.so.*"
+FILES_libgfortran-dev = " \
+  ${libdir}/libgfortran.a \
+  ${libdir}/libgfortran.so \
+  ${libdir}/libgfortranbegin.a"
+
+FILES_libmudflap = "${libdir}/libmudflap*.so.*"
+FILES_libmudflap-dev = "\
+  ${libdir}/libmudflap*.so \
+  ${libdir}/libmudflap*.a \
+  ${libdir}/libmudflap*.la"
+
+FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
+FILES_libgomp-dev = "\
+  ${libdir}/libgomp*${SOLIBSDEV} \
+  ${libdir}/libgomp*.la \
+  ${libdir}/libgomp.spec \
+  ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+  "
+FILES_libgomp-staticdev = "\
+  ${libdir}/libgomp*.a \
+  "
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb
index c16d27e..497d691 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.7.bb
@@ -1,4 +1,3 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-configure-runtime.inc
-require gcc-package-runtime.inc
+require gcc-runtime.inc
 
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
index c16d27e..497d691 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
@@ -1,4 +1,3 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
-require gcc-configure-runtime.inc
-require gcc-package-runtime.inc
+require gcc-runtime.inc
 
-- 
1.8.1.2



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

* [PATCH 23/28] gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (20 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 22/28] gcc-*-runtime.inc: Fold configuration into gcc-runtime.inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 24/28] gcc-cross.inc: Clean up after merge Richard Purdie
                   ` (5 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

This also has the advantage of removing the confusing sdk naming which
has been purged everywhere else in favour of cross-canadian.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-configure-sdk.inc  |  47 ---------
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 127 ++++++++++++++++++++++-
 meta/recipes-devtools/gcc/gcc-package-sdk.inc    |  78 --------------
 3 files changed, 125 insertions(+), 127 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-sdk.inc
 delete mode 100644 meta/recipes-devtools/gcc/gcc-package-sdk.inc

diff --git a/meta/recipes-devtools/gcc/gcc-configure-sdk.inc b/meta/recipes-devtools/gcc/gcc-configure-sdk.inc
deleted file mode 100644
index 6c55bc7..0000000
--- a/meta/recipes-devtools/gcc/gcc-configure-sdk.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-require gcc-configure-common.inc
-
-EXTRA_OECONF_PATHS = "--with-gxx-include-dir=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${target_includedir}/c++ \
-                      --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
-                      --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
-                      --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-#
-# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky
-# for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse.
-#
-export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
-export AS_FOR_TARGET = "${TARGET_PREFIX}as"
-export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool"
-export CC_FOR_TARGET = "${TARGET_PREFIX}gcc"
-export CXX_FOR_TARGET = "${TARGET_PREFIX}g++"
-export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
-export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo"
-export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
-export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump"
-export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
-export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip"
-export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres"
-
-#
-# We need to override this and make sure the compiler can find staging
-#
-export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}"
-
-do_configure () {
-	export CC_FOR_BUILD="${BUILD_CC}"
-	export CXX_FOR_BUILD="${BUILD_CXX}"
-	export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
-	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
-}
-
-do_compile () {
-	oe_runmake all-host
-}
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 85c3166..5908e72 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -8,8 +8,131 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}binutils-crosssdk v
 
 GCCMULTILIB = "--enable-multilib"
 
-require gcc-configure-sdk.inc
-require gcc-package-sdk.inc
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "--with-gxx-include-dir=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${target_includedir}/c++ \
+                      --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
+                      --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
+                      --with-build-sysroot=${STAGING_DIR_TARGET}"
+
+#
+# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky
+# for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse.
+#
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool"
+export CC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export CXX_FOR_TARGET = "${TARGET_PREFIX}g++"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip"
+export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres"
+
+#
+# We need to override this and make sure the compiler can find staging
+#
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}"
+
+do_configure () {
+	export CC_FOR_BUILD="${BUILD_CC}"
+	export CXX_FOR_BUILD="${BUILD_CXX}"
+	export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+	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
+}
+
+do_compile () {
+	oe_runmake all-host
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+# Having anything auto depending on gcc-cross-sdk is a really bad idea...
+EXCLUDE_FROM_SHLIBS = "1"
+
+PACKAGES = "${PN} ${PN}-doc"
+
+FILES_${PN} = "\
+    ${bindir}/* \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \
+    ${includedir}/c++/${BINV} \
+    ${prefix}/${TARGET_SYS}/bin/* \
+    ${prefix}/${TARGET_SYS}/lib/* \
+    ${prefix}/${TARGET_SYS}/usr/include/* \
+    "
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-doc = "\
+    ${infodir} \
+    ${mandir} \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+    "
+
+EXEEXT = ""
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}"
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install-host
+
+	# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+	rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+
+	# We care about g++ not c++
+	rm -f ${D}${bindir}/*c++
+
+	# We don't care about the gcc-<version> copies
+	rm -f ${D}${bindir}/*gcc-?.?*
+
+	# We use libiberty from binutils
+	rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
+	# Not sure where the strange paths come from
+	rm -f ${D}${libdir}/../lib/libiberty.a
+	rm -f ${D}${libdir}/libiberty.a
+
+	# Cleanup empty directories which are not shipped
+	# we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
+	# ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
+	local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}"
+	for i in $empty_dirs; do
+		[ -d $i ] && rmdir --ignore-fail-on-non-empty $i
+	done
+
+	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+	# found.
+	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+	install -d $dest
+	suffix=${EXEEXT}
+	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
+			continue
+		fi
+
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
+	done
+
+	chown -R root:root ${D}
+}
 
 ELFUTILS = "nativesdk-elfutils"
 DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
diff --git a/meta/recipes-devtools/gcc/gcc-package-sdk.inc b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
deleted file mode 100644
index 21beccc..0000000
--- a/meta/recipes-devtools/gcc/gcc-package-sdk.inc
+++ /dev/null
@@ -1,78 +0,0 @@
-INHIBIT_PACKAGE_STRIP = "1"
-
-# Having anything auto depending on gcc-cross-sdk is a really bad idea...
-EXCLUDE_FROM_SHLIBS = "1"
-
-PACKAGES = "${PN} ${PN}-doc"
-
-FILES_${PN} = "\
-    ${bindir}/* \
-    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \
-    ${includedir}/c++/${BINV} \
-    ${prefix}/${TARGET_SYS}/bin/* \
-    ${prefix}/${TARGET_SYS}/lib/* \
-    ${prefix}/${TARGET_SYS}/usr/include/* \
-    "
-INSANE_SKIP_${PN} += "dev-so"
-
-FILES_${PN}-doc = "\
-    ${infodir} \
-    ${mandir} \
-    ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
-    "
-
-EXEEXT = ""
-
-# Compute how to get from libexecdir to bindir in python (easier than shell)
-BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}"
-
-do_install () {
-	oe_runmake 'DESTDIR=${D}' install-host
-
-	# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
-	rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
-	rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
-
-	# We care about g++ not c++
-	rm -f ${D}${bindir}/*c++
-
-	# We don't care about the gcc-<version> copies
-	rm -f ${D}${bindir}/*gcc-?.?*
-
-	# We use libiberty from binutils
-	rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
-	# Not sure where the strange paths come from
-	rm -f ${D}${libdir}/../lib/libiberty.a
-	rm -f ${D}${libdir}/libiberty.a
-
-	# Cleanup empty directories which are not shipped
-	# we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
-	# ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
-	local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}"
-	for i in $empty_dirs; do
-		[ -d $i ] && rmdir --ignore-fail-on-non-empty $i
-	done
-
-	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
-	# found.
-	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
-	install -d $dest
-	suffix=${EXEEXT}
-	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
-			continue
-		fi
-
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
-	done
-
-	chown -R root:root ${D}
-}
-
-- 
1.8.1.2



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

* [PATCH 24/28] gcc-cross.inc: Clean up after merge
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (21 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 23/28] gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 25/28] gcc-common.inc: Drop unused LIBGCCS_VAR variable Richard Purdie
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

* Remove the duplicate EXTRA_OECONF_PATHS that is overwritten
* Merge the do_compile and do_compile_prepend
* Group dependency and configuration variables together

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross.inc | 48 +++++++++++++--------------------
 1 file changed, 18 insertions(+), 30 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index bf22101..a09fd54 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -1,26 +1,38 @@
 inherit cross
 
+INHIBIT_DEFAULT_DEPS = "1"
+EXTRADEPENDS = ""
 DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+python () {
+    if d.getVar("TARGET_OS", True).startswith("linux"):
+        d.setVar("EXTRADEPENDS", "linux-libc-headers")
+}
 
 require gcc-configure-common.inc
 
-EXTRA_OECONF += " --enable-poison-system-directories \
-		"
+EXTRA_OECONF += " --enable-poison-system-directories"
+EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
 
-INHIBIT_DEFAULT_DEPS = "1"
+EXTRA_OECONF += "--disable-libunwind-exceptions \
+                 --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
+                 --with-system-zlib "
 
 EXTRA_OECONF_PATHS = " \
-		      --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \
-		      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
+                      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
                       --with-sysroot=${STAGING_DIR_TARGET} \
                       --with-build-sysroot=${STAGING_DIR_TARGET}"
 
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
+
+LIBGCCS_VAR = "-lgcc_s"
+LIBGCCS_VAR_avr32 = ""
+
 do_configure_prepend () {
 	sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
 }
 
-do_compile_prepend () {
+do_compile () {
 	export CC="${BUILD_CC}"
 	export AR_FOR_TARGET="${TARGET_SYS}-ar"
 	export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
@@ -31,18 +43,7 @@ do_compile_prepend () {
 	export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
 	export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
 	export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
-}
-
-LIBGCCS_VAR = "-lgcc_s"
-LIBGCCS_VAR_avr32 = ""
 
-EXTRADEPENDS = ""
-python () {
-    if d.getVar("TARGET_OS", True).startswith("linux"):
-        d.setVar("EXTRADEPENDS", "linux-libc-headers")
-}
-
-do_compile () {
 	oe_runmake all-host all-target-libgcc
 	# now generate script to drive testing
 	echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
@@ -137,19 +138,6 @@ STOP
 
 }
 
-EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
-
-EXTRA_OECONF += "--disable-libunwind-exceptions \
-                 --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
-                 --with-system-zlib "
-
-EXTRA_OECONF_PATHS = " \
-                      --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
-                      --with-sysroot=${STAGING_DIR_TARGET} \
-                      --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
-
 INHIBIT_PACKAGE_STRIP = "1"
 
 # Compute how to get from libexecdir to bindir in python (easier than shell)
-- 
1.8.1.2



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

* [PATCH 25/28] gcc-common.inc: Drop unused LIBGCCS_VAR variable
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (22 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 24/28] gcc-cross.inc: Clean up after merge Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 26/28] bitbake.conf: Work around dev symlink problems on darwin Richard Purdie
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-devtools/gcc/gcc-cross.inc | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index a09fd54..25a3142 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -25,9 +25,6 @@ EXTRA_OECONF_PATHS = " \
 
 ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
 
-LIBGCCS_VAR = "-lgcc_s"
-LIBGCCS_VAR_avr32 = ""
-
 do_configure_prepend () {
 	sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
 }
-- 
1.8.1.2



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

* [PATCH 26/28] bitbake.conf: Work around dev symlink problems on darwin
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (23 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 25/28] gcc-common.inc: Drop unused LIBGCCS_VAR variable Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:29 ` [PATCH 27/28] Drop darwin8/darwin9 usage Richard Purdie
                   ` (2 subsequent siblings)
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

On darwin, we have:

libxxx.dylib -> libxxx.Y.dylib

compared to Linux which has:

libxxx.so -> libxxx.so.Y

Our ordering of PACKAGES with -dev first and then ${PN} makes it impossible to
match the files correctly using simple globbing. This makes darwin targets
completely broken since both the libs and the dev symlinks end up in ${PN}-dev.

Whilst this commit is a hack, it at least puts the files into ${PN} and allows the
builds to be used. Symlinks don't take up much space so this isn't the end of
the world. I'm open to better solutions to this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/conf/bitbake.conf | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 4535f68..45a5221 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -259,14 +259,17 @@ RPROVIDES = ""
 MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativesdk-libintl virtual/xserver virtual/update-alternatives-native virtual/update-alternatives"
 
 SOLIBS = ".so.*"
-SOLIBS_darwin = ".*.dylib"
-SOLIBS_darwin8 = ".*.dylib"
-SOLIBS_darwin9 = ".*.dylib"
+SOLIBS_darwin = ".dylib"
+SOLIBS_darwin8 = ".dylib"
+SOLIBS_darwin9 = ".dylib"
 
 SOLIBSDEV = ".so"
-SOLIBSDEV_darwin = ".dylib"
-SOLIBSDEV_darwin8 = ".dylib"
-SOLIBSDEV_darwin9 = ".dylib"
+# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,
+# we can't make the symlinks end up in the -dev packages easily at this point. This hack
+# at least means builds aren't completely broken and symlinks don't take up much space.
+SOLIBSDEV_darwin = ".dylibbroken"
+SOLIBSDEV_darwin8 = ".dylibbroken"
+SOLIBSDEV_darwin9 = ".dylibbroken"
 
 PACKAGE_BEFORE_PN ?= ""
 PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
-- 
1.8.1.2



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

* [PATCH 27/28] Drop darwin8/darwin9 usage
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (24 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 26/28] bitbake.conf: Work around dev symlink problems on darwin Richard Purdie
@ 2013-08-22 11:29 ` Richard Purdie
  2013-08-22 11:30 ` [PATCH 28/28] chrpath: Add support for relocating darwin binaries Richard Purdie
  2013-08-22 11:46 ` [PATCH 00/28] Toolchain tweaks Richard Purdie
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

There were darwin8/darwin9 overrides spinkled in the code from times gone
by. Lets settle on the darwin override and remove the others since its pointless
duplication. We always inject darwin into OVERRIDES if needed in the darwin8/9
cases.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/conf/bitbake.conf                                             | 4 ----
 meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb | 2 +-
 meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb                | 1 -
 3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 45a5221..05259b2 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -260,16 +260,12 @@ MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativ
 
 SOLIBS = ".so.*"
 SOLIBS_darwin = ".dylib"
-SOLIBS_darwin8 = ".dylib"
-SOLIBS_darwin9 = ".dylib"
 
 SOLIBSDEV = ".so"
 # Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,
 # we can't make the symlinks end up in the -dev packages easily at this point. This hack
 # at least means builds aren't completely broken and symlinks don't take up much space.
 SOLIBSDEV_darwin = ".dylibbroken"
-SOLIBSDEV_darwin8 = ".dylibbroken"
-SOLIBSDEV_darwin9 = ".dylibbroken"
 
 PACKAGE_BEFORE_PN ?= ""
 PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index 63fea28..84fb95d 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -22,7 +22,7 @@ RDEPENDS_${PN} = "\
     nativesdk-automake \
     "
 
-RDEPENDS_${PN}_darwin8 = "\
+RDEPENDS_${PN}_darwin = "\
     odcctools-cross-canadian \
     llvm-cross-canadian \
     nativesdk-pkgconfig \
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb
index d231268..928a0cd 100644
--- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb
@@ -10,7 +10,6 @@ SRC_URI[sha256sum] = "b984aaf1fe888d6a4cf8c2e8d397207879599b5368f1d33232c1ec9d68
 
 EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd"
 EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
-EXTRA_OECONF_darwin8 = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
 
 do_configure_prepend () {
 	cp ${WORKDIR}/acinclude.m4 ${S}/
-- 
1.8.1.2



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

* [PATCH 28/28] chrpath: Add support for relocating darwin binaries
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (25 preceding siblings ...)
  2013-08-22 11:29 ` [PATCH 27/28] Drop darwin8/darwin9 usage Richard Purdie
@ 2013-08-22 11:30 ` Richard Purdie
  2013-08-22 11:46 ` [PATCH 00/28] Toolchain tweaks Richard Purdie
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:30 UTC (permalink / raw)
  To: openembedded-core

On darwin, install_name_tool can be used to relocate binaries/libraries. This
adds support for adjusting them with relative paths rather than hardcoded ones.
The Linux code is factored out into a function but is otherwise unchanged.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/chrpath.bbclass | 138 +++++++++++++++++++++++++++----------------
 1 file changed, 88 insertions(+), 50 deletions(-)

diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
index 0c7ab77..61a24b3 100644
--- a/meta/classes/chrpath.bbclass
+++ b/meta/classes/chrpath.bbclass
@@ -1,18 +1,103 @@
 CHRPATH_BIN ?= "chrpath"
 PREPROCESS_RELOCATE_DIRS ?= ""
 
-def process_dir (directory, d):
+def process_file_linux(cmd, fpath, basedir, tmpdir, d):
     import subprocess as sub
+
+    p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+    err, out = p.communicate()
+    # If returned succesfully, process stderr for results
+    if p.returncode != 0:
+        return
+
+    # Throw away everything other than the rpath list
+    curr_rpath = err.partition("RPATH=")[2]
+    #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
+    rpaths = curr_rpath.split(":")
+    new_rpaths = []
+    for rpath in rpaths:
+        # If rpath is already dynamic copy it to new_rpath and continue
+        if rpath.find("$ORIGIN") != -1:
+            new_rpaths.append(rpath.strip())
+            continue
+        rpath =  os.path.normpath(rpath)
+        # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
+        # base_prefix shared root
+        if rpath.find(basedir) != -1:
+            depth = fpath.partition(basedir)[2].count('/')
+            libpath = rpath.partition(basedir)[2].strip()
+        # otherwise (i.e. cross packages) determine a shared root based on the TMPDIR
+        # NOTE: This will not work reliably for cross packages, particularly in the case
+        # where your TMPDIR is a short path (i.e. /usr/poky) as chrpath cannot insert an
+        # rpath longer than that which is already set.
+        elif rpath.find(tmpdir) != -1:
+            depth = fpath.rpartition(tmpdir)[2].count('/')
+            libpath = rpath.partition(tmpdir)[2].strip()
+        else:
+            new_rpaths.append(rpath.strip())
+            return
+        base = "$ORIGIN"
+        while depth > 1:
+            base += "/.."
+            depth-=1
+        new_rpaths.append("%s%s" % (base, libpath))
+
+    # if we have modified some rpaths call chrpath to update the binary
+    if len(new_rpaths):
+        args = ":".join(new_rpaths)
+        #bb.note("Setting rpath for %s to %s" %(fpath, args))
+        p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+        out, err = p.communicate()
+        if p.returncode != 0:
+            bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
+            raise bb.build.FuncFailed
+
+def process_file_darwin(cmd, fpath, basedir, tmpdir, d):
+    import subprocess as sub
+
+    p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+    err, out = p.communicate()
+    # If returned succesfully, process stderr for results
+    if p.returncode != 0:
+        return
+    for l in err.split("\n"):
+        if "(compatibility" not in l:
+            continue
+        rpath = l.partition("(compatibility")[0].strip()
+        if rpath.find(basedir) != -1:
+            depth = fpath.partition(basedir)[2].count('/')
+            libpath = rpath.partition(basedir)[2].strip()
+        else:
+            continue
+
+        base = "@loader_path"
+        while depth > 1:
+            base += "/.."
+            depth-=1
+        base = base + libpath
+        p = sub.Popen([d.expand("${HOST_PREFIX}install_name_tool"), '-change', rpath, base, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+        err, out = p.communicate()
+
+def process_dir (directory, d):
     import stat
 
     cmd = d.expand('${CHRPATH_BIN}')
     tmpdir = os.path.normpath(d.getVar('TMPDIR'))
     basedir = os.path.normpath(d.expand('${base_prefix}'))
+    hostos = d.getVar("HOST_OS", True)
 
     #bb.debug("Checking %s for binaries to process" % directory)
     if not os.path.exists(directory):
         return
 
+    if "linux" in hostos:
+        process_file = process_file_linux
+    elif "darwin" in hostos:
+        process_file = process_file_darwin
+    else:
+        # Relocations not supported
+        return
+
     dirs = os.listdir(directory)
     for file in dirs:
         fpath = directory + "/" + file
@@ -35,55 +120,8 @@ def process_dir (directory, d):
             else:
                 # Temporarily make the file writeable so we can chrpath it
                 os.chmod(fpath, perms|stat.S_IRWXU)
-
-            p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
-            err, out = p.communicate()
-            # If returned succesfully, process stderr for results
-            if p.returncode != 0:
-                continue
-
-            # Throw away everything other than the rpath list
-            curr_rpath = err.partition("RPATH=")[2]
-            #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
-            rpaths = curr_rpath.split(":")
-            new_rpaths = []
-            for rpath in rpaths:
-                # If rpath is already dynamic copy it to new_rpath and continue
-                if rpath.find("$ORIGIN") != -1:
-                    new_rpaths.append(rpath.strip())
-                    continue
-                rpath =  os.path.normpath(rpath)
-                # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
-                # base_prefix shared root
-                if rpath.find(basedir) != -1:
-                    depth = fpath.partition(basedir)[2].count('/')
-                    libpath = rpath.partition(basedir)[2].strip()
-                # otherwise (i.e. cross packages) determine a shared root based on the TMPDIR
-                # NOTE: This will not work reliably for cross packages, particularly in the case
-                # where your TMPDIR is a short path (i.e. /usr/poky) as chrpath cannot insert an
-                # rpath longer than that which is already set.
-                elif rpath.find(tmpdir) != -1:
-                    depth = fpath.rpartition(tmpdir)[2].count('/')
-                    libpath = rpath.partition(tmpdir)[2].strip()
-                else:
-                    new_rpaths.append(rpath.strip())
-                    continue
-                base = "$ORIGIN"
-                while depth > 1:
-                    base += "/.."
-                    depth-=1
-                new_rpaths.append("%s%s" % (base, libpath))
-
-            # if we have modified some rpaths call chrpath to update the binary
-            if len(new_rpaths):
-                args = ":".join(new_rpaths)
-                #bb.note("Setting rpath for %s to %s" %(fpath, args))
-                p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
-                out, err = p.communicate()
-                if p.returncode != 0:
-                    bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
-                    raise bb.build.FuncFailed
-
+            process_file(cmd, fpath, basedir, tmpdir, d)
+                
             if perms:
                 os.chmod(fpath, perms)
 
-- 
1.8.1.2



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

* [PATCH 00/28] Toolchain tweaks
  2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
                   ` (26 preceding siblings ...)
  2013-08-22 11:30 ` [PATCH 28/28] chrpath: Add support for relocating darwin binaries Richard Purdie
@ 2013-08-22 11:46 ` Richard Purdie
  27 siblings, 0 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:46 UTC (permalink / raw)
  To: openembedded-core

Playing with meta-mingw, it was clear that there were some simple
changes we could make to the core that would improve things for
non-linux SDKs. This series includes those changes. Since I like pain, I
also attempted a darwin build and have included some tweaks for that
too.

When looking at the gcc recipes, it also became clear that we have way
too many include files and the whole thing was a bit of a maze. The
series has some changes in to combine various files together and
simplify things.

I appreciate this may complicate moving things into meta-oe such as gcc
4.7. I would propose when we do that, we put them into
recipes-gcc-<version> and include a snapshot of the .inc files at that
time. The alternative is the continual copy and paste growth of the .bb
files (libgcc being a more extreme example) which I don't think lends
itself to future maintenance of the recipes.

There are some layers which for example use gcc-cross4.inc, they should
just be able to switch directly to gcc-cross.inc. I think this applies
to meta-arago-extras.

This also leads the way to possibly further unify and clean up some of
the configuration (e.g. the do_configure_prepends) but I will leave that
for another series when someone has some further time to spend on it.

Cheers,

Richard






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

end of thread, other threads:[~2013-08-22 11:46 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
2013-08-22 11:29 ` [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk Richard Purdie
2013-08-22 11:29 ` [PATCH 03/28] populate_sdk_base: Allow sdk tar options to be overridden Richard Purdie
2013-08-22 11:29 ` [PATCH 04/28] gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian Richard Purdie
2013-08-22 11:29 ` [PATCH 05/28] libiconv: Extend to nativesdk and support non-linux targets Richard Purdie
2013-08-22 11:29 ` [PATCH 06/28] gcc-cross-canadian-4.8: Enable PARALLEL_MAKE Richard Purdie
2013-08-22 11:29 ` [PATCH 07/28] gcc-package-sdk.inc: Use relative symlinks in libexec dir Richard Purdie
2013-08-22 11:29 ` [PATCH 08/28] gcc-package-sdk.inc: Allow executable extension to be overridden Richard Purdie
2013-08-22 11:29 ` [PATCH 09/28] gcc-configure-sdk.inc: Don't build target-libgcc Richard Purdie
2013-08-22 11:29 ` [PATCH 10/28] gcc: Drop gcc-cross4.inc, its pointless now Richard Purdie
2013-08-22 11:29 ` [PATCH 11/28] gcc-cross-canadian-4.8: Allow elfutils to be a configurable dependency Richard Purdie
2013-08-22 11:29 ` [PATCH 12/28] gcc-cross-canadian-4.8: Add missing dependency on nativesdk-zlib Richard Purdie
2013-08-22 11:29 ` [PATCH 13/28] gcc-cross-canadian: Merge 4.7 and 4.8 recipes into common include Richard Purdie
2013-08-22 11:29 ` [PATCH 14/28] Revert "nativesdk: inherit relocatable" Richard Purdie
2013-08-22 11:29 ` [PATCH 15/28] bitbake.conf/classes/gcc: Don't hardcode -nativesdk Richard Purdie
2013-08-22 11:29 ` [PATCH 16/28] gcc-cross: Fold common configuration into gcc-cross.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 17/28] gcc-cross-initial: Fold common configuration into gcc-cross-initial.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 18/28] gcc-runtime: Fold common configuration into gcc-configure-runtime.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 19/28] libgcc: Move common code to libgcc.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 20/28] gcc-target: Combine gcc-target-configure.inc, gcc-target-package.inc and other common code Richard Purdie
2013-08-22 11:29 ` [PATCH 21/28] gcc-*-cross.inc: Fold common configuration into gcc-cross.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 22/28] gcc-*-runtime.inc: Fold configuration into gcc-runtime.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 23/28] gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc Richard Purdie
2013-08-22 11:29 ` [PATCH 24/28] gcc-cross.inc: Clean up after merge Richard Purdie
2013-08-22 11:29 ` [PATCH 25/28] gcc-common.inc: Drop unused LIBGCCS_VAR variable Richard Purdie
2013-08-22 11:29 ` [PATCH 26/28] bitbake.conf: Work around dev symlink problems on darwin Richard Purdie
2013-08-22 11:29 ` [PATCH 27/28] Drop darwin8/darwin9 usage Richard Purdie
2013-08-22 11:30 ` [PATCH 28/28] chrpath: Add support for relocating darwin binaries Richard Purdie
2013-08-22 11:46 ` [PATCH 00/28] Toolchain tweaks 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.