Skip to contentSkip to conversation

stash gcc-cross buildtree and add recipe class override

PATCH In review Khem Raj 4 participants 16 messages Feb 24, 2012 – Mar 22, 2012

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover stash gcc-cross buildtree and add recipe class override

Add recipe class to overrides
Prepare gcc for 4.7 changes
missing DEPENDS found during individual recipe builds Add emptry DISTRO to oe-core

The following changes since commit a1f23a7cc527afdd1ce6cc7cd6083ee78fde09b3:

update-rc.d.bbclass: do nothing for extended cross packages (2012-02-24 00:47:44 +0000)

are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib kraj/misc
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/misc

Khem Raj (4):
glib-networking: Add intltools-native to DEPENDS
classes: Add recipe class to overrides
default-distrovars: Add empty weak definition for DISTRO variable
gcc: Stash the gcc-cross builddir to reuse in libgcc and gcc-runtime

 meta/classes/base.bbclass                          |    1 +
 meta/classes/cross-canadian.bbclass                |    2 +-
 meta/classes/cross.bbclass                         |    1 +
 meta/classes/crosssdk.bbclass                      |    1 +
 meta/classes/native.bbclass                        |    3 +-
 meta/classes/nativesdk.bbclass                     |    3 +-
 meta/conf/bitbake.conf                             |    3 +-
 meta/conf/distro/include/default-distrovars.inc    |    7 ++++
 .../glib-networking/glib-networking_2.28.7.bb      |    2 +-
 meta/recipes-devtools/gcc/gcc-4.6.inc              |    2 +-
 meta/recipes-devtools/gcc/gcc-configure-common.inc |    3 --
 .../recipes-devtools/gcc/gcc-configure-runtime.inc |   24 ++++++++++------
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    |    2 +-
 meta/recipes-devtools/gcc/gcc-package-cross.inc    |   14 +--------
 meta/recipes-devtools/gcc/libgcc_4.6.bb            |   30 ++++++++++++++++----
 15 files changed, 58 insertions(+), 40 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/4 glib-networking: Add intltools-native to DEPENDS

---
 .../glib-networking/glib-networking_2.28.7.bb      |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-core/glib-networking/glib-networking_2.28.7.bb +1 -1
index 1ae34c0..c8536e8 100644
@@ -6,7 +6,7 @@ LICENSE = "LGPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
 
 SECTION = "libs"
-DEPENDS = "glib-2.0 gnutls"
+DEPENDS = "glib-2.0 gnutls intltool-native"
 
 PR = "r1"
 
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/4 classes: Add recipe class to overrides

We have currently no override to detect a recipe
being build cross, crosssdk or for target
at times we can use virtclass-native and virtclass-nativesdk to override stuff in recipes but we dont have way to modify a variables based on recipe type always.

With this patch we attempt to have recipe class override always so we can use it in recipes which use BBCLASSEXTEND as well as others which inherit the classes directly.

I am not too fond of names that I have used so any suggestions are welcome I would have liked to drop virtclass- from the existing overrides but that would mean a lot of changes so I left them alone.

With this change now we can say

EXTRA_OECONF_class-target = "...."
EXTRA_OECONF_virtclass-native = "..."
EXTRA_OECONF_virtclass-nativesdk = "..."
EXTRA_OECONF_virtclass-crosssdk= "..."

....

---
 meta/classes/base.bbclass           |    1 +
 meta/classes/cross-canadian.bbclass |    2 +-
 meta/classes/cross.bbclass          |    1 +
 meta/classes/crosssdk.bbclass       |    1 +
 meta/classes/native.bbclass         |    3 +--
 meta/classes/nativesdk.bbclass      |    3 +--
 meta/conf/bitbake.conf              |    3 ++-
 7 files changed, 8 insertions(+), 6 deletions(-)
meta/classes/base.bbclass +1 -0
index e80e874..e977485 100644
@@ -1,4 +1,5 @@
 BB_DEFAULT_TASK ?= "build"
