All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
@ 2011-01-18 13:57 Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 1/7] sstate.bbclass: allow each step of toolchain bootstrap processes to do populate_sysroot independently Dexuan Cui
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

Hi Richard and all,

The patch set enhances the toolchain bootstrap process by installing a separate sysroot for each step of the process.
The purpose is to avoid file overwriting in the current global sysroot, namely, to fix Bug 239: http://bugzilla.pokylinux.org/show_bug.cgi?id=239


The basic idea is straightforward:
1) For gcc-cross-initial and -intermediate, by changing MULTIMACH_TARGET_SYS to install the files into new locations;
2) Fix the build of eglibc-initial, eglibc by using the appropriate compilers, libs, headers;
3) Also make proper changes for the crosssdk/nativesdk version.

I've split all the changes into small git commits and each commit should be basically self-explanatory. :-)

Please review the commits and comment. Thanks!

Test Results:
I've tested building poky-image-sdk on various qemu targets: the qemu target can boot fine.
I'm also testing building meta-toolchain-sdk -- not finished yet, but I think it should be fine because "bitbake gcc-runtime-nativesdk" and "bitbake gcc-cross-canadian-mips" can succeed.
I'll be doing more tests.

TODO:
1) changes to gcc-4.3.3 not completely finished (Should we still support gcc-4.3.3 since we have gcc-4.5.1?)
   However I think I should be able to add the missing changes soon, supposing here 4.3.3 and 4.5.1 have no big difference.
2) do more tests against glibc rather than eglibc.


Pull URL: git://git.pokylinux.org/poky-contrib.git
  Branch: dcui/tcbp-v3
  Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dcui/tcbp-v3

Thanks,
    Dexuan Cui <dexuan.cui@intel.com>
---


Dexuan Cui (7):
  sstate.bbclass: allow each step of toolchain bootstrap processes to
    do populate_sysroot independently
  cross.bbclass: make MULTIMACH_TARGET_SYS adjustable for bindir,
    libdir, libexecdir
  gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR
    and insall into new locations
  eglibc-initial, eglibc-initial-nativesdk: install into individual
    sysroots
  gcc-cross-intermediate, gcc-crosssdk-intermediate: change
    CROSS_TARGET_SYS_DIR and insall into new locations
  cross.bbclass: modify sysroot_stage_all to allow
    gcc-{cross,crossdk}-intermediate to populate the libgcc_s.so* files
  eglibc, eglibc-nativesdk: fix the build due to changes to
    eglibc-initial and gcc-cross-intermediate

 meta/classes/cross.bbclass                         |   17 +++++---
 meta/classes/sstate.bbclass                        |   24 ------------
 meta/recipes-core/eglibc/eglibc-initial.inc        |   10 +++++
 meta/recipes-core/eglibc/eglibc.inc                |    9 ++++
 meta/recipes-core/eglibc/eglibc_2.12.bb            |    8 +---
 .../fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch          |   40 ++++++++++++++++++++
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    |    2 +
 .../gcc/gcc-cross-initial_4.3.3.bb                 |    2 +-
 .../gcc/gcc-cross-initial_4.5.1.bb                 |    2 +-
 .../gcc/gcc-cross-intermediate.inc                 |   32 ++++++++++++++-
 .../gcc/gcc-cross-intermediate_4.3.3.bb            |    2 +-
 .../gcc/gcc-cross-intermediate_4.5.1.bb            |    2 +-
 .../gcc/gcc-crosssdk-initial_4.3.3.bb              |    2 +-
 .../gcc/gcc-crosssdk-initial_4.5.1.bb              |    2 +-
 .../gcc/gcc-crosssdk-intermediate.inc              |    3 +
 .../gcc/gcc-crosssdk-intermediate_4.3.3.bb         |    2 +-
 .../gcc/gcc-crosssdk-intermediate_4.5.1.bb         |    2 +-
 17 files changed, 113 insertions(+), 48 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.5.1/fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch

-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 1/7] sstate.bbclass: allow each step of toolchain bootstrap processes to do populate_sysroot independently
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 2/7] cross.bbclass: make MULTIMACH_TARGET_SYS adjustable for bindir, libdir, libexecdir Dexuan Cui
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

I'm adding an indidivual sysroot for each step.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/classes/sstate.bbclass |   24 ------------------------
 1 files changed, 0 insertions(+), 24 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index b6e6c92..8d85f42 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -87,30 +87,6 @@ def sstate_install(ss, d):
     if os.access(manifest, os.R_OK):
         bb.fatal("Package already staged (%s)?!" % manifest)
 
-    def checkmanifest(pn, task):
-        return os.access(bb.data.expand("${SSTATE_MANFILEBASE}%s.%s" % (pn, task), d), os.R_OK)
-
-    skipinst = False
-    pn = d.getVar("PN", True)
-    if pn == "gcc-cross-initial":
-        if checkmanifest("gcc-cross", "populate-sysroot"):
-            skipinst = True
-        if checkmanifest("gcc-cross-intermediate", "populate-sysroot"):
-            skipinst = True
-    elif pn == "gcc-cross-intermediate":
-        if checkmanifest("gcc-cross", "populate-sysroot"):
-            skipinst = True
-    elif pn == "glibc-initial":
-        if checkmanifest("glibc", "populate-sysroot"):
-            skipinst = True
-    elif pn == "eglibc-initial":
-        if checkmanifest("eglibc", "populate-sysroot"):
-            skipinst = True
-
-    if skipinst:
-        bb.note("Not staging %s.%s as sysroot already contains better functionality" % (pn, ss['name']))
-        return
-
     locks = []
     for lock in ss['lockfiles']:
         locks.append(bb.utils.lockfile(lock))
-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 2/7] cross.bbclass: make MULTIMACH_TARGET_SYS adjustable for bindir, libdir, libexecdir
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 1/7] sstate.bbclass: allow each step of toolchain bootstrap processes to do populate_sysroot independently Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

This will be used by gcc-cross-initial and gcc-cross-intermediate.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/classes/cross.bbclass |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 7c20be0..59d8293 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -40,15 +40,16 @@ target_prefix := "${prefix}"
 target_exec_prefix := "${exec_prefix}"
 
 # Overrides for paths
+CROSS_TARGET_SYS_DIR = "${MULTIMACH_TARGET_SYS}"
 prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
 base_prefix = "${STAGING_DIR_NATIVE}"
 exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
-bindir = "${exec_prefix}/bin/${MULTIMACH_TARGET_SYS}"
+bindir = "${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}"
 sbindir = "${bindir}"
 base_bindir = "${bindir}"
 base_sbindir = "${bindir}"
