From 7c377a383f6028e52fb48350337ecc9ca650cef6 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 7 Apr 2015 11:05:36 -0700 Subject: [PATCH 1/5] libgcc-external: package unwind.h Signed-off-by: Christopher Larson --- recipes-external/gcc/libgcc-external.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes-external/gcc/libgcc-external.bb b/recipes-external/gcc/libgcc-external.bb index 91a1984..1750671 100644 --- a/recipes-external/gcc/libgcc-external.bb +++ b/recipes-external/gcc/libgcc-external.bb @@ -18,7 +18,9 @@ FILES_${PN}-dev = "${base_libdir}/libgcc_s.so \ ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtfastmath.o \ ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtprec*.o \ ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcc.a \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcc_eh.a" + ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcc_eh.a \ + ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/unwind.h \ + " INSANE_SKIP_${PN}-dev += "staticdev" FILES_${PN}-dbg += "${base_libdir}/.debug/libgcc_s.so.*.debug" FILES_libgcov-dev = "${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcov.a" From 6b2497f32e2755c7f06d3ae7f0da5e33d0e5591a Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 7 Apr 2015 11:05:50 -0700 Subject: [PATCH 2/5] gcc-runtime-external: package headers for omp, quadmath, ssp Signed-off-by: Christopher Larson --- recipes-external/gcc/gcc-runtime-external.bb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes-external/gcc/gcc-runtime-external.bb b/recipes-external/gcc/gcc-runtime-external.bb index f3f496e..506c4cf 100644 --- a/recipes-external/gcc/gcc-runtime-external.bb +++ b/recipes-external/gcc/gcc-runtime-external.bb @@ -84,14 +84,16 @@ FILES_libmudflap = "${libdir}/libmudflap${SOLIBS}" FILES_libmudflap-dev = "${libdir}/libmudflap${SOLIBSDEV}" FILES_libmudflap-staticdev = "${libdir}/libmudflap.a" FILES_libquadmath = "${libdir}/libquadmath${SOLIBS}" -FILES_libquadmath-dev = "${libdir}/libquadmath${SOLIBSDEV}" +FILES_libquadmath-dev = "${libdir}/libquadmath${SOLIBSDEV} \ + ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/quadmath*" FILES_libquadmath-staticdev = "${libdir}/libquadmath.a" FILES_libssp = "${libdir}/libssp${SOLIBS}" FILES_libssp-dev = "${libdir}/libssp${SOLIBSDEV} \ - ${libdir}/gcc/*/*/include/ssp" + ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/ssp" FILES_libssp-staticdev = "${libdir}/libssp.a" FILES_libgomp = "${libdir}/libgomp${SOLIBS}" -FILES_libgomp-dev = "${libdir}/libgomp${SOLIBSDEV}" +FILES_libgomp-dev = "${libdir}/libgomp${SOLIBSDEV} \ + ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/omp.h" FILES_libgomp-staticdev = "${libdir}/libgomp.a" FILES_libitm = "${libdir}/libitm${SOLIBS}" FILES_libitm-dev = "${libdir}/libitm${SOLIBSDEV}" From e890f1c457057523d38e0126934f6f85c0b96aac Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 7 Apr 2015 11:19:12 -0700 Subject: [PATCH 3/5] gcc: don't pull unwind.h from cross sysroot libgcc-external provides this. Signed-off-by: Christopher Larson --- core/recipes-devtools/gcc/gcc_%.bbappend | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 core/recipes-devtools/gcc/gcc_%.bbappend diff --git a/core/recipes-devtools/gcc/gcc_%.bbappend b/core/recipes-devtools/gcc/gcc_%.bbappend new file mode 100644 index 0000000..ed4f840 --- /dev/null +++ b/core/recipes-devtools/gcc/gcc_%.bbappend @@ -0,0 +1,8 @@ +# unwind.h will come from libgcc-external, we don't want to try to pull it +# from the cross area of the sysroot +python () { + if d.getVar('TCMODE', True).startswith('external-sourcery'): + inst = d.getVar('do_install', False).splitlines() + inst = filter(lambda l: not ('unwind.h' in l and '${STAGING_LIBDIR_NATIVE}' in l), inst) + d.setVar('do_install', '\n'.join(inst)) +} From 6d9b06cd2163268ed02281c564972e5dd9716499 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 14 Apr 2015 09:14:41 -0700 Subject: [PATCH 4/5] external-toolchain: catch re compilation errors in FILES_MIRRORS Signed-off-by: Christopher Larson --- classes/external-toolchain.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/external-toolchain.bbclass b/classes/external-toolchain.bbclass index 0ff818c..f55cf1c 100644 --- a/classes/external-toolchain.bbclass +++ b/classes/external-toolchain.bbclass @@ -163,7 +163,11 @@ def expand_paths(pathnames, mirrors): expanded_paths = [pathname] for search, replace in mirrors: - new_pathname = re.sub(search, replace, pathname, count=1) + try: + new_pathname = re.sub(search, replace, pathname, count=1) + except re.error as exc: + bb.warn("Invalid pattern for `%s`" % search) + continue if new_pathname != pathname: expanded_paths.append(new_pathname) From b56cf21d51f3f9d9ea1b3736c7b879eee9e03454 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 7 Apr 2015 11:33:09 -0700 Subject: [PATCH 5/5] libgcc,gcc-runtime: align TARGET_SYS/EXTERNAL_TARGET_SYS Signed-off-by: Christopher Larson --- classes/external-toolchain.bbclass | 1 + core/recipes-devtools/gcc/gcc_%.bbappend | 6 +++-- recipes-external/gcc/gcc-runtime-external.bb | 14 +++++++---- recipes-external/gcc/libgcc-external.bb | 25 +++++++++++--------- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/classes/external-toolchain.bbclass b/classes/external-toolchain.bbclass index f55cf1c..78eeb3a 100644 --- a/classes/external-toolchain.bbclass +++ b/classes/external-toolchain.bbclass @@ -23,6 +23,7 @@ LICENSE = "CLOSED" LIC_FILES_CHKSUM = "${COMMON_LIC_CHKSUM}" EXTERNAL_TOOLCHAIN_SYSROOT ?= "${@external_run(d, 'gcc', *(TARGET_CC_ARCH.split() + ['-print-sysroot'])).rstrip()}" +EXTERNAL_TOOLCHAIN_LIBROOT ?= "${@external_run(d, 'gcc', *(TARGET_CC_ARCH.split() + ['-print-file-name=crtbegin.o'])).rstrip().replace('/crtbegin.o', '')}" EXTERNAL_INSTALL_SOURCE_PATHS = "\ ${EXTERNAL_TOOLCHAIN_SYSROOT} \ diff --git a/core/recipes-devtools/gcc/gcc_%.bbappend b/core/recipes-devtools/gcc/gcc_%.bbappend index ed4f840..0df59d8 100644 --- a/core/recipes-devtools/gcc/gcc_%.bbappend +++ b/core/recipes-devtools/gcc/gcc_%.bbappend @@ -1,7 +1,9 @@ -# unwind.h will come from libgcc-external, we don't want to try to pull it -# from the cross area of the sysroot +# FIXME: resolve gcc version mismatch issues with ${libdir}/gcc/*/ +# filesystem paths python () { if d.getVar('TCMODE', True).startswith('external-sourcery'): + # unwind.h will come from libgcc-external, we don't want to try to pull it + # from the cross area of the sysroot inst = d.getVar('do_install', False).splitlines() inst = filter(lambda l: not ('unwind.h' in l and '${STAGING_LIBDIR_NATIVE}' in l), inst) d.setVar('do_install', '\n'.join(inst)) diff --git a/recipes-external/gcc/gcc-runtime-external.bb b/recipes-external/gcc/gcc-runtime-external.bb index 506c4cf..ac962ce 100644 --- a/recipes-external/gcc/gcc-runtime-external.bb +++ b/recipes-external/gcc/gcc-runtime-external.bb @@ -54,9 +54,15 @@ PACKAGES =+ "\ SUMMARY_libitm = "The Transactional Memory runtime library" SUMMARY_libitm-dev = "${SUMMARY_libitm} - development files" +external_libroot = "${@os.path.realpath('${EXTERNAL_TOOLCHAIN_LIBROOT}').replace(os.path.realpath('${EXTERNAL_TOOLCHAIN}') + '/', '/')}" +FILES_MIRRORS =. "\ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/|${external_libroot}/\n \ + ${includedir}/c\+\+/${GCC_VERSION}/${TARGET_SYS}/|${includedir}/c++/${GCC_VERSION}/${EXTERNAL_TARGET_SYS}/\n \ +" + FILES_libstdc++ = "${libdir}/libstdc++${SOLIBS}" FILES_libstdc++-dev = "${libdir}/libstdc++${SOLIBSDEV} \ - ${includedir}/c++/${GCC_VERSION}" + ${includedir}/c++/${GCC_VERSION}/${TARGET_SYS}" FILES_libstdc++-staticdev = "${libdir}/libstdc++.a \ ${libdir}/libsupc++.a" FILES_libatomic = "${libdir}/libatomic${SOLIBS}" @@ -85,15 +91,15 @@ FILES_libmudflap-dev = "${libdir}/libmudflap${SOLIBSDEV}" FILES_libmudflap-staticdev = "${libdir}/libmudflap.a" FILES_libquadmath = "${libdir}/libquadmath${SOLIBS}" FILES_libquadmath-dev = "${libdir}/libquadmath${SOLIBSDEV} \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/quadmath*" + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/include/quadmath*" FILES_libquadmath-staticdev = "${libdir}/libquadmath.a" FILES_libssp = "${libdir}/libssp${SOLIBS}" FILES_libssp-dev = "${libdir}/libssp${SOLIBSDEV} \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/ssp" + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/include/ssp" FILES_libssp-staticdev = "${libdir}/libssp.a" FILES_libgomp = "${libdir}/libgomp${SOLIBS}" FILES_libgomp-dev = "${libdir}/libgomp${SOLIBSDEV} \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/omp.h" + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/include/omp.h" FILES_libgomp-staticdev = "${libdir}/libgomp.a" FILES_libitm = "${libdir}/libitm${SOLIBS}" FILES_libitm-dev = "${libdir}/libitm${SOLIBSDEV}" diff --git a/recipes-external/gcc/libgcc-external.bb b/recipes-external/gcc/libgcc-external.bb index 1750671..1c01ae1 100644 --- a/recipes-external/gcc/libgcc-external.bb +++ b/recipes-external/gcc/libgcc-external.bb @@ -8,22 +8,25 @@ inherit external-toolchain PACKAGES =+ "libgcov-dev" +external_libroot = "${@os.path.realpath('${EXTERNAL_TOOLCHAIN_LIBROOT}').replace(os.path.realpath('${EXTERNAL_TOOLCHAIN}') + '/', '/')}" +FILES_MIRRORS =. "${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/|${external_libroot}/\n" + FILES_${PN} = "${base_libdir}/libgcc_s.so.*" FILES_${PN}-dev = "${base_libdir}/libgcc_s.so \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtbegin.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtbeginS.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtbeginT.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtend.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtendS.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtfastmath.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/crtprec*.o \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcc.a \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcc_eh.a \ - ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/include/unwind.h \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtbegin.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtbeginS.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtbeginT.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtend.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtendS.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtfastmath.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/crtprec*.o \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/libgcc.a \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/libgcc_eh.a \ + ${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/include/unwind.h \ " INSANE_SKIP_${PN}-dev += "staticdev" FILES_${PN}-dbg += "${base_libdir}/.debug/libgcc_s.so.*.debug" -FILES_libgcov-dev = "${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${GCC_VERSION}/libgcov.a" +FILES_libgcov-dev = "${libdir}/gcc/${TARGET_SYS}/${GCC_VERSION}/libgcov.a" INSANE_SKIP_libgcov-dev += "staticdev"