+CLASSOVERRIDE ?= "class-target"
 
 inherit patch
 inherit staging
meta/classes/cross-canadian.bbclass +1 -1
index 499a1fb..d4d18c4 100644
@@ -8,7 +8,7 @@
 # SDK packages are built either explicitly by the user,
 # or indirectly via dependency.  No need to be in 'world'.
 EXCLUDE_FROM_WORLD = "1"
-
+CLASSOVERRIDE = "virtclass-cross-canadian"
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
 
 #
meta/classes/cross.bbclass +1 -0
index 8da3048..63eb91e 100644
@@ -4,6 +4,7 @@ inherit relocatable
 # no need for them to be a direct target of 'world'
 EXCLUDE_FROM_WORLD = "1"
 
+CLASSOVERRIDE = "virtclass-cross"
 PACKAGES = ""
 PACKAGES_DYNAMIC = ""
 PACKAGES_DYNAMIC_virtclass-native = ""
meta/classes/crosssdk.bbclass +1 -0
index 83753b4..5abc950 100644
@@ -1,5 +1,6 @@
 inherit cross
 
+CLASSOVERRIDE = "virtclass-crosssdk"
 PACKAGE_ARCH = "${SDK_ARCH}"
 STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
meta/classes/native.bbclass +1 -2
index 00196ba..9fcb31f 100644
@@ -94,6 +94,7 @@ PKG_CONFIG_SYSROOT_DIR = ""
 
 # we dont want libc-uclibc or libc-glibc to kick in for native recipes
 LIBCOVERRIDE = ""
+CLASSOVERRIDE = "virtclass-native"
 
 PATH =. "${COREBASE}/scripts/native-intercept:"
 
@@ -141,8 +142,6 @@ python native_virtclass_handler () {
         if not prov.endswith("-native"):
             provides = provides.replace(prov, prov + "-native")
     e.data.setVar("PROVIDES", provides)
-
-    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
 }
 
 addhandler native_virtclass_handler
meta/classes/nativesdk.bbclass +1 -2
index ceec53e..084f5d9 100644
@@ -8,6 +8,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S
 
 # we dont want libc-uclibc or libc-glibc to kick in for nativesdk recipes
 LIBCOVERRIDE = ""
+CLASSOVERRIDE = "virtclass-nativesdk"
 
 #
 # Update PACKAGE_ARCH and PACKAGE_ARCHS
@@ -63,8 +64,6 @@ python nativesdk_virtclass_handler () {
     pn = e.data.getVar("PN", True)
     if not pn.endswith("-nativesdk"):
         return
-
-    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
 }
 
 python () {
meta/conf/bitbake.conf +2 -1
index 90e5f7a..1e47b13 100644
@@ -630,7 +630,8 @@ AUTO_LIBNAME_PKGS = "${PACKAGES}"
 #
 # This works for  functions as well, they are really just environment variables.
 # Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
-OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:forcevariable"
+OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable"
+CLASSOVERRIDE ?= "class-target"
 DISTROOVERRIDES ?= "${DISTRO}"
 MACHINEOVERRIDES ?= "${MACHINE}"
 MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
Signature · 1 line
1.7.5.4
#3 lore raw

Re: [PATCH 2/4] classes: Add recipe class to overrides

Quoted 15 lines · Khem Raj

We have currently no override to detect a recipe
being build cross, crosssdk or for target
at times we can use virtclass-native and virtclass-nativesdk to override stuff in recipes but we dont have way to modify a variables based on recipe type always.

With this patch we attempt to have recipe class override always so we can use it in recipes which use BBCLASSEXTEND as well as others which inherit the classes directly.

I am not too fond of names that I have used so any suggestions are welcome I would have liked to drop virtclass- from the existing overrides but that would mean a lot of changes so I left them alone.

Quoted 6 lines

With this change now we can say

EXTRA_OECONF_class-target = "...."
EXTRA_OECONF_virtclass-native = "..."
EXTRA_OECONF_virtclass-nativesdk = "..."
EXTRA_OECONF_virtclass-crosssdk= "..."

I think we need to drop the "virt" here and make this consistent since they are no longer specific to the virtual BBCLASSEXTEND code...

Cheers,

Richard

author
#4 lore raw

Re: [PATCH 2/4] classes: Add recipe class to overrides

Quoted 10 lines · Richard Purdie
Quoted 6 lines

With this change now we can say

EXTRA_OECONF_class-target = "...."
EXTRA_OECONF_virtclass-native = "..."
EXTRA_OECONF_virtclass-nativesdk = "..."
EXTRA_OECONF_virtclass-crosssdk= "..."

I think we need to drop the "virt" here and make this consistent since they are no longer specific to the virtual BBCLASSEXTEND code...

since they were used in quite few places I thought to keep them as it is renaming would mean all places should change and other layers too and I am infamous
to break other layers :) and keeping both would be more confusion.

