summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross-canadian.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian.inc72
1 files changed, 43 insertions, 29 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 6d77620dfa..ec87b46219 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -3,12 +3,13 @@ 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-${HOST_PREFIX}libc-for-gcc nativesdk-gettext"
+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-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
@@ -45,6 +46,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}"
@@ -63,12 +67,9 @@ do_compile () {
(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 +79,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 +97,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 +113,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,29 +128,54 @@ 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
}
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}/"
@@ -160,14 +183,5 @@ SYSTEMLIBS1 = "${target_libdir}/"
EXTRA_OECONF += "--enable-poison-system-directories"
-EXTRA_OECONF += "\
- --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
- --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix} \
-"
-
-EXTRA_OECONF_append_libc-baremetal = " --without-headers"
-EXTRA_OECONF_remove_libc-baremetal = "--with-sysroot=/not/exist"
-EXTRA_OECONF_remove_libc-baremetal = "--with-build-sysroot=${STAGING_DIR_TARGET}"
-
# gcc 4.7 needs -isystem
export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"