From a1ef15a14388ab578f56afe646d4d2eaa47e1bbf Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Mon, 2 Jun 2014 16:22:59 -0400 Subject: [PATCH 1/9] external-sourcery-toolchain: Fix installation of lib/locale. Signed-off-by: Drew Moseley --- recipes/meta/external-sourcery-toolchain.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/meta/external-sourcery-toolchain.bb b/recipes/meta/external-sourcery-toolchain.bb index b494f24..9d1d316 100644 --- a/recipes/meta/external-sourcery-toolchain.bb +++ b/recipes/meta/external-sourcery-toolchain.bb @@ -42,7 +42,7 @@ do_install() { cp -a $usr_path ${D}/usr/ fi done - if [ "${base_libdir}" != "lib" ]; then + if [ "${base_libdir}" != "/lib" ]; then if [ -d $sysroot/usr/lib/locale ]; then install -d ${D}/usr/lib cp -a $sysroot/usr/lib/locale ${D}/usr/lib/ From 70f38570fb9cb6724aa08f6bcc5b1e0eb9238137 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Mon, 2 Jun 2014 16:23:52 -0400 Subject: [PATCH 2/9] external-sourcery-toolchain: Package libinproctrace library. Signed-off-by: Drew Moseley --- recipes/meta/external-sourcery-toolchain.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/meta/external-sourcery-toolchain.bb b/recipes/meta/external-sourcery-toolchain.bb index 9d1d316..001a2f2 100644 --- a/recipes/meta/external-sourcery-toolchain.bb +++ b/recipes/meta/external-sourcery-toolchain.bb @@ -144,6 +144,7 @@ TC_PACKAGES =+ "libasan libasan-dev" TC_PACKAGES =+ "libtsan libtsan-dev" TC_PACKAGES =+ "libitm libitm-dev" TC_PACKAGES =+ "libatomic libatomic-dev" +TC_PACKAGES =+ "libinproctrace" TC_PACKAGES =+ "${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', PN, 'linux-libc-headers linux-libc-headers-dev', '', d)}" TC_PACKAGES =+ "${@base_conditional('PREFERRED_PROVIDER_oprofile', PN, 'oprofile oprofile-doc', '', d)}" TC_PACKAGES =+ "${@base_conditional('PREFERRED_PROVIDER_popt', PN, 'popt popt-dev', '', d)}" @@ -162,6 +163,7 @@ FILES_libasan = "${libdir}/libasan.so.*" FILES_libasan-dev = "${libdir}/libasan.so" FILES_libatomic = "${libdir}/libatomic.so.*" FILES_libatomic-dev = "${libdir}/libatomic.so" +FILES_libinproctrace = "${libdir}/libinproctrace.so" FILES_oprofile = "${bindir}/op* ${datadir}/oprofile ${libdir}/oprofile ${datadir}/stl.pat" FILES_oprofile-doc = "${mandir}/man1/oprofile* ${docdir}/oprofile" FILES_${PN}-dbg += "${bindir}/.debug/op*" @@ -209,6 +211,7 @@ INSANE_SKIP_${PN}-utils += "ldflags" INSANE_SKIP_libgcc += "ldflags" INSANE_SKIP_libasan += "ldflags" INSANE_SKIP_libatomic += "ldflags" +INSANE_SKIP_libinproctrace += "ldflags" INSANE_SKIP_libgomp += "ldflags" INSANE_SKIP_libitm += "ldflags" INSANE_SKIP_libquadmath += "ldflags" @@ -237,6 +240,7 @@ PKGV_libstdc++-dev = "${CSL_VER_GCC}" PKGV_libstdc++-staticdev = "${CSL_VER_GCC}" PKGV_libtsan = "${CSL_VER_GCC}" PKGV_libtsan-dev = "${CSL_VER_GCC}" +PKGV_libinproctrace = "${CSL_VER_GCC}" PKGV_gdbserver = "${CSL_VER_GDB}" PKGV_gdbserver-dbg = "${CSL_VER_GDB}" From 5835fd1adb7425c02813fbb8d2838c8177ebaefc Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Tue, 10 Jun 2014 19:24:51 -0400 Subject: [PATCH 3/9] external-sourcery-toolchain: Error out if libc.so does not exist Depending on the external toolchain config, the libc.so file may not exist. This generally means that the machine config does not have multi-lib support when it should. Rather than letting the "sed" command error out with a cryptic message, issue a (hopefully) more meaningful message. Signed-off-by: Drew Moseley --- recipes/meta/external-sourcery-toolchain.bb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/meta/external-sourcery-toolchain.bb b/recipes/meta/external-sourcery-toolchain.bb index 001a2f2..c963f2b 100644 --- a/recipes/meta/external-sourcery-toolchain.bb +++ b/recipes/meta/external-sourcery-toolchain.bb @@ -73,6 +73,12 @@ do_install() { ln -s ../../bin/gdbserver ${D}${libdir}/bin/sysroot-gdbserver fi + if [ ! -e ${D}${libdir}/libc.so ]; then + bbfatal "Unable to locate installed libc.so file (${D}${libdir}/libc.so)." \ + "This may mean that your external toolchain uses a different" \ + "multi-lib setup than your machine configuration" + fi + sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libc.so sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so From b4493e0236657134ba00fa707dd09fa29103af9f Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 13 Jun 2014 10:16:25 -0700 Subject: [PATCH 4/9] tcmode: use /tmp/sourcery-$LOGNAME for TMPDIR Work around the bad interaction between cs-license and pseudo by shoving all the temporary files into a subdir by the user's original logname. JIRA: SB-1905 Signed-off-by: Christopher Larson --- .../include/tcmode-external-sourcery.inc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 17cc5de..ca4405e 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -154,17 +154,23 @@ def populate_toolchain_links(d): if not files: bb.fatal("Unable to populate toolchain binary symlinks in %s" % pattern) + + origenv = d.getVar('BB_ORIGENV', False) + logname = origenv.get('LOGNAME', 'unknown') + tmpdir = os.path.join(origenv.get('TMPDIR', '/tmp'), 'sourcery-%s' % logname) + bb.utils.mkdirhier(tmpdir) + bindir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True) bb.utils.mkdirhier(bindir) for f in files: base = os.path.basename(f) newpath = os.path.join(bindir, base) - try: - os.symlink(f, newpath) - except OSError as exc: - if exc.errno == errno.EEXIST: - break - bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc)) + if not os.path.exists(newpath): + with open(newpath, 'w') as new: + new.write('#!/bin/sh\n') + new.write('export TMPDIR="{0}"\n'.format(tmpdir)) + new.write('exec "{0}" "$@"\n'.format(f)) + os.fchmod(new.fileno(), 0755) # Ensure that we have a ld.bfd available, now that KERNEL_LD uses it ld = d.expand('${TARGET_PREFIX}ld') From 0bae35014824725e89e6b48a817d06254a11ff65 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 17 Jun 2014 09:48:14 -0700 Subject: [PATCH 5/9] tcmode: don't use BB_HASHBASE_WHITELIST_append Currently, bitbake isn't always using the finalized configuration metadata to get the value of this variable, so the _append isn't always applied. JIRA: MEIBPADIT-811 Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index ca4405e..1611c42 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -99,7 +99,6 @@ TUNE_LDARGS += "${@'-m ${LDEMULATION}' if LDEMULATION else ''}" # Ensure that the licensing variables are available to the toolchain. export MGLS export LM_LICENSE_FILE -BB_HASHBASE_WHITELIST_append = " MGLS LM_LICENSE_FILE" # Unfortunately, the CSL ia32 toolchain has non-prefixed binaries in its # bindir (e.g. gcc, ld). To avoid this messing up our build, we avoid adding @@ -111,6 +110,9 @@ python toolchain_metadata_setup () { import subprocess d = e.data + # Ensure that changes to toolchain licensing don't affect checksums + d.appendVar('BB_HASHBASE_WHITELIST', ' MGLS LM_LICENSE_FILE') + l = d.createCopy() l.finalize() oe_import(l) From 77186ca4b7ffd1662387e65c79fc97f2d7ed141f Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Mon, 23 Jun 2014 09:53:12 -0700 Subject: [PATCH 6/9] boot-format: obey LDFLAGS Quiets a GNU_HASH warning. JIRA: SB-3120 Signed-off-by: Christopher Larson --- .../boot-format/boot-format/flags.patch | 21 +++++++++++++++++++ .../boot-format/boot-format_git.bbappend | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 fsl-ppc/recipes-tools/boot-format/boot-format/flags.patch create mode 100644 fsl-ppc/recipes-tools/boot-format/boot-format_git.bbappend diff --git a/fsl-ppc/recipes-tools/boot-format/boot-format/flags.patch b/fsl-ppc/recipes-tools/boot-format/boot-format/flags.patch new file mode 100644 index 0000000..cddb34c --- /dev/null +++ b/fsl-ppc/recipes-tools/boot-format/boot-format/flags.patch @@ -0,0 +1,21 @@ +Index: git/Makefile +=================================================================== +--- git.orig/Makefile ++++ git/Makefile +@@ -3,14 +3,14 @@ + INSTALL=install + PREFIX=/usr + +-CFLAGS=-Wall ++override CFLAGS+=-Wall + + all: boot_format + + boot_format.o: boot_format.c boot_format.h + + boot_format: boot_format.o +- $(CC) $< -o $@ ++ $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) + + install: boot_format + $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin diff --git a/fsl-ppc/recipes-tools/boot-format/boot-format_git.bbappend b/fsl-ppc/recipes-tools/boot-format/boot-format_git.bbappend new file mode 100644 index 0000000..63fc5d0 --- /dev/null +++ b/fsl-ppc/recipes-tools/boot-format/boot-format_git.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/boot-format:" +SRC_URI += "file://flags.patch" +EXTRA_OEMAKE += "'CFLAGS=${CFLAGS}' 'LDFLAGS=${LDFLAGS}'" From b54e2f2e0dd8bdb5d92356911f6e4be865900957 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Mon, 23 Jun 2014 10:32:02 -0700 Subject: [PATCH 7/9] ossp-uuid: obey LDFLAGS Quiets a GNU_HASH warning. JIRA: SB-3120 Signed-off-by: Christopher Larson --- .../ossp-uuid/ossp-uuid/ldflags.patch | 23 +++++++++++++++++++ .../ossp-uuid/ossp-uuid_1.6.2.bbappend | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 core/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch create mode 100644 core/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bbappend diff --git a/core/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch b/core/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch new file mode 100644 index 0000000..a4cb455 --- /dev/null +++ b/core/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch @@ -0,0 +1,23 @@ +Index: uuid-1.6.2/Makefile.in +=================================================================== +--- uuid-1.6.2.orig/Makefile.in ++++ uuid-1.6.2/Makefile.in +@@ -113,15 +113,15 @@ all: $(TARGETS) + @$(LIBTOOL) --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< + + $(LIB_NAME): $(LIB_OBJS) +- @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \ ++ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \ + -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h` + + $(DCE_NAME): $(DCE_OBJS) +- @$(LIBTOOL) --mode=link $(CC) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \ ++ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \ + -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h` + + $(CXX_NAME): $(CXX_OBJS) +- @$(LIBTOOL) --mode=link $(CXX) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \ ++ @$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \ + -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h` + + $(PRG_NAME): $(PRG_OBJS) $(LIB_NAME) diff --git a/core/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bbappend b/core/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bbappend new file mode 100644 index 0000000..0c77414 --- /dev/null +++ b/core/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +SRC_URI += "file://ldflags.patch" From 54aa4e259d24647a3e7bc309c9c01aeca23f42e4 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Mon, 23 Jun 2014 10:41:06 -0700 Subject: [PATCH 8/9] testfloat: obey LDFLAGS Quiets a GNU_HASH warning. JIRA: SB-3120 Signed-off-by: Christopher Larson --- .../testfloat/testfloat/ldflags.patch | 11 +++++++++++ .../recipes-extended/testfloat/testfloat_2a.bbappend | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 fsl-ppc/recipes-extended/testfloat/testfloat/ldflags.patch create mode 100644 fsl-ppc/recipes-extended/testfloat/testfloat_2a.bbappend diff --git a/fsl-ppc/recipes-extended/testfloat/testfloat/ldflags.patch b/fsl-ppc/recipes-extended/testfloat/testfloat/ldflags.patch new file mode 100644 index 0000000..0994610 --- /dev/null +++ b/fsl-ppc/recipes-extended/testfloat/testfloat/ldflags.patch @@ -0,0 +1,11 @@ +--- TestFloat-2a/testfloat/powerpc-linux-gcc/Makefile ++++ TestFloat-2a/testfloat/powerpc-linux-gcc/Makefile +@@ -14,7 +14,7 @@ COMPILE_C_HARD = $(CC) -c -o $@ $(INCLUD + + COMPILE_SLOWFLOAT_C = $(CC) -c -o $@ $(INCLUDES) -I- -O + +-LINK = $(CC) -lm -o $@ ++LINK = $(CC) -lm -o $@ $(LDFLAGS) + + SOFTFLOAT_H = $(SOFTFLOAT_DIR)/softfloat.h + SOFTFLOAT_OBJ = $(SOFTFLOAT_DIR)/softfloat$(OBJ) diff --git a/fsl-ppc/recipes-extended/testfloat/testfloat_2a.bbappend b/fsl-ppc/recipes-extended/testfloat/testfloat_2a.bbappend new file mode 100644 index 0000000..c213fda --- /dev/null +++ b/fsl-ppc/recipes-extended/testfloat/testfloat_2a.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +SRC_URI_append_fslmachine = " file://ldflags.patch" From c9829b9baa40bc3cd41e532cbdc556f238a07299 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 24 Jun 2014 14:58:07 -0700 Subject: [PATCH 9/9] tcmode: obey MGLS_LICENSE_FILE, not MGLS JIRA: SB-3112 Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 1611c42..9f51654 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -97,7 +97,7 @@ LDEMULATION_mips64 = "elf${LDEMULATION_BITS}${LDEMULATION_ENDIAN}smip${@bb.utils TUNE_LDARGS += "${@'-m ${LDEMULATION}' if LDEMULATION else ''}" # Ensure that the licensing variables are available to the toolchain. -export MGLS +export MGLS_LICENSE_FILE export LM_LICENSE_FILE # Unfortunately, the CSL ia32 toolchain has non-prefixed binaries in its @@ -111,7 +111,7 @@ python toolchain_metadata_setup () { d = e.data # Ensure that changes to toolchain licensing don't affect checksums - d.appendVar('BB_HASHBASE_WHITELIST', ' MGLS LM_LICENSE_FILE') + d.appendVar('BB_HASHBASE_WHITELIST', ' MGLS_LICENSE_FILE LM_LICENSE_FILE') l = d.createCopy() l.finalize()