Quoted 3 lines

Cheers,

Richard

author
#5 lore raw

PATCH 3/4 default-distrovars: Add empty weak definition for DISTRO variable

In reply to Khem Raj
---
 meta/conf/distro/include/default-distrovars.inc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
meta/conf/distro/include/default-distrovars.inc +7 -0
index 16b3108..dba204e 100644
@@ -41,6 +41,13 @@ NO32LIBS ??= "1"
 
 # Default to emitting logfiles if a build fails.
 BBINCLUDELOGS ??= "yes"
+
+# dummy distro related variables
+# they should be overridden by real distros
+# these fallbacks only serve the purpose of
+# oe-core standalone testability
+
+DISTRO ??= ""
 SDK_VERSION ??= "oe-core.0"
 DISTRO_VERSION ??= "oe-core.0"
 
Signature · 1 line
1.7.5.4
#6 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Quoted 12 lines · Khem Raj
---
 meta/conf/distro/include/default-distrovars.inc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
meta/conf/distro/include/default-distrovars.inc +0 -0
index 16b3108..dba204e 100644
@@ -41,6 +41,13 @@ NO32LIBS ??= "1"
 
 # Default to emitting logfiles if a build fails.

meta/conf/distro/include/default-distrovars.inc NO32LIBS ??= "1" · line 52

Quoted 10 lines
meta/conf/distro/include/default-distrovars.inc +7 -0
 BBINCLUDELOGS ??= "yes"
+
+# dummy distro related variables
+# they should be overridden by real distros
+# these fallbacks only serve the purpose of
+# oe-core standalone testability
+
+DISTRO ??= ""
 SDK_VERSION ??= "oe-core.0"
 DISTRO_VERSION ??= "oe-core.0"

Why do we need this? The commit message tells me what you're doing but not why. I'm really getting frustrated with one line commit messages with no details.

I don't think we should need this either, I'm not sure I like the change. The whole idea was OE-Core could run "distroless".

Cheers,

Richard

author
#7 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Quoted 28 lines · Richard Purdie
Quoted 20 lines · Khem Raj

---
 meta/conf/distro/include/default-distrovars.inc |    7 +++++++

 1 files changed, 7 insertions(+), 0 deletions(-)
meta/conf/distro/include/default-distrovars.inc +0 -0
index 16b3108..dba204e 100644
@@ -41,6 +41,13 @@ NO32LIBS ??= "1"
 
  # Default to emitting logfiles if a build fails.

 BBINCLUDELOGS ??= "yes"

meta/conf/distro/include/default-distrovars.inc +7 -0
+
+# dummy distro related variables
+# they should be overridden by real distros
+# these fallbacks only serve the purpose of
+# oe-core standalone testability
+
+DISTRO ??= ""
Quoted 2 lines

 SDK_VERSION ??= "oe-core.0"
 DISTRO_VERSION ??= "oe-core.0"