-libdir = "${exec_prefix}/lib/${MULTIMACH_TARGET_SYS}"
-libexecdir = "${exec_prefix}/libexec/${MULTIMACH_TARGET_SYS}"
+libdir = "${exec_prefix}/lib/${CROSS_TARGET_SYS_DIR}"
+libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
 
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 1/7] sstate.bbclass: allow each step of toolchain bootstrap processes to do populate_sysroot independently Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 2/7] cross.bbclass: make MULTIMACH_TARGET_SYS adjustable for bindir, libdir, libexecdir Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 14:58   ` Koen Kooi
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 4/7] eglibc-initial, eglibc-initial-nativesdk: install into individual sysroots Dexuan Cui
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/recipes-devtools/gcc/gcc-cross-initial.inc    |    2 ++
 .../gcc/gcc-cross-initial_4.3.3.bb                 |    2 +-
 .../gcc/gcc-cross-initial_4.5.1.bb                 |    2 +-
 .../gcc/gcc-crosssdk-initial_4.3.3.bb              |    2 +-
 .../gcc/gcc-crosssdk-initial_4.5.1.bb              |    2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
index f582de9..4e2e343 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -2,6 +2,8 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils gettext-native ${NATIVEDEPS}"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
 PACKAGES = ""
 
+CROSS_TARGET_SYS_DIR_append = ".${PN}"
+
 # This is intended to be a -very- basic config
 # sysroot is needed in case we use libc-initial
 EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
index 081b7d6..28ac1ab 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r4"
+PR = "r5"
 
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
index a121782..b2c257d 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r1"
+PR = "r2"
 
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
index 5daa31b..b42de47 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
@@ -1,3 +1,3 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
-PR = "r5"
+PR = "r6"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
index 0fc5faa..240caf5 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
@@ -1,4 +1,4 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
 
-PR = "r1"
+PR = "r2"
-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 4/7] eglibc-initial, eglibc-initial-nativesdk: install into individual sysroots
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
                   ` (2 preceding siblings ...)
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 5/7] gcc-cross-intermediate, gcc-crosssdk-intermediate: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

Install sysroot to ${STAGING_DIR_TARGET}/${PN}.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/recipes-core/eglibc/eglibc-initial.inc |   10 ++++++++++
 meta/recipes-core/eglibc/eglibc_2.12.bb     |    2 +-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
index d49ec8a..ea0763e 100644
--- a/meta/recipes-core/eglibc/eglibc-initial.inc
+++ b/meta/recipes-core/eglibc/eglibc-initial.inc
@@ -1,5 +1,8 @@
 require eglibc-common.inc
 
+STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-cross-initial:"
+STAGING_BINDIR_TOOLCHAIN_virtclass-nativesdk_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-initial:"
+
 DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial"
 PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
 
@@ -42,8 +45,15 @@ do_install () {
        install -m 644 csu/crt[1in].o ${D}${libdir}
        ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
                -o ${D}${libdir}/libc.so
+
+       # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
+       ln -s ${STAGING_DIR_TARGET}${includedir}/linux  ${D}${includedir}/
+       ln -s ${STAGING_DIR_TARGET}${includedir}/asm  ${D}${includedir}/
+       ln -s ${STAGING_DIR_TARGET}${includedir}/asm-generic  ${D}${includedir}/
 }
 
 do_siteconfig () {
 	:
 }
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TARGET}/${PN}"
diff --git a/meta/recipes-core/eglibc/eglibc_2.12.bb b/meta/recipes-core/eglibc/eglibc_2.12.bb
index c773af0..97353b7 100644
--- a/meta/recipes-core/eglibc/eglibc_2.12.bb
+++ b/meta/recipes-core/eglibc/eglibc_2.12.bb
@@ -2,7 +2,7 @@ require eglibc.inc
 
 DEPENDS += "gperf-native"
 FILESPATHPKG =. "eglibc-svn:"
-PR = "r13"
+PR = "r14"
 
 EGLIBC_BRANCH="eglibc-2_12"
 SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http \
