diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross-canadian.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 74 |
1 files changed, 50 insertions, 24 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc index 807e47e0ee..bbe91ad0f9 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc @@ -3,14 +3,16 @@ inherit cross-canadian SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)" PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" -DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc nativesdk-gettext flex-native virtual/libc" +DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc virtual/${HOST_PREFIX}binutils virtual/nativesdk-libc nativesdk-gettext flex-native virtual/libc" GCCMULTILIB = "--enable-multilib" require gcc-configure-common.inc +EXTRA_OECONF += "--with-plugin-ld=ld" EXTRA_OECONF_PATHS = "\ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ + --with-gxx-libcxx-include-dir=/not/exist${target_includedir}/c++/v1 \ --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ @@ -45,6 +47,9 @@ export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres" export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}" do_configure () { + if [ ! -d ${RECIPE_SYSROOT}/${target_includedir} ]; then + mkdir -p ${RECIPE_SYSROOT}/${target_includedir} + fi export CC_FOR_BUILD="${BUILD_CC}" export CXX_FOR_BUILD="${BUILD_CXX}" export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" @@ -59,16 +64,16 @@ do_configure () { } do_compile () { + remove_sysroot_paths_from_configargs '/host' + remove_sysroot_paths_from_checksum_options '${STAGING_DIR_HOST}' '/host' + oe_runmake all-host configure-target-libgcc (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) } -# Having anything auto depending on gcc-cross-sdk is a really bad idea... -EXCLUDE_FROM_SHLIBS = "1" - PACKAGES = "${PN}-dbg ${PN} ${PN}-doc" -FILES_${PN} = "\ +FILES:${PN} = "\ ${exec_prefix}/bin/* \ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \ ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \ @@ -78,14 +83,15 @@ FILES_${PN} = "\ ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \ + ${libdir}/bfd-plugins/*.so \ ${includedir}/c++/${BINV} \ ${prefix}/${TARGET_SYS}/bin/* \ ${prefix}/${TARGET_SYS}/lib/* \ ${prefix}/${TARGET_SYS}${target_includedir}/* \ " -INSANE_SKIP_${PN} += "dev-so" +INSANE_SKIP:${PN} += "dev-so" -FILES_${PN}-doc = "\ +FILES:${PN}-doc = "\ ${infodir} \ ${mandir} \ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \ @@ -95,6 +101,8 @@ EXEEXT = "" # Compute how to get from libexecdir to bindir in python (easier than shell) BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}" +# linker plugin path +LIBRELPATH = "${@os.path.relpath(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${libdir}/bfd-plugins"))}" do_install () { ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h ) @@ -109,13 +117,7 @@ do_install () { rm -f ${D}${bindir}/*c++ # We don't care about the gcc-<version> copies - rm -f ${D}${bindir}/*gcc-?.?* - - # We use libiberty from binutils - rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a - # Not sure where the strange paths come from - rm -f ${D}${libdir}/../lib/libiberty.a - rm -f ${D}${libdir}/libiberty.a + rm -f ${D}${bindir}/*gcc-${BINV}* # Cleanup empty directories which are not shipped # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted @@ -130,38 +132,62 @@ do_install () { 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 + for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then continue fi ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix done - t=real-ld - ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld$suffix $dest$t$suffix # libquadmath headers need to be available in the gcc libexec dir install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ + # install LTO linker plugins where binutils tools can find it + install -d ${D}${libdir}/bfd-plugins + ln -sf ${LIBRELPATH}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so + chown -R root:root ${D} - + cross_canadian_bindirlinks + + for i in linux ${CANADIANEXTRAOS} + do + for v in ${CANADIANEXTRAVENDOR} + do + d=${D}${bindir}/../${TARGET_ARCH}$v-$i + install -d $d + for j in ${TARGET_PREFIX}gcc${EXEEXT} ${TARGET_PREFIX}g++${EXEEXT} + do + p=${TARGET_ARCH}$v-$i-`echo $j | sed -e s,${TARGET_PREFIX},,` + case $i in + *musl*) + rm -rf $d/$p + echo "#!/usr/bin/env sh" > $d/$p + echo "exec \`dirname \$0\`/../${TARGET_SYS}/$j -mmusl \$@" >> $d/$p + chmod 0755 $d/$p + ;; + *) + ;; + esac + done + done + done + + cleanup_installed_include_fixed } ELFUTILS = "nativesdk-elfutils" -DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib" -RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" +DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib nativesdk-zstd" +RDEPENDS:${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}" SYSTEMHEADERS = "${target_includedir}/" SYSTEMLIBS = "${target_base_libdir}/" SYSTEMLIBS1 = "${target_libdir}/" EXTRA_OECONF += "--enable-poison-system-directories" -EXTRA_OECONF_remove_elf = "--with-sysroot=/not/exist" -EXTRA_OECONF_remove_eabi = "--with-sysroot=/not/exist" -EXTRA_OECONF_append_elf = "--without-headers --with-newlib" -EXTRA_OECONF_append_eabi = "--without-headers --with-newlib" + # gcc 4.7 needs -isystem export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}" |