Why do we need this? The commit message tells me what you're doing but not why. I'm really getting frustrated with one line commit messages with no details.

Quoted 3 lines

I don't think we should need this either, I'm not sure I like the change. The whole idea was OE-Core could run "distroless".

There is an error case I dont remeber how I obtained that where it prints bogus value if DISTRO is not
defined at all but and empty DISTRO var is distroless in essence anyway IMO

Quoted 13 lines

Cheers,

Richard

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#8 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Quoted 30 lines · Khem Raj
Quoted 28 lines · Richard Purdie
Quoted 12 lines · Khem Raj
---
  meta/conf/distro/include/default-distrovars.inc |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)
meta/conf/distro/include/default-distrovars.inc +0 -0
index 16b3108..dba204e 100644
@@ -41,6 +41,13 @@ NO32LIBS ??= "1"
 
  # Default to emitting logfiles if a build fails.

meta/conf/distro/include/default-distrovars.inc NO32LIBS ??= "1" · line 52

Quoted 10 lines
meta/conf/distro/include/default-distrovars.inc +7 -0
  BBINCLUDELOGS ??= "yes"
+
+# dummy distro related variables
+# they should be overridden by real distros
+# these fallbacks only serve the purpose of
+# oe-core standalone testability
+
+DISTRO ??= ""
  SDK_VERSION ??= "oe-core.0"
  DISTRO_VERSION ??= "oe-core.0"

Why do we need this? The commit message tells me what you're doing but not why. I'm really getting frustrated with one line commit messages with no details.

Quoted 8 lines
Quoted 3 lines

I don't think we should need this either, I'm not sure I like the change. The whole idea was OE-Core could run "distroless".

There is an error case I dont remeber how I obtained that where it prints bogus value if DISTRO is not
defined at all but and empty DISTRO var is distroless in essence anyway IMO

Khem,

Please let us know what the reproducer for this is. Once we have a reproducer we can look into the issue.

Sau!

Quoted 18 lines
Quoted 9 lines

Cheers,

Richard

Quoted 4 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

author
#9 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Quoted 45 lines · Saul Wold
Quoted 35 lines · Khem Raj
Quoted 32 lines · Richard Purdie
Quoted 22 lines · Khem Raj

---
 meta/conf/distro/include/default-distrovars.inc |    7 +++++++

 1 files changed, 7 insertions(+), 0 deletions(-)
meta/conf/distro/include/default-distrovars.inc +0 -0
index 16b3108..dba204e 100644
@@ -41,6 +41,13 @@ NO32LIBS ??= "1"
 
  # Default to emitting logfiles if a build fails.

 BBINCLUDELOGS ??= "yes"

meta/conf/distro/include/default-distrovars.inc +7 -0
+
+# dummy distro related variables
+# they should be overridden by real distros
+# these fallbacks only serve the purpose of
+# oe-core standalone testability
+
+DISTRO ??= ""
Quoted 2 lines

 SDK_VERSION ??= "oe-core.0"
 DISTRO_VERSION ??= "oe-core.0"

Why do we need this? The commit message tells me what you're doing but not why. I'm really getting frustrated with one line commit messages with no details.

Quoted 9 lines
Quoted 3 lines

I don't think we should need this either, I'm not sure I like the change. The whole idea was OE-Core could run "distroless".

There is an error case I dont remeber how I obtained that where it prints bogus value if DISTRO is not
defined at all but and empty DISTRO var is distroless in essence anyway IMO

Quoted 4 lines

Khem,

Please let us know what the reproducer for this is.  Once we have a reproducer we can look into the issue.

yeah.

Quoted 23 lines

Sau!

Quoted 19 lines
Quoted 9 lines

Cheers,

Richard

Quoted 4 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#10 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