-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 5/7] gcc-cross-intermediate, gcc-crosssdk-intermediate: change CROSS_TARGET_SYS_DIR and insall into new locations
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
                   ` (3 preceding siblings ...)
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 4/7] eglibc-initial, eglibc-initial-nativesdk: install into individual sysroots Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 6/7] cross.bbclass: modify sysroot_stage_all to allow gcc-{cross, crossdk}-intermediate to populate the libgcc_s.so* files Dexuan Cui
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 .../fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch          |   40 ++++++++++++++++++++
 .../gcc/gcc-cross-intermediate.inc                 |   29 +++++++++++++-
 .../gcc/gcc-cross-intermediate_4.3.3.bb            |    2 +-
 .../gcc/gcc-cross-intermediate_4.5.1.bb            |    2 +-
 .../gcc/gcc-crosssdk-intermediate.inc              |    3 +
 .../gcc/gcc-crosssdk-intermediate_4.3.3.bb         |    2 +-
 .../gcc/gcc-crosssdk-intermediate_4.5.1.bb         |    2 +-
 7 files changed, 73 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.5.1/fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.5.1/fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.5.1/fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..9fd8621
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.5.1/fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch
@@ -0,0 +1,40 @@
+This patch is used to fix gcc's Bug 35804:
+
+We made the patch according to the hint:
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35804#c3
+
+"joseph@codesourcery.com 2008-04-02 17:52:36 UTC
+Subject: Re:  Bootstrap of combined gcc + binutils, with
+ --enable-shared, with sysroot fails
+
+On Wed, 2 Apr 2008, pinskia at gcc dot gnu dot org wrote:
+
+> Sounds like you should be using --build-sysroot= and not set LDFLAGS_FOR_TARGET
+> and CPPFLAGS_FOR_TARGET .
+
+My experience is that you do need to set LDFLAGS_FOR_TARGET and
+CPPFLAGS_FOR_TARGET to include the --sysroot option if you're configuring
+with a build sysroot.  (This is a bug: --with-build-sysroot should cause
+the right --sysroot option to be used automatically when compiling and
+linking runtime libraries.)"
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index d986692..b0531ac 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -537,10 +537,11 @@ CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
+ 
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+-LDFLAGS_FOR_TARGET = 
+ 
+ FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
+ SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
++CPPFLAGS_FOR_TARGET = ${SYSROOT_CFLAGS_FOR_TARGET}
++LDFLAGS_FOR_TARGET = ${SYSROOT_CFLAGS_FOR_TARGET}
+ DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
+ 
+ XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
index 72a4241..32e4e5e 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
@@ -3,6 +3,13 @@ DEPENDS += "virtual/${TARGET_PREFIX}libc-initial gettext-native"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc-intermediate"
 PACKAGES = ""
 
+SRC_URI += " file://fix_CPPFLAGS_LDFLAGS_FOR_TARGET.patch"
+
+CROSS_TARGET_SYS_DIR_append = ".${PN}"
+
+
+GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT = "${STAGING_DIR_TARGET}/eglibc-initial/${TARGET_SYS}"
+
 # This is intended to be a -very- basic config
 # sysroot is needed in case we use libc-initial
 EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
@@ -13,7 +20,7 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
                 ${OPTSPACE} \
 		--program-prefix=${TARGET_PREFIX} \
 		--with-sysroot=${STAGING_DIR_TARGET} \
-		--with-build-sysroot=${STAGING_DIR_TARGET} \
+		--with-build-sysroot=${GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT} \
 		${EXTRA_OECONF_INTERMEDIATE} \
 		${@get_gcc_fpu_setting(bb, d)}"
 
@@ -23,6 +30,22 @@ do_compile () {
 
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
-	install -d ${D}${target_base_libdir}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
+
+	# Without the .{PN} suffix, here it would conflict with the recipe libgcc.
+	install -d ${D}${target_base_libdir}.${PN}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}.${PN}/
+
+	# We don't really need this (here shares/ contains man, info, locale).
+	rm -rf ${D}${prefix}/share/
+
+	# binutils has supplied libiberty.a.
+	rm -f ${D}${exec_prefix}/lib/lib/libiberty.a
+
+	# 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
+	done
 }
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
index 9a30cb5..a8473b0 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r4"
+PR = "r5"
 
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb
index 7aaa5b0..10681da 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r1"
+PR = "r2"
 
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc
index ed5d5e8..5d1d055 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate.inc
@@ -7,3 +7,6 @@ SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
 DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native"
 DEPENDS += "virtual/${TARGET_PREFIX}libc-initial-nativesdk"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc-intermediate-crosssdk"
+
+GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT = "${STAGING_DIR_TARGET}/eglibc-initial-nativesdk/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
index cd1f966..2be05f1 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
@@ -1,3 +1,3 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
-PR = "r8"
+PR = "r9"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb
index 4260c35..a6653dd 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb
@@ -1,4 +1,4 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
 
-PR = "r1"
+PR = "r2"
-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 6/7] cross.bbclass: modify sysroot_stage_all to allow gcc-{cross, crossdk}-intermediate to populate the libgcc_s.so* files
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
                   ` (4 preceding siblings ...)
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 5/7] gcc-cross-intermediate, gcc-crosssdk-intermediate: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 7/7] eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate Dexuan Cui
  2011-01-24 16:04 ` [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Richard Purdie
  7 siblings, 0 replies; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/classes/cross.bbclass                         |   10 ++++++----
 .../gcc/gcc-cross-intermediate.inc                 |    7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 59d8293..435362b 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -41,6 +41,8 @@ target_exec_prefix := "${exec_prefix}"
 
 # Overrides for paths
 CROSS_TARGET_SYS_DIR = "${MULTIMACH_TARGET_SYS}"
+CROSS_TARGET_LIBDIR = "${target_libdir}"
+CROSS_TARGET_BASE_LIBDIR = "${target_base_libdir}"
 prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
 base_prefix = "${STAGING_DIR_NATIVE}"
 exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
@@ -60,10 +62,10 @@ do_install () {
 #
 sysroot_stage_all() {
 	sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
-	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
-	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/  
-	mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
-	mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
+	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${CROSS_TARGET_BASE_LIBDIR}/
+	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${CROSS_TARGET_LIBDIR}/
+	mv ${SYSROOT_DESTDIR}${CROSS_TARGET_BASE_LIBDIR}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${CROSS_TARGET_BASE_LIBDIR}/ || true
+	mv ${SYSROOT_DESTDIR}${CROSS_TARGET_LIBDIR}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${CROSS_TARGET_LIBDIR}/ || true
 }
 
 
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
index 32e4e5e..4e4b050 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
@@ -28,12 +28,15 @@ do_compile () {
     oe_runmake
 }
 
+CROSS_TARGET_LIBDIR = "${target_libdir}.${PN}"
+CROSS_TARGET_BASE_LIBDIR = "${target_base_libdir}.${PN}"
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 
 	# Without the .{PN} suffix, here it would conflict with the recipe libgcc.
-	install -d ${D}${target_base_libdir}.${PN}/
-	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}.${PN}/
+	install -d ${D}${CROSS_TARGET_BASE_LIBDIR}/
+	mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${CROSS_TARGET_BASE_LIBDIR}/
 
 	# We don't really need this (here shares/ contains man, info, locale).
 	rm -rf ${D}${prefix}/share/
-- 
1.7.2



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

* [RFC: enhance toolchain bootstrap process: v3: 7/7] eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
                   ` (5 preceding siblings ...)
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 6/7] cross.bbclass: modify sysroot_stage_all to allow gcc-{cross, crossdk}-intermediate to populate the libgcc_s.so* files Dexuan Cui
@ 2011-01-18 13:57 ` Dexuan Cui
  2011-01-18 16:20   ` Tian, Kevin
  2011-01-24 16:04 ` [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Richard Purdie
  7 siblings, 1 reply; 16+ messages in thread
From: Dexuan Cui @ 2011-01-18 13:57 UTC (permalink / raw)
  To: poky

BTW: I'm not very sure about the comments about CPPFLAGS and LDFLAGS, but I do
need to pass the 2 variables to make eglibc build ok.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/recipes-core/eglibc/eglibc.inc     |    9 +++++++++
 meta/recipes-core/eglibc/eglibc_2.12.bb |    8 ++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc
index 4698254..a61d35d 100644
--- a/meta/recipes-core/eglibc/eglibc.inc
+++ b/meta/recipes-core/eglibc/eglibc.inc
@@ -1,5 +1,14 @@
 require eglibc-common.inc
 
+STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-cross-intermediate:"
+STAGING_BINDIR_TOOLCHAIN_virtclass-nativesdk_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-intermediate:"
+
+CPPFLAGS_prepend = "-I${STAGING_DIR_TARGET}/eglibc-initial/${TARGET_SYS}${includedir_native} "
+CPPFLAGS_virtclass-nativesdk_prepend = "-I${STAGING_DIR_TARGET}/eglibc-initial-nativesdk/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}${base_prefix}${includedir_native} "
+
+LDFLAGS_prepend= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-cross-intermediate "
+LDFLAGS_virtclass-nativesdk_prepend= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-crosssdk-intermediate "
+
 # nptl needs unwind support in gcc, which can't be built without glibc.
 DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
 #this leads to circular deps, so lets not add it yet
diff --git a/meta/recipes-core/eglibc/eglibc_2.12.bb b/meta/recipes-core/eglibc/eglibc_2.12.bb
index 97353b7..c325d1b 100644
--- a/meta/recipes-core/eglibc/eglibc_2.12.bb
+++ b/meta/recipes-core/eglibc/eglibc_2.12.bb
@@ -2,7 +2,7 @@ require eglibc.inc
 
 DEPENDS += "gperf-native"
 FILESPATHPKG =. "eglibc-svn:"
-PR = "r14"
+PR = "r15"
 
 EGLIBC_BRANCH="eglibc-2_12"
 SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http \
@@ -73,15 +73,13 @@ do_move_ports() {
 do_configure () {
 # override this function to avoid the autoconf/automake/aclocal/autoheader
 # calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
         if [ -z "`which rpcgen`" ]; then
                 echo "rpcgen not found.  Install glibc-devel."
                 exit 1
         fi
         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
         find ${S} -name "configure" | xargs touch
-        CPPFLAGS="" oe_runconf
+        oe_runconf
 }
 
 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
@@ -89,8 +87,6 @@ rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
 	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
 
 do_compile () {
-	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
-	unset LDFLAGS
 	base_do_compile
 	(
 		cd ${S}/sunrpc/rpcsvc
-- 
1.7.2



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

* Re: [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
@ 2011-01-18 14:58   ` Koen Kooi
  2011-01-19  9:06     ` Cui, Dexuan
  0 siblings, 1 reply; 16+ messages in thread
From: Koen Kooi @ 2011-01-18 14:58 UTC (permalink / raw)
  To: Dexuan Cui; +Cc: poky

Seeing all those PR bumps, would something like http://cgit.openembedded.org/cgit.cgi/meta-openembedded/commit/?id=6f1647aa (ignore the sysroot patch) be usefull for yocto?

Op 18 jan 2011, om 14:57 heeft Dexuan Cui het volgende geschreven:

> Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
> ---
> meta/recipes-devtools/gcc/gcc-cross-initial.inc    |    2 ++
> .../gcc/gcc-cross-initial_4.3.3.bb                 |    2 +-
> .../gcc/gcc-cross-initial_4.5.1.bb                 |    2 +-
> .../gcc/gcc-crosssdk-initial_4.3.3.bb              |    2 +-
> .../gcc/gcc-crosssdk-initial_4.5.1.bb              |    2 +-
> 5 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
> index f582de9..4e2e343 100644
> --- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
> +++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
> @@ -2,6 +2,8 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils gettext-native ${NATIVEDEPS}"
> PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
> PACKAGES = ""
> 
> +CROSS_TARGET_SYS_DIR_append = ".${PN}"
> +
> # This is intended to be a -very- basic config
> # sysroot is needed in case we use libc-initial
> EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
> diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
> index 081b7d6..28ac1ab 100644
> --- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
> +++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
> @@ -1,5 +1,5 @@
> require gcc-cross_${PV}.bb
> require gcc-cross-initial.inc
> 
> -PR = "r4"
> +PR = "r5"
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
> index a121782..b2c257d 100644
> --- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
> +++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
> @@ -1,5 +1,5 @@
> require gcc-cross_${PV}.bb
> require gcc-cross-initial.inc
> 
> -PR = "r1"
> +PR = "r2"
> 
> diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
> index 5daa31b..b42de47 100644
> --- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
> +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
> @@ -1,3 +1,3 @@
> require gcc-cross-initial_${PV}.bb
> require gcc-crosssdk-initial.inc
> -PR = "r5"
> +PR = "r6"
> diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
> index 0fc5faa..240caf5 100644
> --- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
> +++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
> @@ -1,4 +1,4 @@
> require gcc-cross-initial_${PV}.bb
> require gcc-crosssdk-initial.inc
> 
> -PR = "r1"
> +PR = "r2"
> -- 
> 1.7.2
> 
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky



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

* Re: [RFC: enhance toolchain bootstrap process: v3: 7/7] eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 7/7] eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate Dexuan Cui
@ 2011-01-18 16:20   ` Tian, Kevin
  0 siblings, 0 replies; 16+ messages in thread
