package.bbclass: Fix handling of symlinks in debug packages
PATCH 1/28 package.bbclass: Fix handling of symlinks in debug packages
When copying the sources for the debug source package we use cpio -Ll which means to copy files as hardlinks and to dereference symlinks. It appears there is a bug in cpio since -Ll will copy symlinks and not dereference them. We therefore do a second pass over copied symlinks resolving them into files. Ideally we would copy these as hardlinks as well however it doesn't seem worth the extra code and effort for what amounts to a corner case for a minor space improvement.
This means that the -dbg packages no longer contain broken symlinks.
[YOCTO #5020]
--- meta/classes/package.bbclass | 6 ++++++ 1 file changed, 6 insertions(+)
meta/classes/package.bbclass +6 -0
@@ -316,6 +316,12 @@ def copydebugsources(debugsrcdir, d): #if retval: # bb.fatal("debug source copy failed with exit code %s (cmd was %s)" % (retval, cmd)) + # cpio seems to have a bug with -lL together and symbolic links are just copied, not dereferenced. + # Work around this by manually finding and copying any symbolic links that made it through. + cmd = "find %s%s -type l -print0 -delete | sed s#%s%s/##g | (cd '%s' ; cpio -pd0mL --no-preserve-owner '%s%s' 2>/dev/null)" % (dvar, debugsrcdir, dvar, debugsrcdir, workparentdir, dvar, debugsrcdir) + (retval, output) = oe.utils.getstatusoutput(cmd) + if retval: + bb.fatal("debugsrc symlink fixup failed with exit code %s (cmd was %s)" % (retval, cmd)) # The copy by cpio may have resulted in some empty directories! Remove these cmd = "find %s%s -empty -type d -delete" % (dvar, debugsrcdir)
Signature · 1 line
1.8.1.2
PATCH 2/28 crosssdk: Construct target_exec_prefix from prefix_nativesdk
${exec_prefix_nativesdk} doesn't exist so use prefix_nativesdk instead. This resolves issues for code which attepts to use target_exec_prefix.
--- meta/classes/crosssdk.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/crosssdk.bbclass +1 -1
@@ -23,7 +23,7 @@ target_libdir = "${SDKPATHNATIVE}${libdir_nativesdk}" target_includedir = "${SDKPATHNATIVE}${includedir_nativesdk}" target_base_libdir = "${SDKPATHNATIVE}${base_libdir_nativesdk}" target_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}" -target_exec_prefix = "${SDKPATHNATIVE}${exec_prefix_nativesdk}" +target_exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}" baselib = "lib" do_populate_sysroot[stamp-extra-info] = ""
Signature · 1 line
1.8.1.2
PATCH 3/28 populate_sdk_base: Allow sdk tar options to be overridden
In reply to Richard PurdieIt can be useful to override or append options to the SDK tarball creation command so add a variable to allow this.
--- meta/classes/populate_sdk_base.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/populate_sdk_base.bbclass +3 -1
@@ -108,11 +108,13 @@ fakeroot create_sdk_files() { sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py } +SDKTAROPTS = "--owner=root --group=root -j" + fakeroot tar_sdk() { # Package it up mkdir -p ${SDK_DEPLOY} cd ${SDK_OUTPUT}/${SDKPATH} - tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . + tar ${SDKTAROPTS} -c --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . } fakeroot create_shar() {
Signature · 1 line
1.8.1.2
PATCH 4/28 gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian
In reply to Richard PurdieThe gettext handling of USE_NLS has become a bit tricky to understand, or alter from the SDK context. This patch introduces a SDKUSE_NLS which can be set to configure a given SDK/ADT to use NLS or not. This is independent of the target system NLS usage.
The code in gettext.bbclass is therefore simplified and the classes themselves now set USE_NLS to appropriate values. No NLS is used for native, cross and crosssdk since it is never used there and would just increase build time.
--- meta/classes/cross-canadian.bbclass | 2 ++ meta/classes/cross.bbclass | 2 ++ meta/classes/crosssdk.bbclass | 2 ++ meta/classes/gettext.bbclass | 8 +++----- meta/classes/native.bbclass | 2 ++ meta/classes/nativesdk.bbclass | 2 ++ meta/conf/bitbake.conf | 1 + 7 files changed, 14 insertions(+), 5 deletions(-)
meta/classes/cross-canadian.bbclass +2 -0
@@ -94,3 +94,5 @@ SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/ SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/" do_populate_sysroot[stamp-extra-info] = "" + +USE_NLS = "${SDKUSE_NLS}"
meta/classes/cross.bbclass +2 -0
@@ -75,3 +75,5 @@ cross_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" do_install () { oe_runmake 'DESTDIR=${D}' install } + +USE_NLS = "no"
meta/classes/crosssdk.bbclass +2 -0
@@ -30,3 +30,5 @@ do_populate_sysroot[stamp-extra-info] = "" # Need to force this to ensure consitency accross architectures EXTRA_OECONF_FPU = "" + +USE_NLS = "no"
meta/classes/gettext.bbclass +3 -5
@@ -1,17 +1,15 @@ def gettext_dependencies(d): - if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d, 'native', 'nativesdk', 'cross'): - return "" if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'): return "" - if oe.utils.inherits(d, 'native', 'cross'): + if d.getVar('USE_NLS', True) == 'no': return "gettext-minimal-native" return d.getVar('DEPENDS_GETTEXT', False) def gettext_oeconf(d): - if oe.utils.inherits(d, 'native', 'cross'): + if d.getVar('USE_NLS', True) == 'no': return '--disable-nls' # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set - if (d.getVar('USE_NLS', True) == 'no' or d.getVar('INHIBIT_DEFAULT_DEPS', True)) and not oe.utils.inherits(d, 'nativesdk', 'cross-canadian'): + if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'): return '--disable-nls' return "--enable-nls"
meta/classes/native.bbclass +2 -0
@@ -158,3 +158,5 @@ do_package_write_deb[noexec] = "1" do_package_write_rpm[noexec] = "1" do_populate_sysroot[stamp-extra-info] = "" + +USE_NLS = "no"
meta/classes/nativesdk.bbclass +2 -0
@@ -89,3 +89,5 @@ addhandler nativesdk_virtclass_handler nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" do_populate_sysroot[stamp-extra-info] = "" + +USE_NLS = "${SDKUSE_NLS}"
meta/conf/bitbake.conf +1 -0
@@ -110,6 +110,7 @@ TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}" LIBCEXTENSION ??= "" ABIEXTENSION ??= "" USE_NLS ??= "yes" +SDKUSE_NLS ??= "yes" TARGET_ARCH = "${TUNE_ARCH}" TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
Signature · 1 line
1.8.1.2
PATCH 5/28 libiconv: Extend to nativesdk and support non-linux targets
In reply to Richard PurdieThis library is currently only available when targeting non-libc. This patch also makes it available when targetting non-linux since it is likely of use then.
It also adds a BBCLASSEXTEND for nativesdk since again, it can be useful in that context.
--- meta/recipes-support/libiconv/libiconv_1.14.bb | 4 ++++ 1 file changed, 4 insertions(+)
meta/recipes-support/libiconv/libiconv_1.14.bb +4 -0
@@ -22,6 +22,8 @@ S = "${WORKDIR}/libiconv-${PV}" inherit autotools pkgconfig gettext python __anonymous() { + if d.getVar("TARGET_OS", True) != "linux": + return if d.getVar("TCLIBC", True) == "eglibc": raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - eglibc already provides iconv") }
@@ -44,3 +46,5 @@ do_install_append () { rm -rf ${D}${libdir}/preloadable_libiconv.so rm -rf ${D}${libdir}/charset.alias } + +BBCLASSEXTEND = "nativesdk"
Signature · 1 line
1.8.1.2
PATCH 6/28 gcc-cross-canadian-4.8: Enable PARALLEL_MAKE
In reply to Richard PurdieThis disabling of PARALLEL_MAKE has been forward ported for gcc-cross-canadian since at least 2009-09 and gcc 4.3.3, probably older.
I've tested this with high values of parallel make and it all seems to work and we usually build gcc with parallel make so it seems unlikely there are issues. Lets therefore enable it.
--- meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 2 -- 1 file changed, 2 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb +0 -2
@@ -20,7 +20,5 @@ EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ # to find libmpfr # export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}" -PARALLEL_MAKE = "" - # gcc 4.7 needs -isystem export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
Signature · 1 line
1.8.1.2
PATCH 7/28 gcc-package-sdk.inc: Use relative symlinks in libexec dir
In reply to Richard PurdieWe already use relative links for other gcc libexec links, this changes the sdk do_install to match elsewhere and use relative symlinks too. This makes things slightly easier in the SDK installation process and standardises.
--- meta/recipes-devtools/gcc/gcc-package-sdk.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-package-sdk.inc +4 -1
@@ -28,6 +28,9 @@ FILES_${PN}-doc = "\ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ " +# Compute how to get from libexecdir to bindir in python (easier than shell) +BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}" + do_install () { oe_runmake 'DESTDIR=${D}' install-host
@@ -64,7 +67,7 @@ do_install () { continue fi - ln -sf ${bindir}/${TARGET_PREFIX}$t $dest$t + ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t done chown -R root:root ${D}
Signature · 1 line
1.8.1.2
PATCH 8/28 gcc-package-sdk.inc: Allow executable extension to be overridden
In reply to Richard PurdieOn platforms like windows, executables have extensions. Whilst I'm not proposing we wholesale support windows extensions, this small tweak allows a cross compiler targetting mingw to be built which does seem like a good use case.
The patch therefore adds an EXEEXT which the mingw layer can set for the libexec symlinks.
--- meta/recipes-devtools/gcc/gcc-package-sdk.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
meta/recipes-devtools/gcc/gcc-package-sdk.inc +5 -2
@@ -28,6 +28,8 @@ FILES_${PN}-doc = "\ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ " +EXEEXT = "" + # Compute how to get from libexecdir to bindir in python (easier than shell) BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}"
@@ -62,12 +64,13 @@ do_install () { # found. dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ install -d $dest + suffix=${EXEEXT} for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do - if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t ]; then + if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then continue fi - ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t + ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix done chown -R root:root ${D}
Signature · 1 line
1.8.1.2
PATCH 9/28 gcc-configure-sdk.inc: Don't build target-libgcc
In reply to Richard PurdieI don't understand why we're building the target libgcc in the canadian-cross build since it should have been built elsewhere. The compiler configuration isn't correct to build a working target libgcc in all cases anyway.
To avoid various weird build errors, stop building it.
--- meta/recipes-devtools/gcc/gcc-configure-sdk.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-configure-sdk.inc +1 -1
@@ -43,5 +43,5 @@ do_configure () { } do_compile () { - oe_runmake all-host all-target-libgcc + oe_runmake all-host }
Signature · 1 line
1.8.1.2
PATCH 10/28 gcc: Drop gcc-cross4.inc, its pointless now
In reply to Richard PurdieThe include was useful historically, its not anymore so lets remove it. This should have no functional change except on any layers directly depending on it or gcc-cross.inc but even then it would only impact sh4 and is easily fixed if there was a problem.
--- meta/recipes-devtools/gcc/gcc-cross.inc | 2 ++ meta/recipes-devtools/gcc/gcc-cross4.inc | 3 --- meta/recipes-devtools/gcc/gcc-cross_4.7.bb | 2 +- meta/recipes-devtools/gcc/gcc-cross_4.8.bb | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 meta/recipes-devtools/gcc/gcc-cross4.inc
meta/recipes-devtools/gcc/gcc-cross.inc +2 -0
@@ -106,3 +106,5 @@ STOP chmod +x ${B}/${TARGET_PREFIX}testgcc } + +EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
meta/recipes-devtools/gcc/gcc-cross4.inc deleted +0 -3
@@ -1,3 +0,0 @@ -require gcc-cross.inc - -EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
meta/recipes-devtools/gcc/gcc-cross_4.7.bb +1 -1
@@ -1,5 +1,5 @@ require recipes-devtools/gcc/gcc-${PV}.inc -require gcc-cross4.inc +require gcc-cross.inc EXTRA_OECONF += "--disable-libunwind-exceptions \ --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
meta/recipes-devtools/gcc/gcc-cross_4.8.bb +1 -1
@@ -1,5 +1,5 @@ require recipes-devtools/gcc/gcc-${PV}.inc -require gcc-cross4.inc +require gcc-cross.inc EXTRA_OECONF += "--disable-libunwind-exceptions \ --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
Signature · 1 line
1.8.1.2
PATCH 11/28 gcc-cross-canadian-4.8: Allow elfutils to be a configurable dependency
In reply to Richard PurdieSome SDK platforms have elfutils support, some do not, therefore allow this to be configured.
--- meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb +3 -2
@@ -5,8 +5,9 @@ require gcc-cross-canadian.inc require gcc-configure-sdk.inc require gcc-package-sdk.inc -DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils" -RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils" +ELFUTILS = "nativesdk-elfutils" +DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" +RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" SYSTEMHEADERS = "/usr/include" SYSTEMLIBS = "${target_base_libdir}/"
Signature · 1 line
1.8.1.2
PATCH 12/28 gcc-cross-canadian-4.8: Add missing dependency on nativesdk-zlib
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb +1 -1
@@ -6,7 +6,7 @@ require gcc-configure-sdk.inc require gcc-package-sdk.inc ELFUTILS = "nativesdk-elfutils" -DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" +DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" SYSTEMHEADERS = "/usr/include"
Signature · 1 line
1.8.1.2
PATCH 13/28 gcc-cross-canadian: Merge 4.7 and 4.8 recipes into common include
In reply to Richard PurdieThis removes duplication and follows the pattern of the other gcc recipes.
--- meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 19 ++++++++++++++++++ .../recipes-devtools/gcc/gcc-cross-canadian_4.7.bb | 23 ---------------------- .../recipes-devtools/gcc/gcc-cross-canadian_4.8.bb | 20 ------------------- 3 files changed, 19 insertions(+), 43 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +19 -0
@@ -7,3 +7,22 @@ BPN = "gcc" DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext" GCCMULTILIB = "--enable-multilib" + +require gcc-configure-sdk.inc +require gcc-package-sdk.inc + +ELFUTILS = "nativesdk-elfutils" +DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" +RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" + +SYSTEMHEADERS = "/usr/include" +SYSTEMLIBS = "${target_base_libdir}/" +SYSTEMLIBS1 = "${target_libdir}/" + +EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ + --disable-libgomp --disable-libmudflap \ + --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \ + --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}" + +# gcc 4.7 needs -isystem +export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
meta/recipes-devtools/gcc/gcc-cross-canadian_4.7.bb +0 -23
@@ -1,26 +1,3 @@ -inherit cross-canadian - require recipes-devtools/gcc/gcc-${PV}.inc require gcc-cross-canadian.inc -require gcc-configure-sdk.inc -require gcc-package-sdk.inc - -DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils" -RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc nativesdk-elfutils" - -SYSTEMHEADERS = "/usr/include" -SYSTEMLIBS = "${target_base_libdir}/" -SYSTEMLIBS1 = "${target_libdir}/" - -EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ - --disable-libgomp --disable-libmudflap \ - --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \ - --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}" - -# to find libmpfr -# export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}" - -PARALLEL_MAKE = "" -# gcc 4.7 needs -isystem -export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb +0 -20
@@ -1,25 +1,5 @@ -inherit cross-canadian - require recipes-devtools/gcc/gcc-${PV}.inc require gcc-cross-canadian.inc -require gcc-configure-sdk.inc -require gcc-package-sdk.inc - -ELFUTILS = "nativesdk-elfutils" -DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" -RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" - -SYSTEMHEADERS = "/usr/include" -SYSTEMLIBS = "${target_base_libdir}/" -SYSTEMLIBS1 = "${target_libdir}/" -EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \ - --disable-libgomp --disable-libmudflap \ - --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \ - --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}" -# to find libmpfr -# export LD_LIBRARY_PATH = "{STAGING_DIR_HOST}${layout_exec_prefix}" -# gcc 4.7 needs -isystem -export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
Signature · 1 line
1.8.1.2
PATCH 14/28 Revert "nativesdk: inherit relocatable"
In reply to Richard PurdieThis reverts commit f93ddea31fcf18833c9bc6e93d93ad223c62eded.
We never run nativesdk binaries so it doesn't make sense to use the relocatable class. The chrpath calls at packaging time will ensure the binaries are relocated in the final packages. The binaries in the sysroot are never used.
--- meta/classes/nativesdk.bbclass | 2 -- 1 file changed, 2 deletions(-)
meta/classes/nativesdk.bbclass +0 -2
@@ -1,5 +1,3 @@ -inherit relocatable - # SDK packages are built either explicitly by the user, # or indirectly via dependency. No need to be in 'world'. EXCLUDE_FROM_WORLD = "1"
Signature · 1 line
1.8.1.2
PATCH 15/28 bitbake.conf/classes/gcc: Don't hardcode -nativesdk
In reply to Richard PurdieHardcoding -nativesdk as the sdk package architecture is inflexible. We may have multiple different target OS and we need a way to be able to separate them. Turning this into a configurable value allows the flexibility we need to build different SDKMACHINEs with different OS targets.
The commit should have no behaviour change, just makes things more configurable.
--- meta/classes/cross-canadian.bbclass | 16 ++++++++-------- meta/classes/crosssdk.bbclass | 2 +- meta/classes/nativesdk.bbclass | 2 +- meta/conf/bitbake.conf | 3 ++- meta/recipes-devtools/gcc/gcc-configure-runtime.inc | 8 ++++---- meta/recipes-devtools/gcc/libgcc_4.7.bb | 6 +++--- meta/recipes-devtools/gcc/libgcc_4.8.bb | 6 +++--- 7 files changed, 22 insertions(+), 21 deletions(-)
meta/classes/cross-canadian.bbclass +8 -8
@@ -14,25 +14,25 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S # # Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS # -PACKAGE_ARCH = "${SDK_ARCH}-nativesdk" +PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" python () { archs = d.getVar('PACKAGE_ARCHS', True).split() sdkarchs = [] for arch in archs: - sdkarchs.append(arch + '-nativesdk') + sdkarchs.append(arch + '-${SDKPKGSUFFIX}') d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs)) } MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}" INHIBIT_DEFAULT_DEPS = "1" -STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}" +STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}" -TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}" PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}" -PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}" -PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/" +PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}" +PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/" HOST_ARCH = "${SDK_ARCH}" HOST_VENDOR = "${SDK_VENDOR}"
@@ -90,8 +90,8 @@ export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig" export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" # Cross-canadian packages need to pull in nativesdk dynamic libs -SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/" -SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}/shlibs/" +SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/" +SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/" do_populate_sysroot[stamp-extra-info] = ""
meta/classes/crosssdk.bbclass +1 -1
@@ -7,7 +7,7 @@ python () { d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH', True)) } -STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}" +STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}" STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}" TARGET_ARCH = "${SDK_ARCH}"
meta/classes/nativesdk.bbclass +1 -1
@@ -11,7 +11,7 @@ CLASSOVERRIDE = "class-nativesdk" # # Update PACKAGE_ARCH and PACKAGE_ARCHS # -PACKAGE_ARCH = "${SDK_ARCH}-nativesdk" +PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" #
meta/conf/bitbake.conf +2 -1
@@ -127,7 +127,8 @@ SDK_VENDOR = "-oesdk" SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' or 'custom')]}" SDK_PREFIX = "${SDK_SYS}-" SDK_CC_ARCH = "${BUILD_CC_ARCH}" -SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-nativesdk" +SDKPKGSUFFIX = "nativesdk" +SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}" SDK_LD_ARCH = "${BUILD_LD_ARCH}" SDK_AS_ARCH = "${BUILD_AS_ARCH}"
meta/recipes-devtools/gcc/gcc-configure-runtime.inc +4 -4
@@ -15,8 +15,8 @@ RUNTIMETARGET = "libssp libstdc++-v3 libgomp" do_configure () { export CXX="${CXX} -nostdinc++ -nostdlib++" - mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##` - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B} for d in libgcc ${RUNTIMETARGET}; do echo "Configuring $d"
@@ -29,7 +29,7 @@ do_configure () { } do_compile () { - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` for d in libgcc ${RUNTIMETARGET}; do cd ${B}/$target/$d/ oe_runmake MULTIBUILDTOP=${B}/$target/$d/
@@ -37,7 +37,7 @@ do_compile () { } do_install () { - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` for d in ${RUNTIMETARGET}; do cd ${B}/$target/$d/ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
meta/recipes-devtools/gcc/libgcc_4.7.bb +3 -3
@@ -26,7 +26,7 @@ FILES_libgcov-dev = " \ FILES_${PN}-dbg += "${base_libdir}/.debug/" do_configure () { - target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` install -d ${D}${base_libdir} ${D}${libdir} cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B} mkdir -p ${B}/${BPN}
@@ -36,13 +36,13 @@ do_configure () { } do_compile () { - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` cd ${B}/${BPN} oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/ } do_install () { - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` cd ${B}/${BPN} oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
meta/recipes-devtools/gcc/libgcc_4.8.bb +3 -3
@@ -26,7 +26,7 @@ FILES_libgcov-dev = " \ FILES_${PN}-dbg += "${base_libdir}/.debug/" do_configure () { - target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` install -d ${D}${base_libdir} ${D}${libdir} cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B} mkdir -p ${B}/${BPN}
@@ -36,13 +36,13 @@ do_configure () { } do_compile () { - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` cd ${B}/${BPN} oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/ } do_install () { - target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##` + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` cd ${B}/${BPN} oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
Signature · 1 line
1.8.1.2
PATCH 16/28 gcc-cross: Fold common configuration into gcc-cross.inc
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-cross.inc | 12 ++++++++++++ meta/recipes-devtools/gcc/gcc-cross_4.7.bb | 11 ----------- meta/recipes-devtools/gcc/gcc-cross_4.8.bb | 11 ----------- 3 files changed, 12 insertions(+), 22 deletions(-)
meta/recipes-devtools/gcc/gcc-cross.inc +12 -0
@@ -108,3 +108,15 @@ STOP } EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets " + +EXTRA_OECONF += "--disable-libunwind-exceptions \ + --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \ + --with-system-zlib " + +EXTRA_OECONF_PATHS = " \ + --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ + --with-sysroot=${STAGING_DIR_TARGET} \ + --with-build-sysroot=${STAGING_DIR_TARGET}" + + +ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
meta/recipes-devtools/gcc/gcc-cross_4.7.bb +0 -11
@@ -1,14 +1,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc require gcc-cross.inc -EXTRA_OECONF += "--disable-libunwind-exceptions \ - --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \ - --with-system-zlib " - -EXTRA_OECONF_PATHS = " \ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ - --with-sysroot=${STAGING_DIR_TARGET} \ - --with-build-sysroot=${STAGING_DIR_TARGET}" - - -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
meta/recipes-devtools/gcc/gcc-cross_4.8.bb +0 -11
@@ -1,14 +1,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc require gcc-cross.inc -EXTRA_OECONF += "--disable-libunwind-exceptions \ - --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \ - --with-system-zlib " - -EXTRA_OECONF_PATHS = " \ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ - --with-sysroot=${STAGING_DIR_TARGET} \ - --with-build-sysroot=${STAGING_DIR_TARGET}" - - -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
Signature · 1 line
1.8.1.2
PATCH 17/28 gcc-cross-initial: Fold common configuration into gcc-cross-initial.inc
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-cross-initial.inc | 2 ++ meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb | 1 - meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb | 1 - 3 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/gcc/gcc-cross-initial.inc +2 -0
@@ -24,6 +24,8 @@ EXTRA_OECONF = "--with-newlib \ ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \ ${EXTRA_OECONF_FPU}" +EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} " + GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot" do_configure_prepend () {
meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.7.bb +0 -1
@@ -1,4 +1,3 @@ require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb require gcc-crosssdk-initial.inc -EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb +0 -1
@@ -1,4 +1,3 @@ require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb require gcc-crosssdk-initial.inc -EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
Signature · 1 line
1.8.1.2
PATCH 18/28 gcc-runtime: Fold common configuration into gcc-configure-runtime.inc
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-configure-runtime.inc | 5 +++++ meta/recipes-devtools/gcc/gcc-runtime_4.7.bb | 4 ---- meta/recipes-devtools/gcc/gcc-runtime_4.8.bb | 4 ---- 3 files changed, 5 insertions(+), 8 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-runtime.inc +5 -0
@@ -7,6 +7,11 @@ EXTRA_OECONF_PATHS = " \ --with-sysroot=${STAGING_DIR_TARGET} \ --with-build-sysroot=${STAGING_DIR_TARGET}" +ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" + +EXTRA_OECONF += "--disable-libunwind-exceptions" +EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu" + RUNTIMETARGET = "libssp libstdc++-v3 libgomp" # ? # libiberty
meta/recipes-devtools/gcc/gcc-runtime_4.7.bb +0 -4
@@ -2,7 +2,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc require gcc-configure-runtime.inc require gcc-package-runtime.inc -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" - -EXTRA_OECONF += "--disable-libunwind-exceptions" -EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
meta/recipes-devtools/gcc/gcc-runtime_4.8.bb +0 -4
@@ -2,7 +2,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc require gcc-configure-runtime.inc require gcc-package-runtime.inc -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" - -EXTRA_OECONF += "--disable-libunwind-exceptions" -EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
Signature · 1 line
1.8.1.2
PATCH 19/28 libgcc: Move common code to libgcc.inc
In reply to Richard Purdie--- meta/recipes-devtools/gcc/libgcc.inc | 143 +++++++++++++++++++++++++++++++ meta/recipes-devtools/gcc/libgcc_4.7.bb | 144 +------------------------------ meta/recipes-devtools/gcc/libgcc_4.8.bb | 145 +------------------------------- 3 files changed, 145 insertions(+), 287 deletions(-) create mode 100644 meta/recipes-devtools/gcc/libgcc.inc
meta/recipes-devtools/gcc/libgcc.inc new file +143 -0
@@ -0,0 +1,143 @@ +INHIBIT_DEFAULT_DEPS = "1" + +DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" + +PACKAGES = "\ + ${PN} \ + ${PN}-dev \ + ${PN}-dbg \ + libgcov-dev \ + " + +FILES_${PN} = "${base_libdir}/libgcc*.so.*" +FILES_${PN}-dev = " \ + ${base_libdir}/libgcc*.so \ + ${libdir}/${TARGET_SYS}/${BINV}/*crt* \ + ${libdir}/${TARGET_SYS}/${BINV}/64 \ + ${libdir}/${TARGET_SYS}/${BINV}/32 \ + ${libdir}/${TARGET_SYS}/${BINV}/x32 \ + ${libdir}/${TARGET_SYS}/${BINV}/n32 \ + ${libdir}/${TARGET_SYS}/${BINV}/libgcc*" +FILES_libgcov-dev = " \ + ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \ + " +FILES_${PN}-dbg += "${base_libdir}/.debug/" + +do_configure () { + target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` + install -d ${D}${base_libdir} ${D}${libdir} + cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B} + mkdir -p ${B}/${BPN} + cd ${B}/${BPN} + chmod a+x ${S}/${BPN}/configure + ${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} +} + +do_compile () { + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` + cd ${B}/${BPN} + oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/ +} + +do_install () { + target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` + cd ${B}/${BPN} + oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install + + # Move libgcc_s into /lib + mkdir -p ${D}${base_libdir} + if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then + mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir} + else + mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true + fi + + # install the runtime in /usr/lib/ not in /usr/lib/gcc on target + # so that cross-gcc can find it in the sysroot + + mv ${D}${libdir}/gcc/* ${D}${libdir} + rm -rf ${D}${libdir}/gcc/ + # unwind.h is installed here which is shipped in gcc-cross + # as well as target gcc and they are identical so we dont + # ship one with libgcc here + rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include +} + +do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" + +BBCLASSEXTEND = "nativesdk" + +INSANE_SKIP_${PN}-dev = "staticdev" +INSANE_SKIP_${MLPREFIX}libgcov-dev = "staticdev" + +addtask multilib_install after do_install before do_package do_populate_sysroot +# this makes multilib gcc files findable for target gcc +# e.g. +# /usr/lib/i586-pokymllib32-linux/4.7/ +# by creating this symlink to it +# /usr/lib64/x86_64-poky-linux/4.7/32 + +python do_multilib_install() { + import re + + multilibs = d.getVar('MULTILIB_VARIANTS', True) + if not multilibs or bb.data.inherits_class('nativesdk', d): + return + + binv = d.getVar('BINV', True) + + mlprefix = d.getVar('MLPREFIX', True) + if ('%slibgcc' % mlprefix) != d.getVar('PN', True): + return + + if mlprefix: + orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True) + orig_tune_params = get_tune_parameters(orig_tune, d) + orig_tune_baselib = orig_tune_params['baselib'] + orig_tune_bitness = orig_tune_baselib.replace('lib', '') + if not orig_tune_bitness: + orig_tune_bitness = '32' + + src = '../../../' + orig_tune_baselib + '/' + \ + d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/' + + dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \ + d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness + + if os.path.lexists(dest): + os.unlink(dest) + os.symlink(src, dest) + return + + + for ml in multilibs.split(): + tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True) + if not tune: + bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml) + continue + + tune_parameters = get_tune_parameters(tune, d) + tune_baselib = tune_parameters['baselib'] + if not tune_baselib: + bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune) + continue + + tune_arch = tune_parameters['arch'] + tune_bitness = tune_baselib.replace('lib', '') + if not tune_bitness: + tune_bitness = '32' # /lib => 32bit lib + + src = '../../../' + tune_baselib + '/' + \ + tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \ + '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/' + + dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \ + d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness + + if os.path.lexists(dest): + os.unlink(dest) + os.symlink(src, dest) +}
meta/recipes-devtools/gcc/libgcc_4.7.bb +1 -143
146 lines not on this page · raw message
meta/recipes-devtools/gcc/libgcc_4.8.bb +1 -144
146 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH 20/28 gcc-target: Combine gcc-target-configure.inc, gcc-target-package.inc and other common code
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-configure-target.inc | 8 -- meta/recipes-devtools/gcc/gcc-package-target.inc | 142 ------------------- meta/recipes-devtools/gcc/gcc-target.inc | 153 +++++++++++++++++++++ meta/recipes-devtools/gcc/gcc_4.7.bb | 5 +- meta/recipes-devtools/gcc/gcc_4.8.bb | 5 +- 5 files changed, 155 insertions(+), 158 deletions(-) delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-target.inc delete mode 100644 meta/recipes-devtools/gcc/gcc-package-target.inc create mode 100644 meta/recipes-devtools/gcc/gcc-target.inc
meta/recipes-devtools/gcc/gcc-configure-target.inc deleted +0 -8
@@ -1,8 +0,0 @@ -GCCMULTILIB = "--enable-multilib" -require gcc-configure-common.inc - -EXTRA_OECONF_PATHS = " \ - --with-sysroot=/ \ - --with-build-sysroot=${STAGING_DIR_TARGET} \ - --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \ - --with-gxx-include-dir=${includedir}/c++/ --enable-dependency-tracking"
meta/recipes-devtools/gcc/gcc-package-target.inc deleted +0 -142
142 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-target.inc new file +153 -0
153 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc_4.7.bb +1 -4
@@ -1,5 +1,2 @@ require recipes-devtools/gcc/gcc-${PV}.inc -require gcc-configure-target.inc -require gcc-package-target.inc - -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ " +require gcc-target.inc
meta/recipes-devtools/gcc/gcc_4.8.bb +1 -4
@@ -1,5 +1,2 @@ require recipes-devtools/gcc/gcc-${PV}.inc -require gcc-configure-target.inc -require gcc-package-target.inc - -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR} -I${B}/gcc/include/ " +require gcc-target.inc
Signature · 1 line
1.8.1.2
PATCH 21/28 gcc-*-cross.inc: Fold common configuration into gcc-cross.inc
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-configure-cross.inc | 31 --------- meta/recipes-devtools/gcc/gcc-cross.inc | 84 ++++++++++++++++++++++- meta/recipes-devtools/gcc/gcc-package-cross.inc | 48 ------------- 3 files changed, 81 insertions(+), 82 deletions(-) delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-cross.inc delete mode 100644 meta/recipes-devtools/gcc/gcc-package-cross.inc
meta/recipes-devtools/gcc/gcc-configure-cross.inc deleted +0 -31
@@ -1,31 +0,0 @@ -require gcc-configure-common.inc - -EXTRA_OECONF += " --enable-poison-system-directories \ - " - -INHIBIT_DEFAULT_DEPS = "1" - -EXTRA_OECONF_PATHS = " \ - --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ - --with-sysroot=${STAGING_DIR_TARGET} \ - --with-build-sysroot=${STAGING_DIR_TARGET}" - -do_configure_prepend () { - sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure -} -do_compile_prepend () { - export CC="${BUILD_CC}" - export AR_FOR_TARGET="${TARGET_SYS}-ar" - export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib" - export LD_FOR_TARGET="${TARGET_SYS}-ld" - export NM_FOR_TARGET="${TARGET_SYS}-nm" - export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}" - export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" - export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" - export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" - export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" -} - -LIBGCCS_VAR = "-lgcc_s" -LIBGCCS_VAR_avr32 = ""
meta/recipes-devtools/gcc/gcc-cross.inc +81 -3
94 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-package-cross.inc deleted +0 -48
48 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH 22/28 gcc-*-runtime.inc: Fold configuration into gcc-runtime.inc
In reply to Richard Purdie--- .../recipes-devtools/gcc/gcc-configure-runtime.inc | 64 --------- meta/recipes-devtools/gcc/gcc-package-runtime.inc | 80 ------------ meta/recipes-devtools/gcc/gcc-runtime.inc | 145 +++++++++++++++++++++ meta/recipes-devtools/gcc/gcc-runtime_4.7.bb | 3 +- meta/recipes-devtools/gcc/gcc-runtime_4.8.bb | 3 +- 5 files changed, 147 insertions(+), 148 deletions(-) delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-runtime.inc delete mode 100644 meta/recipes-devtools/gcc/gcc-package-runtime.inc create mode 100644 meta/recipes-devtools/gcc/gcc-runtime.inc
meta/recipes-devtools/gcc/gcc-configure-runtime.inc deleted +0 -64
@@ -1,64 +0,0 @@ -require gcc-configure-common.inc - -CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}" - -EXTRA_OECONF_PATHS = " \ - --with-gxx-include-dir=${includedir}/c++/ \ - --with-sysroot=${STAGING_DIR_TARGET} \ - --with-build-sysroot=${STAGING_DIR_TARGET}" - -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_INCDIR}" - -EXTRA_OECONF += "--disable-libunwind-exceptions" -EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu" - -RUNTIMETARGET = "libssp libstdc++-v3 libgomp" -# ? -# libiberty -# libmudflap -# libgfortran - -do_configure () { - export CXX="${CXX} -nostdinc++ -nostdlib++" - mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` - target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` - cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B} - for d in libgcc ${RUNTIMETARGET}; do - echo "Configuring $d" - rm -rf ${B}/$target/$d/ - mkdir -p ${B}/$target/$d/ - cd ${B}/$target/$d/ - chmod a+x ${S}/$d/configure - ${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} - done -} - -do_compile () { - target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` - for d in libgcc ${RUNTIMETARGET}; do - cd ${B}/$target/$d/ - oe_runmake MULTIBUILDTOP=${B}/$target/$d/ - done -} - -do_install () { - target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##` - for d in ${RUNTIMETARGET}; do - cd ${B}/$target/$d/ - oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install - done - rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir - if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then - rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude - fi - if [ -d ${D}${infodir} ]; then - rmdir --ignore-fail-on-non-empty -p ${D}${infodir} - fi - chown -R root:root ${D} -} - -INHIBIT_DEFAULT_DEPS = "1" -DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc" -PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs" - -BBCLASSEXTEND = "nativesdk"
meta/recipes-devtools/gcc/gcc-package-runtime.inc deleted +0 -80
80 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-runtime.inc new file +145 -0
145 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-runtime_4.7.bb +1 -2
@@ -1,4 +1,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc -require gcc-configure-runtime.inc -require gcc-package-runtime.inc +require gcc-runtime.inc
meta/recipes-devtools/gcc/gcc-runtime_4.8.bb +1 -2
@@ -1,4 +1,3 @@ require recipes-devtools/gcc/gcc-${PV}.inc -require gcc-configure-runtime.inc -require gcc-package-runtime.inc +require gcc-runtime.inc
Signature · 1 line
1.8.1.2
PATCH 23/28 gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc
In reply to Richard PurdieThis also has the advantage of removing the confusing sdk naming which has been purged everywhere else in favour of cross-canadian.
--- meta/recipes-devtools/gcc/gcc-configure-sdk.inc | 47 --------- meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 127 ++++++++++++++++++++++- meta/recipes-devtools/gcc/gcc-package-sdk.inc | 78 -------------- 3 files changed, 125 insertions(+), 127 deletions(-) delete mode 100644 meta/recipes-devtools/gcc/gcc-configure-sdk.inc delete mode 100644 meta/recipes-devtools/gcc/gcc-package-sdk.inc
meta/recipes-devtools/gcc/gcc-configure-sdk.inc deleted +0 -47
@@ -1,47 +0,0 @@ -require gcc-configure-common.inc - -EXTRA_OECONF_PATHS = "--with-gxx-include-dir=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${target_includedir}/c++ \ - --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ - --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \ - --with-build-sysroot=${STAGING_DIR_TARGET}" - -# -# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky -# for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse. -# -export AR_FOR_TARGET = "${TARGET_PREFIX}ar" -export AS_FOR_TARGET = "${TARGET_PREFIX}as" -export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool" -export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" -export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" -export LD_FOR_TARGET = "${TARGET_PREFIX}ld" -export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo" -export NM_FOR_TARGET = "${TARGET_PREFIX}nm" -export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump" -export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" -export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip" -export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres" - -# -# We need to override this and make sure the compiler can find staging -# -export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}" - -do_configure () { - export CC_FOR_BUILD="${BUILD_CC}" - export CXX_FOR_BUILD="${BUILD_CXX}" - export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" - export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" - export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" - export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" - export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" - export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" - export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" - export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" - (cd ${S} && gnu-configize) || die "failure running gnu-configize" - oe_runconf -} - -do_compile () { - oe_runmake all-host -}
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +125 -2
133 lines not on this page · raw message
meta/recipes-devtools/gcc/gcc-package-sdk.inc deleted +0 -78
78 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH 24/28 gcc-cross.inc: Clean up after merge
In reply to Richard Purdie* Remove the duplicate EXTRA_OECONF_PATHS that is overwritten
* Merge the do_compile and do_compile_prepend
* Group dependency and configuration variables together
--- meta/recipes-devtools/gcc/gcc-cross.inc | 48 +++++++++++++-------------------- 1 file changed, 18 insertions(+), 30 deletions(-)
meta/recipes-devtools/gcc/gcc-cross.inc +18 -30
@@ -1,26 +1,38 @@ inherit cross +INHIBIT_DEFAULT_DEPS = "1" +EXTRADEPENDS = "" DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}" PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" +python () { + if d.getVar("TARGET_OS", True).startswith("linux"): + d.setVar("EXTRADEPENDS", "linux-libc-headers") +} require gcc-configure-common.inc -EXTRA_OECONF += " --enable-poison-system-directories \ - " +EXTRA_OECONF += " --enable-poison-system-directories" +EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets " -INHIBIT_DEFAULT_DEPS = "1" +EXTRA_OECONF += "--disable-libunwind-exceptions \ + --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \ + --with-system-zlib " EXTRA_OECONF_PATHS = " \ - --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ + --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ --with-sysroot=${STAGING_DIR_TARGET} \ --with-build-sysroot=${STAGING_DIR_TARGET}" +ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" + +LIBGCCS_VAR = "-lgcc_s" +LIBGCCS_VAR_avr32 = "" + do_configure_prepend () { sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure } -do_compile_prepend () { +do_compile () { export CC="${BUILD_CC}" export AR_FOR_TARGET="${TARGET_SYS}-ar" export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
@@ -31,18 +43,7 @@ do_compile_prepend () { export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" -} - -LIBGCCS_VAR = "-lgcc_s" -LIBGCCS_VAR_avr32 = "" -EXTRADEPENDS = "" -python () { - if d.getVar("TARGET_OS", True).startswith("linux"): - d.setVar("EXTRADEPENDS", "linux-libc-headers") -} - -do_compile () { oe_runmake all-host all-target-libgcc # now generate script to drive testing echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
@@ -137,19 +138,6 @@ STOP } -EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets " - -EXTRA_OECONF += "--disable-libunwind-exceptions \ - --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \ - --with-system-zlib " - -EXTRA_OECONF_PATHS = " \ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \ - --with-sysroot=${STAGING_DIR_TARGET} \ - --with-build-sysroot=${STAGING_DIR_TARGET}" - -ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" - INHIBIT_PACKAGE_STRIP = "1" # Compute how to get from libexecdir to bindir in python (easier than shell)
Signature · 1 line
1.8.1.2
PATCH 25/28 gcc-common.inc: Drop unused LIBGCCS_VAR variable
In reply to Richard Purdie--- meta/recipes-devtools/gcc/gcc-cross.inc | 3 --- 1 file changed, 3 deletions(-)
meta/recipes-devtools/gcc/gcc-cross.inc +0 -3
@@ -25,9 +25,6 @@ EXTRA_OECONF_PATHS = " \ ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" -LIBGCCS_VAR = "-lgcc_s" -LIBGCCS_VAR_avr32 = "" - do_configure_prepend () { sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure }
Signature · 1 line
1.8.1.2
PATCH 26/28 bitbake.conf: Work around dev symlink problems on darwin
In reply to Richard PurdieOn darwin, we have:
libxxx.dylib -> libxxx.Y.dylib
compared to Linux which has:
libxxx.so -> libxxx.so.Y
Our ordering of PACKAGES with -dev first and then ${PN} makes it impossible to match the files correctly using simple globbing. This makes darwin targets completely broken since both the libs and the dev symlinks end up in ${PN}-dev.
Whilst this commit is a hack, it at least puts the files into ${PN} and allows the builds to be used. Symlinks don't take up much space so this isn't the end of the world. I'm open to better solutions to this.
--- meta/conf/bitbake.conf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
meta/conf/bitbake.conf +9 -6
@@ -259,14 +259,17 @@ RPROVIDES = "" MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativesdk-libintl virtual/xserver virtual/update-alternatives-native virtual/update-alternatives" SOLIBS = ".so.*" -SOLIBS_darwin = ".*.dylib" -SOLIBS_darwin8 = ".*.dylib" -SOLIBS_darwin9 = ".*.dylib" +SOLIBS_darwin = ".dylib" +SOLIBS_darwin8 = ".dylib" +SOLIBS_darwin9 = ".dylib" SOLIBSDEV = ".so" -SOLIBSDEV_darwin = ".dylib" -SOLIBSDEV_darwin8 = ".dylib" -SOLIBSDEV_darwin9 = ".dylib" +# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin, +# we can't make the symlinks end up in the -dev packages easily at this point. This hack +# at least means builds aren't completely broken and symlinks don't take up much space. +SOLIBSDEV_darwin = ".dylibbroken" +SOLIBSDEV_darwin8 = ".dylibbroken" +SOLIBSDEV_darwin9 = ".dylibbroken" PACKAGE_BEFORE_PN ?= "" PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
Signature · 1 line
1.8.1.2
PATCH 27/28 Drop darwin8/darwin9 usage
In reply to Richard PurdieThere were darwin8/darwin9 overrides spinkled in the code from times gone by. Lets settle on the darwin override and remove the others since its pointless duplication. We always inject darwin into OVERRIDES if needed in the darwin8/9 cases.
--- meta/conf/bitbake.conf | 4 ---- meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb | 2 +- meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb | 1 - 3 files changed, 1 insertion(+), 6 deletions(-)
meta/conf/bitbake.conf +0 -4
@@ -260,16 +260,12 @@ MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativ SOLIBS = ".so.*" SOLIBS_darwin = ".dylib" -SOLIBS_darwin8 = ".dylib" -SOLIBS_darwin9 = ".dylib" SOLIBSDEV = ".so" # Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin, # we can't make the symlinks end up in the -dev packages easily at this point. This hack # at least means builds aren't completely broken and symlinks don't take up much space. SOLIBSDEV_darwin = ".dylibbroken" -SOLIBSDEV_darwin8 = ".dylibbroken" -SOLIBSDEV_darwin9 = ".dylibbroken" PACKAGE_BEFORE_PN ?= "" PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb +1 -1
@@ -22,7 +22,7 @@ RDEPENDS_${PN} = "\ nativesdk-automake \ " -RDEPENDS_${PN}_darwin8 = "\ +RDEPENDS_${PN}_darwin = "\ odcctools-cross-canadian \ llvm-cross-canadian \ nativesdk-pkgconfig \
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.8.bb +0 -1
@@ -10,7 +10,6 @@ SRC_URI[sha256sum] = "b984aaf1fe888d6a4cf8c2e8d397207879599b5368f1d33232c1ec9d68 EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd" EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" -EXTRA_OECONF_darwin8 = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" do_configure_prepend () { cp ${WORKDIR}/acinclude.m4 ${S}/
Signature · 1 line
1.8.1.2
PATCH 28/28 chrpath: Add support for relocating darwin binaries
In reply to Richard PurdieOn darwin, install_name_tool can be used to relocate binaries/libraries. This adds support for adjusting them with relative paths rather than hardcoded ones. The Linux code is factored out into a function but is otherwise unchanged.
--- meta/classes/chrpath.bbclass | 138 +++++++++++++++++++++++++++---------------- 1 file changed, 88 insertions(+), 50 deletions(-)
meta/classes/chrpath.bbclass +88 -50
@@ -1,18 +1,103 @@ CHRPATH_BIN ?= "chrpath" PREPROCESS_RELOCATE_DIRS ?= "" -def process_dir (directory, d): +def process_file_linux(cmd, fpath, basedir, tmpdir, d): import subprocess as sub + + p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE) + err, out = p.communicate() + # If returned succesfully, process stderr for results + if p.returncode != 0: + return + + # Throw away everything other than the rpath list + curr_rpath = err.partition("RPATH=")[2] + #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip())) + rpaths = curr_rpath.split(":") + new_rpaths = [] + for rpath in rpaths: + # If rpath is already dynamic copy it to new_rpath and continue + if rpath.find("$ORIGIN") != -1: + new_rpaths.append(rpath.strip()) + continue + rpath = os.path.normpath(rpath) + # If the rpath shares a root with base_prefix determine a new dynamic rpath from the + # base_prefix shared root + if rpath.find(basedir) != -1: + depth = fpath.partition(basedir)[2].count('/') + libpath = rpath.partition(basedir)[2].strip() + # otherwise (i.e. cross packages) determine a shared root based on the TMPDIR + # NOTE: This will not work reliably for cross packages, particularly in the case + # where your TMPDIR is a short path (i.e. /usr/poky) as chrpath cannot insert an + # rpath longer than that which is already set. + elif rpath.find(tmpdir) != -1: + depth = fpath.rpartition(tmpdir)[2].count('/') + libpath = rpath.partition(tmpdir)[2].strip() + else: + new_rpaths.append(rpath.strip()) + return + base = "$ORIGIN" + while depth > 1: + base += "/.." + depth-=1 + new_rpaths.append("%s%s" % (base, libpath)) + + # if we have modified some rpaths call chrpath to update the binary + if len(new_rpaths): + args = ":".join(new_rpaths) + #bb.note("Setting rpath for %s to %s" %(fpath, args)) + p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE) + out, err = p.communicate() + if p.returncode != 0: + bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err)) + raise bb.build.FuncFailed + +def process_file_darwin(cmd, fpath, basedir, tmpdir, d): + import subprocess as sub + + p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE) + err, out = p.communicate() + # If returned succesfully, process stderr for results + if p.returncode != 0: + return + for l in err.split("\n"): + if "(compatibility" not in l: + continue + rpath = l.partition("(compatibility")[0].strip() + if rpath.find(basedir) != -1: + depth = fpath.partition(basedir)[2].count('/') + libpath = rpath.partition(basedir)[2].strip() + else: + continue + + base = "@loader_path" + while depth > 1: + base += "/.." + depth-=1 + base = base + libpath + p = sub.Popen([d.expand("${HOST_PREFIX}install_name_tool"), '-change', rpath, base, fpath],stdout=sub.PIPE,stderr=sub.PIPE) + err, out = p.communicate() + +def process_dir (directory, d): import stat cmd = d.expand('${CHRPATH_BIN}') tmpdir = os.path.normpath(d.getVar('TMPDIR')) basedir = os.path.normpath(d.expand('${base_prefix}')) + hostos = d.getVar("HOST_OS", True) #bb.debug("Checking %s for binaries to process" % directory) if not os.path.exists(directory): return + if "linux" in hostos: + process_file = process_file_linux + elif "darwin" in hostos: + process_file = process_file_darwin + else: + # Relocations not supported + return + dirs = os.listdir(directory) for file in dirs: fpath = directory + "/" + file
@@ -35,55 +120,8 @@ def process_dir (directory, d): else: # Temporarily make the file writeable so we can chrpath it os.chmod(fpath, perms|stat.S_IRWXU) - - p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE) - err, out = p.communicate() - # If returned succesfully, process stderr for results - if p.returncode != 0: - continue - - # Throw away everything other than the rpath list - curr_rpath = err.partition("RPATH=")[2] - #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip())) - rpaths = curr_rpath.split(":") - new_rpaths = [] - for rpath in rpaths: - # If rpath is already dynamic copy it to new_rpath and continue - if rpath.find("$ORIGIN") != -1: - new_rpaths.append(rpath.strip()) - continue - rpath = os.path.normpath(rpath) - # If the rpath shares a root with base_prefix determine a new dynamic rpath from the - # base_prefix shared root - if rpath.find(basedir) != -1: - depth = fpath.partition(basedir)[2].count('/') - libpath = rpath.partition(basedir)[2].strip() - # otherwise (i.e. cross packages) determine a shared root based on the TMPDIR - # NOTE: This will not work reliably for cross packages, particularly in the case - # where your TMPDIR is a short path (i.e. /usr/poky) as chrpath cannot insert an - # rpath longer than that which is already set. - elif rpath.find(tmpdir) != -1: - depth = fpath.rpartition(tmpdir)[2].count('/') - libpath = rpath.partition(tmpdir)[2].strip() - else: - new_rpaths.append(rpath.strip()) - continue - base = "$ORIGIN" - while depth > 1: - base += "/.." - depth-=1 - new_rpaths.append("%s%s" % (base, libpath)) - - # if we have modified some rpaths call chrpath to update the binary - if len(new_rpaths): - args = ":".join(new_rpaths) - #bb.note("Setting rpath for %s to %s" %(fpath, args)) - p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE) - out, err = p.communicate() - if p.returncode != 0: - bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err)) - raise bb.build.FuncFailed - + process_file(cmd, fpath, basedir, tmpdir, d) + if perms: os.chmod(fpath, perms)
Signature · 1 line
1.8.1.2
cover Toolchain tweaks
In reply to Richard PurdiePlaying with meta-mingw, it was clear that there were some simple changes we could make to the core that would improve things for non-linux SDKs. This series includes those changes. Since I like pain, I also attempted a darwin build and have included some tweaks for that too.
When looking at the gcc recipes, it also became clear that we have way too many include files and the whole thing was a bit of a maze. The series has some changes in to combine various files together and simplify things.
I appreciate this may complicate moving things into meta-oe such as gcc 4.7. I would propose when we do that, we put them into recipes-gcc-<version> and include a snapshot of the .inc files at that time. The alternative is the continual copy and paste growth of the .bb files (libgcc being a more extreme example) which I don't think lends itself to future maintenance of the recipes.
There are some layers which for example use gcc-cross4.inc, they should just be able to switch directly to gcc-cross.inc. I think this applies to meta-arago-extras.
This also leads the way to possibly further unify and clean up some of the configuration (e.g. the do_configure_prepends) but I will leave that for another series when someone has some further time to spend on it.
Cheers,
Richard