In reply to Saul Wold
Quoted 35 lines · Saul Wold
Quoted 34 lines · Khem Raj
Quoted 31 lines · Richard Purdie
Quoted 12 lines · Khem Raj
---
 meta/conf/distro/include/default-distrovars.inc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
meta/conf/distro/include/default-distrovars.inc +0 -0
index 16b3108..dba204e 100644
@@ -41,6 +41,13 @@ NO32LIBS ??= "1"
 
 # Default to emitting logfiles if a build fails.

meta/conf/distro/include/default-distrovars.inc NO32LIBS ??= "1" · line 52

Quoted 10 lines
meta/conf/distro/include/default-distrovars.inc +7 -0
 BBINCLUDELOGS ??= "yes"
+
+# dummy distro related variables
+# they should be overridden by real distros
+# these fallbacks only serve the purpose of
+# oe-core standalone testability
+
+DISTRO ??= ""
 SDK_VERSION ??= "oe-core.0"
 DISTRO_VERSION ??= "oe-core.0"

Why do we need this? The commit message tells me what you're doing but not why. I'm really getting frustrated with one line commit messages with no details.

I don't think we should need this either, I'm not sure I like the change. The whole idea was OE-Core could run "distroless".

Quoted 8 lines
Quoted 4 lines

There is an error case I dont remeber how I obtained that where it prints bogus value if DISTRO is not
defined at all but and empty DISTRO var is distroless in essence anyway IMO

Khem,

Please let us know what the reproducer for this is. Once we have a reproducer we can look into the issue.

Richard, Saul, Khem,

I was able to track this issue down (at least the one I was having). DISTRO is used in OVERRIDES unconditionally:

OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:forcevariable" DISTROOVERRIDES ?= "${DISTRO}"

If DISTRO is not set, FILESPATH becomes littered with directories like files/${DISTRO} etc. It won't bomb until you try to eval it - i.e. manipulating FILESPATH directly with .= works fine, but calling e.g. base_set_filespath() throws this:

ERROR: Failure expanding variable FILESPATH, expression was ${@blah} which triggered exception SyntaxError: EOL while scanning string literal (FILESPATH, line 1)

I have a patch that basically does this in conf/bitbake.conf to fix it:

-DISTROOVERRIDES ?= "${DISTRO}" +DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"

A proper formatted patch to follow...

Signature · 1 line
Denys
author
#11 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Review

Quoted 3 lines · Denys Dmytriyenko
(quoted diff) +1 -1
-DISTROOVERRIDES ?= "${DISTRO}"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"

whats wrong with patch I proposed ?

author
#12 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Quoted 6 lines · Khem Raj

Review

Quoted 3 lines · Denys Dmytriyenko
(quoted diff) +1 -1
-DISTROOVERRIDES ?= "${DISTRO}"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"

whats wrong with patch I proposed ?

Richard

I was in same situation as Denys when I did that patch. I think this could be a good patch to consider

#13 lore raw

Re: [PATCH 3/4] default-distrovars: Add empty weak definition for DISTRO variable

Quoted 8 lines · Khem Raj
Quoted 6 lines · Khem Raj

Review

Quoted 3 lines · Denys Dmytriyenko
(quoted diff) +1 -1
-DISTROOVERRIDES ?= "${DISTRO}"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"

whats wrong with patch I proposed ?

Quoted 4 lines

Richard

I was in same situation as Denys when I did that patch. I think this could be a good patch to consider

I agree and its merged! :)

Cheers,

Richard

author
#14 lore raw

PATCH 4/4 gcc: Stash the gcc-cross builddir to reuse in libgcc and gcc-runtime

In reply to Khem Raj

Currently we stash the libgcc install tree and then reuse that to populate libgcc recipe later. This mechanism does not work for gcc 4.7/trunk since now libstdc++ needs access to build tree of libgcc. This patch stashes the gcc-cross build tree and then reuses this in libgcc as well as in gcc-runtime recipe builds.

Now we build libgcc in the libgcc recipe instead of just using the prebuilt install tree