From: Tian, Kevin @ 2011-01-18 16:20 UTC (permalink / raw)
  To: Cui, Dexuan, poky

> From: Dexuan Cui
> Sent: Tuesday, January 18, 2011 9:58 PM
> 
> BTW: I'm not very sure about the comments about CPPFLAGS and LDFLAGS, but
> I do
> need to pass the 2 variables to make eglibc build ok.

From the commit history the special tweaks on CPPFLAGS and LDFLAGS exist for a long
time. It's possible that they're there due to a specific issue which doesn't exist now. Does
anyone remember the historical reason here? If not, and the intensive tests works fine,
perhaps it's safe to change them. :-)

Thanks
Kevin

> 
> Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
> ---
>  meta/recipes-core/eglibc/eglibc.inc     |    9 +++++++++
>  meta/recipes-core/eglibc/eglibc_2.12.bb |    8 ++------
>  2 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/recipes-core/eglibc/eglibc.inc
> b/meta/recipes-core/eglibc/eglibc.inc
> index 4698254..a61d35d 100644
> --- a/meta/recipes-core/eglibc/eglibc.inc
> +++ b/meta/recipes-core/eglibc/eglibc.inc
> @@ -1,5 +1,14 @@
>  require eglibc-common.inc
> 
> +STAGING_BINDIR_TOOLCHAIN_prepend =
> "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-cross-intermediat
> e:"
> +STAGING_BINDIR_TOOLCHAIN_virtclass-nativesdk_prepend =
> "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-intermed
> iate:"
> +
> +CPPFLAGS_prepend =
> "-I${STAGING_DIR_TARGET}/eglibc-initial/${TARGET_SYS}${includedir_native} "
> +CPPFLAGS_virtclass-nativesdk_prepend =
> "-I${STAGING_DIR_TARGET}/eglibc-initial-nativesdk/${SDK_ARCH}-nativesdk${S
> DK_VENDOR}-${SDK_OS}${base_prefix}${includedir_native} "
> +
> +LDFLAGS_prepend=
> "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-cross-intermediate "
> +LDFLAGS_virtclass-nativesdk_prepend=
> "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-crosssdk-intermediate "
> +
>  # nptl needs unwind support in gcc, which can't be built without glibc.
>  DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
>  #this leads to circular deps, so lets not add it yet
> diff --git a/meta/recipes-core/eglibc/eglibc_2.12.bb
> b/meta/recipes-core/eglibc/eglibc_2.12.bb
> index 97353b7..c325d1b 100644
> --- a/meta/recipes-core/eglibc/eglibc_2.12.bb
> +++ b/meta/recipes-core/eglibc/eglibc_2.12.bb
> @@ -2,7 +2,7 @@ require eglibc.inc
> 
>  DEPENDS += "gperf-native"
>  FILESPATHPKG =. "eglibc-svn:"
> -PR = "r14"
> +PR = "r15"
> 
>  EGLIBC_BRANCH="eglibc-2_12"
>  SRC_URI =
> "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http
> \
> @@ -73,15 +73,13 @@ do_move_ports() {
>  do_configure () {
>  # override this function to avoid the autoconf/automake/aclocal/autoheader
>  # calls for now
> -# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
> -# version check and doesn't really help with anything
>          if [ -z "`which rpcgen`" ]; then
>                  echo "rpcgen not found.  Install glibc-devel."
>                  exit 1
>          fi
>          (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
>          find ${S} -name "configure" | xargs touch
> -        CPPFLAGS="" oe_runconf
> +        oe_runconf
>  }
> 
>  rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
> @@ -89,8 +87,6 @@ rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
>  	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
> 
>  do_compile () {
> -	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another
> glibc is in staging
> -	unset LDFLAGS
>  	base_do_compile
>  	(
>  		cd ${S}/sunrpc/rpcsvc
> --
> 1.7.2
> 
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky


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

* Re: [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations
  2011-01-18 14:58   ` Koen Kooi
@ 2011-01-19  9:06     ` Cui, Dexuan
  0 siblings, 0 replies; 16+ messages in thread
From: Cui, Dexuan @ 2011-01-19  9:06 UTC (permalink / raw)
  To: 'Koen Kooi'; +Cc: poky

Koen Kooi wrote:
> Seeing all those PR bumps, would something like
> http://cgit.openembedded.org/cgit.cgi/meta-openembedded/commit/?id=6f1647aa
> (ignore the sysroot patch) be usefull for yocto?  
It can be useful. I'll try to use that for my next version.
Thanks for the suggestion.

Thanks,
-- Dexuan

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

* Re: [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
  2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
                   ` (6 preceding siblings ...)
  2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 7/7] eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate Dexuan Cui
@ 2011-01-24 16:04 ` Richard Purdie
  2011-01-24 17:28   ` Cui, Dexuan
  7 siblings, 1 reply; 16+ messages in thread
From: Richard Purdie @ 2011-01-24 16:04 UTC (permalink / raw)
  To: Dexuan Cui; +Cc: poky

Hi Dexuan,

On Tue, 2011-01-18 at 21:57 +0800, Dexuan Cui wrote:
> Hi Richard and all,
> 
> The patch set enhances the toolchain bootstrap process by installing a separate sysroot for each step of the process.
> The purpose is to avoid file overwriting in the current global sysroot, namely, to fix Bug 239: http://bugzilla.pokylinux.org/show_bug.cgi?id=239
> 
> 
> The basic idea is straightforward:
> 1) For gcc-cross-initial and -intermediate, by changing MULTIMACH_TARGET_SYS to install the files into new locations;
> 2) Fix the build of eglibc-initial, eglibc by using the appropriate compilers, libs, headers;
> 3) Also make proper changes for the crosssdk/nativesdk version.
> 
> I've split all the changes into small git commits and each commit should be basically self-explanatory. :-)

I've had a look through this and experimented a little with the code and
I've some feedback:

  sstate.bbclass: allow each step of toolchain bootstrap processes to do populate_sysroot independently
  cross.bbclass: make MULTIMACH_TARGET_SYS adjustable for bindir, libdir, libexecdir

These two are fine.

  gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations

This change is ok but its incomplete. Why? If I apply this change and
try a build, things won't work as it needs bits from later commits. To
illustrate this and some other details, take a look at:

http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/tt-bootstrap&id=5512f876b103987b74722a7788a1ebe797852bbe

Here I've updated glibc and eglibc to use the new locations so the
change will allow a build to succeed in its own right. Notice that I've
simplified the variables quite a bit too.

There is also a subsequent commit on the branch to enable this change
for gcc-cross-intermediate.

  eglibc-initial, eglibc-initial-nativesdk: install into individual sysroots
  gcc-cross-intermediate, gcc-crosssdk-intermediate: change CROSS_TARGET_SYS_DIR and insall into new locations
  cross.bbclass: modify sysroot_stage_all to allow gcc-{cross,crossdk}-intermediate to populate the libgcc_s.so* files
  eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate

These other changes need separating out more cleanly. For example,
adding a patch to gcc should be a separate commit, the update to use a
new sysroot directory should probably be one commit so builds work
before and after it.

I'm also wondering if there isn't a neater way to handle the target
sysroot problem instead of the prefixes you're using. I'll send an
update as and when I've experimented a little to determine if this is
possible.

Cheers,

Richard





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

* Re: [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
  2011-01-24 16:04 ` [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Richard Purdie
@ 2011-01-24 17:28   ` Cui, Dexuan
  2011-01-24 17:55     ` Cui, Dexuan
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Cui, Dexuan @ 2011-01-24 17:28 UTC (permalink / raw)
  To: 'Richard Purdie'; +Cc: poky

[-- Attachment #1: Type: text/plain, Size: 4682 bytes --]

Richard Purdie wrote:
> Hi Dexuan,
> 
> On Tue, 2011-01-18 at 21:57 +0800, Dexuan Cui wrote:
>> Hi Richard and all,
>> 
>> The patch set enhances the toolchain bootstrap process by installing
>> a separate sysroot for each step of the process. 
>> The purpose is to avoid file overwriting in the current global
>> sysroot, namely, to fix Bug 239:
>> http://bugzilla.pokylinux.org/show_bug.cgi?id=239  
>> 
>> 
>> The basic idea is straightforward:
>> 1) For gcc-cross-initial and -intermediate, by changing
>> MULTIMACH_TARGET_SYS to install the files into new locations; 2) Fix
>> the build of eglibc-initial, eglibc by using the appropriate
>> compilers, libs, headers; 3) Also make proper changes for the
>> crosssdk/nativesdk version.  
>> 
>> I've split all the changes into small git commits and each commit
>> should be basically self-explanatory. :-) 
> 
> I've had a look through this and experimented a little with the code
> and 
> I've some feedback:
Hi Richard, thanks very much for the review and feedback!
BTW: I was just about to send out my "RFC v5" patches and I saw the mail. :-)

During the past days, I've been busy with testing and fixing & updating my patches.
The v5 patches are at  http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/log/?h=dcui/tcbp-v5 (actually it's the same as dcui/tcbp-test currently)
The attached v3-to-v5.diff shows the difference from v3 to v5:

1) fix several typos for  "_prepend_virtclass-nativesdk": previously I used the wrong "_virtclass-nativesdk_prepend"!

2) in eglibc-initial.inc, now the line is 
STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-initial:"
Previously, I used HOST_SYS rather than BASEPKG_HOST_SYS.  Actually HOST_SYS is not ok because this breaks arm/ppc builds.

3) similarly,
	in eglibc.inc: 
		STAGING_BINDIR_TOOLCHAIN_prepend: HOST_SYS --> BASEPKG_HOST_SYS
		CPPFLAGS_prepend: TARGET_SYS -> BASEPKG_TARGET_SYS
	in gcc-cross-intermediate.inc:
		GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT: TARGET_SYS --> BASEPKG_TARGET_SYS

4)  in eglibc-initial.inc:
	use a "for t in ..." loop to replace the previous 3 statements.

5) add the code for glibc and glibc-initial similarly.
6) bump PRs accordingly.

I'll send my current test results later.


>   sstate.bbclass: allow each step of toolchain bootstrap processes to
>   do populate_sysroot independently cross.bbclass: make
> MULTIMACH_TARGET_SYS adjustable for bindir, libdir, libexecdir 
> 
> These two are fine.
Thanks a lot for your previous great suggestion about MULTIMACH_TARGET_SYS. :-)

> 
>   gcc-cross-initial, gcc-crosssdk-initial: change
> CROSS_TARGET_SYS_DIR and insall into new locations 
> 
> This change is ok but its incomplete. Why? If I apply this change and
> try a build, things won't work as it needs bits from later commits. To
I split my changes into small commits for easy review. Sorry, I didn't try to ensure every commit should be buildable. :-)


> illustrate this and some other details, take a look at:
> 
> http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/tt-bootstrap&id=5512f876b103987b74722a7788a1ebe797852bbe
> 
> Here I've updated glibc and eglibc to use the new locations so the
> change will allow a build to succeed in its own right. Notice that
> I've 
> simplified the variables quite a bit too.
OK, I'll look at this branch carefully and see if anything in my v3-to-v5.diff should be added into this branch.

> There is also a subsequent commit on the branch to enable this change
> for gcc-cross-intermediate.
> 
>   eglibc-initial, eglibc-initial-nativesdk: install into individual
>   sysroots gcc-cross-intermediate, gcc-crosssdk-intermediate: change
>   CROSS_TARGET_SYS_DIR and insall into new locations cross.bbclass:
>   modify sysroot_stage_all to allow gcc-{cross,crossdk}-intermediate
> to populate the libgcc_s.so* files eglibc, eglibc-nativesdk: fix the
> build due to changes to eglibc-initial and gcc-cross-intermediate  
> 
> These other changes need separating out more cleanly. For example,
> adding a patch to gcc should be a separate commit, the update to use a
> new sysroot directory should probably be one commit so builds work
> before and after it.
OK, I'll think about how to organize the changes properly. Thanks for the suggestions!