core-image-minimal build/run tested on all qemu machines

---
 meta/recipes-devtools/gcc/gcc-4.6.inc              |    2 +-
 meta/recipes-devtools/gcc/gcc-configure-common.inc |    3 --
 .../recipes-devtools/gcc/gcc-configure-runtime.inc |   24 ++++++++++------
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    |    2 +-
 meta/recipes-devtools/gcc/gcc-package-cross.inc    |   14 +--------
 meta/recipes-devtools/gcc/libgcc_4.6.bb            |   30 ++++++++++++++++----
 6 files changed, 42 insertions(+), 33 deletions(-)
meta/recipes-devtools/gcc/gcc-4.6.inc +1 -1
index ece378d..be38139 100644
@@ -1,6 +1,6 @@
 require gcc-common.inc
 
-PR = "r22"
+PR = "r23"
 
 # Third digit in PV should be incremented after a minor release
 # happens from this branch on gcc e.g. currently its 4.6.0
meta/recipes-devtools/gcc/gcc-configure-common.inc +0 -3
index c4b6ac1..c060c56 100644
@@ -68,9 +68,6 @@ do_configure_prepend () {
 	echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
 	cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
 	cat >>${B}/gcc/defaults.h.new <<_EOF
-#ifndef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "${SYSTEMHEADERS}"
-#endif
 #ifndef STANDARD_STARTFILE_PREFIX_1
 #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
 #endif
meta/recipes-devtools/gcc/gcc-configure-runtime.inc +15 -9
index 34bfaeb..353b083 100644
@@ -3,6 +3,7 @@ require gcc-configure-common.inc
 CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
 
 EXTRA_OECONF_PATHS = " \
+    --enable-sjlj-exceptions=no \
     --with-local-prefix=${STAGING_DIR_TARGET}${prefix} \
     --with-gxx-include-dir=${includedir}/c++/ \
     --with-sysroot=${STAGING_DIR_TARGET} \
@@ -16,26 +17,32 @@ RUNTIMETARGET = "libssp libstdc++-v3"
 
 do_configure () {
 	export CXX="${CXX} -nostdinc++ -nostdlib++"
-	for d in ${RUNTIMETARGET}; do
+	mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
+	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B}
+	for d in libgcc ${RUNTIMETARGET}; do
 		echo "Configuring $d"
-		mkdir -p ${B}/$d/
-		cd ${B}/$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 () {
-	for d in ${RUNTIMETARGET}; do
-		cd ${B}/$d/
-		oe_runmake
+	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	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#-nativesdk##`
 	for d in ${RUNTIMETARGET}; do
-		cd ${B}/$d/
-		oe_runmake 'DESTDIR=${D}' install
+		cd ${B}/$target/$d/
+		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
 	done
 	chown -R root:root ${D}
 }
@@ -45,4 +52,3 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
 PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
 
 BBCLASSEXTEND = "nativesdk"
-
meta/recipes-devtools/gcc/gcc-cross-initial.inc +1 -1
index f0e7810..66c47e0 100644
@@ -25,5 +25,5 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
 		${@get_gcc_fpu_setting(bb, d)}"
 
 do_compile () {
-    oe_runmake
+    oe_runmake all-gcc all-target-libgcc
 }
meta/recipes-devtools/gcc/gcc-package-cross.inc +1 -13
index c872e00..1522ab2 100644
@@ -36,19 +36,7 @@ do_install () {
 	case ${PN} in
 		*gcc-cross|*gcc-crosssdk)
 			dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS}