> 
> I'm also wondering if there isn't a neater way to handle the target
> sysroot problem instead of the prefixes you're using. I'll send an
> update as and when I've experimented a little to determine if this is
> possible.
Thanks a lot for the help!


Thanks,
-- Dexuan

[-- Attachment #2: v3-to-v5.diff --]
[-- Type: application/octet-stream, Size: 9913 bytes --]

diff -Nru pc3/meta/recipes-core/eglibc/eglibc-initial.inc pc5/meta/recipes-core/eglibc/eglibc-initial.inc
--- pc3/meta/recipes-core/eglibc/eglibc-initial.inc	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-core/eglibc/eglibc-initial.inc	2011-01-25 00:55:05.000000000 +0800
@@ -1,7 +1,7 @@
 require eglibc-common.inc
 
-STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-cross-initial:"
-STAGING_BINDIR_TOOLCHAIN_virtclass-nativesdk_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-initial:"
+STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-initial:"
+STAGING_BINDIR_TOOLCHAIN_prepend_virtclass-nativesdk = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-initial:"
 
 DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial"
 PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
@@ -47,9 +47,9 @@
                -o ${D}${libdir}/libc.so
 
        # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
-       ln -s ${STAGING_DIR_TARGET}${includedir}/linux  ${D}${includedir}/
-       ln -s ${STAGING_DIR_TARGET}${includedir}/asm  ${D}${includedir}/
-       ln -s ${STAGING_DIR_TARGET}${includedir}/asm-generic  ${D}${includedir}/
+       for t in linux asm asm-generic; do
+               ln -s ${STAGING_DIR_TARGET}${includedir}/$t  ${D}${includedir}/
+       done
 }
 
 do_siteconfig () {
diff -Nru pc3/meta/recipes-core/eglibc/eglibc.inc pc5/meta/recipes-core/eglibc/eglibc.inc
--- pc3/meta/recipes-core/eglibc/eglibc.inc	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-core/eglibc/eglibc.inc	2011-01-25 00:55:05.000000000 +0800
@@ -1,13 +1,13 @@
 require eglibc-common.inc
 
-STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-cross-intermediate:"
-STAGING_BINDIR_TOOLCHAIN_virtclass-nativesdk_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-intermediate:"
+STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-intermediate:"
+STAGING_BINDIR_TOOLCHAIN_prepend_virtclass-nativesdk = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-intermediate:"
 
-CPPFLAGS_prepend = "-I${STAGING_DIR_TARGET}/eglibc-initial/${TARGET_SYS}${includedir_native} "
-CPPFLAGS_virtclass-nativesdk_prepend = "-I${STAGING_DIR_TARGET}/eglibc-initial-nativesdk/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}${base_prefix}${includedir_native} "
+CPPFLAGS_prepend = "-I${STAGING_DIR_TARGET}/eglibc-initial/${BASEPKG_TARGET_SYS}${includedir_native} "
+CPPFLAGS_prepend_virtclass-nativesdk = "-I${STAGING_DIR_TARGET}/eglibc-initial-nativesdk/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}${base_prefix}${includedir_native} "
 
 LDFLAGS_prepend= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-cross-intermediate "
-LDFLAGS_virtclass-nativesdk_prepend= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-crosssdk-intermediate "
+LDFLAGS_prepend_virtclass-nativesdk= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-crosssdk-intermediate "
 
 # nptl needs unwind support in gcc, which can't be built without glibc.
 DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
diff -Nru pc3/meta/recipes-core/glibc/glibc-initial.inc pc5/meta/recipes-core/glibc/glibc-initial.inc
--- pc3/meta/recipes-core/glibc/glibc-initial.inc	2011-01-24 05:04:37.000000000 +0800
+++ pc5/meta/recipes-core/glibc/glibc-initial.inc	2011-01-25 00:55:05.000000000 +0800
@@ -3,6 +3,9 @@
 PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/glibc-${PV}', '${FILE_DIRNAME}/glibc-2.4', '${FILE_DIRNAME}/glibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
 
+STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-initial:"
+STAGING_BINDIR_TOOLCHAIN_prepend_virtclass-nativesdk = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-initial:"
+
 PACKAGES = ""
 PACKAGES_DYNAMIC = ""
 
@@ -50,8 +53,15 @@
 	install -m 644 csu/crt[1in].o ${D}${libdir}
 	${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
 		-o ${D}${libdir}/libc.so
+
+	# add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
+	for t in linux asm asm-generic; do
+		ln -s ${STAGING_DIR_TARGET}${includedir}/$t  ${D}${includedir}/
+	done
 }
 
 do_siteconfig () {
 	:
 }
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TARGET}/${PN}"
diff -Nru pc3/meta/recipes-core/glibc/glibc.inc pc5/meta/recipes-core/glibc/glibc.inc
--- pc3/meta/recipes-core/glibc/glibc.inc	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-core/glibc/glibc.inc	2011-01-25 00:55:05.000000000 +0800
@@ -8,6 +8,16 @@
                     file://elf/cache.c;beginline=1;endline=17;md5=926aac25497b1de7d630b4749005d208 \
                     file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \
                     file://bits/types.h;beginline=1;endline=18;md5=267938e7c0538e76f734551ec6ea908d"
+
+STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-intermediate:"
+STAGING_BINDIR_TOOLCHAIN_prepend_virtclass-nativesdk = "${STAGING_DIR_NATIVE}${bindir_native}/${HOST_SYS}.gcc-crosssdk-intermediate:"
+
+CPPFLAGS_prepend = "-I${STAGING_DIR_TARGET}/glibc-initial/${BASEPKG_TARGET_SYS}${includedir_native} "
+CPPFLAGS_prepend_virtclass-nativesdk = "-I${STAGING_DIR_TARGET}/glibc-initial-nativesdk/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}${base_prefix}${includedir_native} "
+
+LDFLAGS_prepend= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-cross-intermediate "
+LDFLAGS_prepend_virtclass-nativesdk= "-L${STAGING_DIR_TARGET}${base_libdir}.gcc-crosssdk-intermediate "
+
 # nptl needs unwind support in gcc, which can't be built without glibc.
 DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
diff -Nru pc3/meta/recipes-core/glibc/glibc_2.10.1.bb pc5/meta/recipes-core/glibc/glibc_2.10.1.bb
--- pc3/meta/recipes-core/glibc/glibc_2.10.1.bb	2011-01-24 05:04:37.000000000 +0800
+++ pc5/meta/recipes-core/glibc/glibc_2.10.1.bb	2011-01-25 00:55:05.000000000 +0800
@@ -5,7 +5,7 @@
 PACKAGES_DYNAMIC = "libc6*"
 RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
 
-PR = "r6"
+PR = "r8"
 
 # the -isystem in bitbake.conf screws up glibc do_stage
 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
@@ -128,14 +128,12 @@
 	sed -i s:/var/db/nscd:/var/run/nscd: ${S}/nscd/nscd.h
 # override this function to avoid the autoconf/automake/aclocal/autoheader
 # calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
 	if [ -z "`which rpcgen`" ]; then
 		echo "rpcgen not found.  Install glibc-devel."
 		exit 1
 	fi
 	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
-	CPPFLAGS="" oe_runconf
+	oe_runconf
 }
 
 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
@@ -143,8 +141,6 @@
           rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
 
 do_compile () {
-	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
-	unset LDFLAGS
 	base_do_compile
 	(
 		cd ${S}/sunrpc/rpcsvc
diff -Nru pc3/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb pc5/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
--- pc3/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb	2011-01-25 00:55:05.000000000 +0800
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r2"
+PR = "r1"
 
diff -Nru pc3/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc pc5/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
--- pc3/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc	2011-01-25 00:55:05.000000000 +0800
@@ -8,7 +8,7 @@
 CROSS_TARGET_SYS_DIR_append = ".${PN}"
 
 
-GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT = "${STAGING_DIR_TARGET}/eglibc-initial/${TARGET_SYS}"
+GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT = "${STAGING_DIR_TARGET}/eglibc-initial/${BASEPKG_TARGET_SYS}"
 
 # This is intended to be a -very- basic config
 # sysroot is needed in case we use libc-initial
diff -Nru pc3/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb pc5/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb
--- pc3/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb	2011-01-25 00:55:05.000000000 +0800
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r2"
+PR = "r1"
 
diff -Nru pc3/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb pc5/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
--- pc3/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb	2011-01-25 00:55:05.000000000 +0800
@@ -1,4 +1,4 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
 
-PR = "r2"
+PR = "r1"
diff -Nru pc3/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb pc5/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb
--- pc3/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb	2011-01-25 00:54:59.000000000 +0800
+++ pc5/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb	2011-01-25 00:55:05.000000000 +0800
@@ -1,4 +1,4 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
 
-PR = "r2"
+PR = "r1"

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

* Re: [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
  2011-01-24 17:28   ` Cui, Dexuan
@ 2011-01-24 17:55     ` Cui, Dexuan
  2011-01-24 19:17     ` Chris Larson
  2011-01-25  0:53     ` Richard Purdie
  2 siblings, 0 replies; 16+ messages in thread
From: Cui, Dexuan @ 2011-01-24 17:55 UTC (permalink / raw)
  To: 'Richard Purdie'; +Cc: poky

Cui, Dexuan wrote:
> Richard Purdie wrote:
>> Hi Dexuan,
>> 
>> On Tue, 2011-01-18 at 21:57 +0800, Dexuan Cui wrote:
>>> Hi Richard and all,
>>> 
>>> The patch set enhances the toolchain bootstrap process by installing
>>> a separate sysroot for each step of the process.
>>> The purpose is to avoid file overwriting in the current global
>>> sysroot, namely, to fix Bug 239:
>>> http://bugzilla.pokylinux.org/show_bug.cgi?id=239
>>> 
>>> 
>>> The basic idea is straightforward:
>>> 1) For gcc-cross-initial and -intermediate, by changing
>>> MULTIMACH_TARGET_SYS to install the files into new locations; 2) Fix
>>> the build of eglibc-initial, eglibc by using the appropriate
>>> compilers, libs, headers; 3) Also make proper changes for the
>>> crosssdk/nativesdk version. 
>>> 
>>> I've split all the changes into small git commits and each commit
>>> should be basically self-explanatory. :-)
>> 
>> I've had a look through this and experimented a little with the code
>> and I've some feedback:
> Hi Richard, thanks very much for the review and feedback!
> BTW: I was just about to send out my "RFC v5" patches and I saw the
> mail. :-) 
> 
> During the past days, I've been busy with testing and fixing &
> updating my patches. 
> The v5 patches are at 
> http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/log/?h=dcui/tcbp-v5
> (actually it's the same as dcui/tcbp-test currently) The attached
> v3-to-v5.diff shows the difference from v3 to v5:  
> 
> 1) fix several typos for  "_prepend_virtclass-nativesdk": previously
> I used the wrong "_virtclass-nativesdk_prepend"! 
> 
> 2) in eglibc-initial.inc, now the line is
> STAGING_BINDIR_TOOLCHAIN_prepend =
> "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-initial:"
> Previously, I used HOST_SYS rather than BASEPKG_HOST_SYS.  Actually
> HOST_SYS is not ok because this breaks arm/ppc builds. 
> 
> 3) similarly,
> 	in eglibc.inc:
> 		STAGING_BINDIR_TOOLCHAIN_prepend: HOST_SYS --> BASEPKG_HOST_SYS
> 		CPPFLAGS_prepend: TARGET_SYS -> BASEPKG_TARGET_SYS
> 	in gcc-cross-intermediate.inc:
> 		GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT: TARGET_SYS -->
> BASEPKG_TARGET_SYS 
> 
> 4)  in eglibc-initial.inc:
> 	use a "for t in ..." loop to replace the previous 3 statements.
> 
> 5) add the code for glibc and glibc-initial similarly.
> 6) bump PRs accordingly.
> 
> I'll send my current test results later.
My testing for tcbp-v5  is still not finished, but here I'd like to share the current status:

The latest master (070b7ee3,  package_deb: Remove access to ...) is not stable: e.g,. pseudo issues, package-output.lock issue(this was fixed by RP 3 hours ago).
So I used a slightly old commit 740ea682(poky-init-build-env: unset BBPATH) as a "Base Build"(without my patches), and also do new build with my patches(My Build).

1) For all qemu targets(x86, x86-64, mips, ppc, arm) , My Build (bitbake poky-image-sdk) can build fine and can boot to sato GUI (except ppc that has not GUI). I checked the list of files in each qemu target's rootfs and can verify the list is the same as  that in a Base Build; Inside qemu targets, I tried to run gcc/g++ to build simple C/C++ code and everything works fine.