-			oe_runmake "DESTDIR=$dest" libdir=${target_libdir} base_libdir=${target_base_libdir} prefix=${target_prefix} exec_prefix=${target_exec_prefix} install-target-libgcc
-
-			# Ideally here we'd override the libgcc Makefile's idea of slibdir but
-			# for now, we just move the files to the correct location
-
-			install -d $dest${target_base_libdir}
-			mv $dest${target_exec_prefix}/${TARGET_SYS}/lib*/* $dest${target_base_libdir}
-			rm -rf $dest${target_exec_prefix}/${TARGET_SYS}
-
-			# Also need to move gcc from /usr/lib/gcc/* to /usr/lib/ else the search paths won't find the crt*.o files
-
-			mv $dest${target_libdir}/gcc/* $dest${target_libdir}/
-			rmdir $dest${target_libdir}/gcc
+			cp -a . $dest
 		;;
 	esac
 }
meta/recipes-devtools/gcc/libgcc_4.6.bb +24 -6
index 01a3b57..8a5f156 100644
@@ -20,15 +20,27 @@ FILES_libgcov-dev = " \
 
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
+EXTRA_OECONF += "--enable-sjlj-exceptions=no"
 
-do_install () {
+do_configure () {
 	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
-
-	# Install libgcc from our gcc-cross saved data
 	install -d ${D}${base_libdir} ${D}${libdir}
-	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${D}
+	cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
+	mkdir -p ${B}/${PN}
+	cd ${B}/${PN}
+	chmod a+x ${S}/${PN}/configure
+	${S}/${PN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+do_compile () {
+	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	cd ${B}/${PN}
+	oe_runmake MULTIBUILDTOP=${B}/$target/${PN}/
+}
+
+do_install () {
+	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+	cd ${B}/${PN}
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${PN}/ install
 
 	# Move libgcc_s into /lib
 	mkdir -p ${D}${base_libdir}
@@ -38,6 +50,12 @@ do_install () {
 		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/
+
 	chown -R root:root ${D}
 	chmod +x ${D}${base_libdir}/libgcc_s.so.*
 }
Signature · 1 line
1.7.5.4
author
#15 lore raw
In reply to Khem Raj
Quoted 5 lines · Khem Raj

Add recipe class to overrides
Prepare gcc for 4.7 changes
missing DEPENDS found during individual recipe builds Add emptry DISTRO to oe-core

I have rebased the tree on top of todays master there were some conflicts w.r.t gcc patch.

Quoted 34 lines

The following changes since commit a1f23a7cc527afdd1ce6cc7cd6083ee78fde09b3:

 update-rc.d.bbclass: do nothing for extended cross packages (2012-02-24 00:47:44 +0000)

are available in the git repository at:
 git://git.openembedded.org/openembedded-core-contrib kraj/misc
 http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/misc

Khem Raj (4):
 glib-networking: Add intltools-native to DEPENDS
 classes: Add recipe class to overrides
 default-distrovars: Add empty weak definition for DISTRO variable
 gcc: Stash the gcc-cross builddir to reuse in libgcc and gcc-runtime

 meta/classes/base.bbclass                          |    1 + meta/classes/cross-canadian.bbclass                |    2 +- meta/classes/cross.bbclass                         |    1 + meta/classes/crosssdk.bbclass                      |    1 + meta/classes/native.bbclass                        |    3 +- meta/classes/nativesdk.bbclass                     |    3 +- meta/conf/bitbake.conf                             |    3 +- meta/conf/distro/include/default-distrovars.inc    |    7 ++++ .../glib-networking/glib-networking_2.28.7.bb      |    2 +- meta/recipes-devtools/gcc/gcc-4.6.inc              |    2 +- meta/recipes-devtools/gcc/gcc-configure-common.inc |    3 -- .../recipes-devtools/gcc/gcc-configure-runtime.inc |   24 ++++++++++------ meta/recipes-devtools/gcc/gcc-cross-initial.inc    |    2 +- meta/recipes-devtools/gcc/gcc-package-cross.inc    |   14 +-------- meta/recipes-devtools/gcc/libgcc_4.6.bb            |   30 ++++++++++++++++----

 15 files changed, 58 insertions(+), 40 deletions(-)

--
1.7.5.4