2) I can also verify My Build(bitbake meta-toolchain-sdk) can build fine.
   A KNOWN issue: aftar "tar -jxf" the .bz2 file and "source environment-setup-*, I got the error when running "${CC}":
[root@dcui-desktop 0.9+snapshot]# ${CC}
Inconsistency detected by ld.so: dynamic-link.h: 209: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

I'm trying to fix this asap -- looks eglibc-nativesdk is not built ok???

Thanks,
-- Dexuan


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

* Re: [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
  2011-01-24 17:28   ` Cui, Dexuan
  2011-01-24 17:55     ` Cui, Dexuan
@ 2011-01-24 19:17     ` Chris Larson
  2011-01-25  0:53     ` Richard Purdie
  2 siblings, 0 replies; 16+ messages in thread
From: Chris Larson @ 2011-01-24 19:17 UTC (permalink / raw)
  To: Cui, Dexuan; +Cc: poky

On Mon, Jan 24, 2011 at 10:28 AM, Cui, Dexuan <dexuan.cui@intel.com> wrote:
>>
>>   gcc-cross-initial, gcc-crosssdk-initial: change
>> CROSS_TARGET_SYS_DIR and insall into new locations
>>
>> This change is ok but its incomplete. Why? If I apply this change and
>> try a build, things won't work as it needs bits from later commits. To
> I split my changes into small commits for easy review. Sorry, I didn't try to ensure every commit should be buildable. :-)

Note that in general, keeping things buildable through the history is
important for bisectability (assuming, of course, that this is a
priority for poky -- I'm not certain about that).  The more places
where it won't build, the more commits have to be skipped when
attempting to isolate a real problem.  I'd suggest using the git
test-sequence script (see google) to sanity check a branch before
requesting a merge.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
  2011-01-24 17:28   ` Cui, Dexuan
  2011-01-24 17:55     ` Cui, Dexuan
  2011-01-24 19:17     ` Chris Larson
@ 2011-01-25  0:53     ` Richard Purdie
  2 siblings, 0 replies; 16+ messages in thread
From: Richard Purdie @ 2011-01-25  0:53 UTC (permalink / raw)
  To: Cui, Dexuan; +Cc: poky

On Tue, 2011-01-25 at 01:28 +0800, Cui, Dexuan wrote:
> Richard Purdie wrote:
> > On Tue, 2011-01-18 at 21:57 +0800, Dexuan Cui wrote:
> Hi Richard, thanks very much for the review and feedback!
> BTW: I was just about to send out my "RFC v5" patches and I saw the mail. :-)
> 
> During the past days, I've been busy with testing and fixing & updating my patches.
> The v5 patches are at  http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/log/?h=dcui/tcbp-v5 (actually it's the same as dcui/tcbp-test currently)
> The attached v3-to-v5.diff shows the difference from v3 to v5:
> 
> 1) fix several typos for  "_prepend_virtclass-nativesdk": previously I used the wrong "_virtclass-nativesdk_prepend"!
> 
> 2) in eglibc-initial.inc, now the line is 
> STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-initial:"
> Previously, I used HOST_SYS rather than BASEPKG_HOST_SYS.  Actually HOST_SYS is not ok because this breaks arm/ppc builds.
> 
> 3) similarly,
> 	in eglibc.inc: 
> 		STAGING_BINDIR_TOOLCHAIN_prepend: HOST_SYS --> BASEPKG_HOST_SYS
> 		CPPFLAGS_prepend: TARGET_SYS -> BASEPKG_TARGET_SYS
> 	in gcc-cross-intermediate.inc:
> 		GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT: TARGET_SYS --> BASEPKG_TARGET_SYS
> 
> 4)  in eglibc-initial.inc:
> 	use a "for t in ..." loop to replace the previous 3 statements.
> 
> 5) add the code for glibc and glibc-initial similarly.
> 6) bump PRs accordingly.
> 
> I'll send my current test results later.

Sounds good.

I did a bit of research and experimentation with your remaining changes
and came up with the hybrid you can see here:

http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/tt-bootstrap&id=bba04b790b0454e8bf2de8ea5a9d610e81f0a278

This is actually very similar to what you've done but I made a few
tweaks to try and improve the way it works.

Firstly instead of overloading the /lib and /usr/lib directories, I just
created a "bootstrap" sysroot, STAGING_DIR_TCBOOTSTRAP.

eglibc-initial then stages into that sysroot, as per your changes.

I then made gcc-cross-intermediate use this as both the build *and*
installation sysroot since its files don't conflict with those from
eglibc-initial.

We can then easily point eglibc to build against the bootstrap sysroot
using TOOLCHAIN_OPTIONS but install into the target.

Looking back at my patch, the change to make gcc-configure-cross.inc use
the bootstrap sysroot might not be correct, it should likely use the
libc from the main sysroot by that point.

The biggest problem I found was the sitecache.bbclass function in eglibc
as this wanted to run configure to be able to compile things yet we
don't populate the sysroot at that point so the intermediate compiler
won't fully work as it can't find a libc. I added a horrendous hack to
fudge this piece into working. A neater solution would be nice, I'm
still working on that but I'm not too optimistic.

Could you take a look at these changes and see what you think? There are
still a few details that need to be ironed out but I think it could
work.

Cheers,

Richard






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

end of thread, other threads:[~2011-01-25  0:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 13:57 [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Dexuan Cui
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 1/7] sstate.bbclass: allow each step of toolchain bootstrap processes to do populate_sysroot independently Dexuan Cui
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 2/7] cross.bbclass: make MULTIMACH_TARGET_SYS adjustable for bindir, libdir, libexecdir Dexuan Cui
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 3/7] gcc-cross-initial, gcc-crosssdk-initial: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
2011-01-18 14:58   ` Koen Kooi
2011-01-19  9:06     ` Cui, Dexuan
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 4/7] eglibc-initial, eglibc-initial-nativesdk: install into individual sysroots Dexuan Cui
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 5/7] gcc-cross-intermediate, gcc-crosssdk-intermediate: change CROSS_TARGET_SYS_DIR and insall into new locations Dexuan Cui
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 6/7] cross.bbclass: modify sysroot_stage_all to allow gcc-{cross, crossdk}-intermediate to populate the libgcc_s.so* files Dexuan Cui
2011-01-18 13:57 ` [RFC: enhance toolchain bootstrap process: v3: 7/7] eglibc, eglibc-nativesdk: fix the build due to changes to eglibc-initial and gcc-cross-intermediate Dexuan Cui
2011-01-18 16:20   ` Tian, Kevin
2011-01-24 16:04 ` [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process Richard Purdie
2011-01-24 17:28   ` Cui, Dexuan
2011-01-24 17:55     ` Cui, Dexuan
2011-01-24 19:17     ` Chris Larson
2011-01-25  0:53     ` 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.