diff options
Diffstat (limited to 'meta-xilinx/meta-xilinx-standalone/recipes-devtools')
14 files changed, 355 insertions, 0 deletions
diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-cross-canadian_%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-cross-canadian_%.bbappend new file mode 100644 index 000000000..5ba6039bd --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-cross-canadian_%.bbappend @@ -0,0 +1 @@ +require binutils-xilinx-standalone.inc diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-cross_%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-cross_%.bbappend new file mode 100644 index 000000000..5ba6039bd --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-cross_%.bbappend @@ -0,0 +1 @@ +require binutils-xilinx-standalone.inc diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-xilinx-standalone.inc b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-xilinx-standalone.inc new file mode 100644 index 000000000..ac5697362 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/binutils/binutils-xilinx-standalone.inc @@ -0,0 +1,19 @@ +LDGOLD_xilinx-standalone = "" +LDGOLD_ALTS_xilinx-standalone = "" + +EXTRA_OECONF_append_xilinx-standalone = " \ + --disable-gprof \ + --disable-shared \ + --enable-lto \ + --enable-static \ + --enable-multilib \ +" + +# CortexR5 and 32-bit arm are both "arm" +EXTRA_OECONF_append_xilinx-standalone_arm = " \ + --enable-interwork \ +" + +EXTRA_OECONF_append_xilinx-standalone_microblaze = " \ + --disable-initfini-array \ +" diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch new file mode 100644 index 000000000..3d520d0f9 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch @@ -0,0 +1,86 @@ +Change the multilib settings to match the expectations of Vitis and related. + +The multilib list is as follows: + +.; +le;@mlittle-endian +bs;@mxl-barrel-shift +p;@mxl-pattern-compare +m;@mno-xl-soft-mul +fpd;@mhard-float +m/fpd;@mno-xl-soft-mul@mhard-float +p/m;@mxl-pattern-compare@mno-xl-soft-mul +p/fpd;@mxl-pattern-compare@mhard-float +p/m/fpd;@mxl-pattern-compare@mno-xl-soft-mul@mhard-float +bs/p;@mxl-barrel-shift@mxl-pattern-compare +bs/m;@mxl-barrel-shift@mno-xl-soft-mul +bs/fpd;@mxl-barrel-shift@mhard-float +bs/m/fpd;@mxl-barrel-shift@mno-xl-soft-mul@mhard-float +bs/p/m;@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul +bs/p/fpd;@mxl-barrel-shift@mxl-pattern-compare@mhard-float +bs/p/m/fpd;@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float +le/m64;@mlittle-endian@m64 +le/bs;@mlittle-endian@mxl-barrel-shift +le/p;@mlittle-endian@mxl-pattern-compare +le/m;@mlittle-endian@mno-xl-soft-mul +le/fpd;@mlittle-endian@mhard-float +le/m/fpd;@mlittle-endian@mno-xl-soft-mul@mhard-float +le/p/m;@mlittle-endian@mxl-pattern-compare@mno-xl-soft-mul +le/p/fpd;@mlittle-endian@mxl-pattern-compare@mhard-float +le/p/m/fpd;@mlittle-endian@mxl-pattern-compare@mno-xl-soft-mul@mhard-float +le/bs/p;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare +le/bs/m;@mlittle-endian@mxl-barrel-shift@mno-xl-soft-mul +le/bs/fpd;@mlittle-endian@mxl-barrel-shift@mhard-float +le/bs/m/fpd;@mlittle-endian@mxl-barrel-shift@mno-xl-soft-mul@mhard-float +le/bs/p/m;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul +le/bs/p/fpd;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mhard-float +le/bs/p/m/fpd;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float +le/m64/bs;@mlittle-endian@m64@mxl-barrel-shift +le/m64/p;@mlittle-endian@m64@mxl-pattern-compare +le/m64/m;@mlittle-endian@m64@mno-xl-soft-mul +le/m64/fpd;@mlittle-endian@m64@mhard-float +le/m64/m/fpd;@mlittle-endian@m64@mno-xl-soft-mul@mhard-float +le/m64/p/m;@mlittle-endian@m64@mxl-pattern-compare@mno-xl-soft-mul +le/m64/p/fpd;@mlittle-endian@m64@mxl-pattern-compare@mhard-float +le/m64/p/m/fpd;@mlittle-endian@m64@mxl-pattern-compare@mno-xl-soft-mul@mhard-float +le/m64/bs/p;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare +le/m64/bs/m;@mlittle-endian@m64@mxl-barrel-shift@mno-xl-soft-mul +le/m64/bs/fpd;@mlittle-endian@m64@mxl-barrel-shift@mhard-float +le/m64/bs/m/fpd;@mlittle-endian@m64@mxl-barrel-shift@mno-xl-soft-mul@mhard-float +le/m64/bs/p/m;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul +le/m64/bs/p/fpd;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mhard-float +le/m64/bs/p/m/fpd;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float + +As part of this the order of the multilibs was changes from upstream to make +it easier to avoid big-endian m64, which is not supported by the toolchain. + +Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> + +Index: gcc-9.2.0/gcc/config/microblaze/t-microblaze +=================================================================== +--- gcc-9.2.0.orig/gcc/config/microblaze/t-microblaze ++++ gcc-9.2.0/gcc/config/microblaze/t-microblaze +@@ -1,17 +1,11 @@ +-MULTILIB_OPTIONS = m64 mxl-barrel-shift mlittle-endian mno-xl-soft-mul mxl-multiply-high +-#MULTILIB_DIRNAMES = m64 bs le m mh +-MULTILIB_DIRNAMES = . . . . . +-MULTILIB_EXCEPTIONS = *m64/mxl-multiply-high mxl-multiply-high +-MULTILIB_EXCEPTIONS += *m64 +-MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift +-MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul +-MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul +-MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul +-MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul/mxl-multiply-high +-MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul/mxl-multiply-high ++MULTILIB_OPTIONS = mlittle-endian m64 mxl-barrel-shift mxl-pattern-compare mno-xl-soft-mul mhard-float ++MULTILIB_DIRNAMES = le m64 bs p m fpd ++MULTILIB_EXCEPTIONS = mxl-multiply-high + MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high + MULTILIB_EXCEPTIONS += *mlittle-endian/mxl-multiply-high mxl-multiply-high +-MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mlittle-endian/mxl-multiply-high ++MULTILIB_EXCEPTIONS += *mxl-pattern-compare*/*mxl-multiply-high* ++# Big endian m64 is not supported ++MULTILIB_EXCEPTIONS += m64* + + # Extra files + microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \ diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-configure-xilinx-standalone.inc b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-configure-xilinx-standalone.inc new file mode 100644 index 000000000..b9bfe83dd --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-configure-xilinx-standalone.inc @@ -0,0 +1,7 @@ +# Mimic the file gcc-configure-common from the Yocto Project +LINKER_HASH_STYLE_xilinx-standalone = "" +SYMVERS_CONF_xilinx-standalone = "" + +EXTRA_OECONF_append_xilinx-standalone_microblaze = " --disable-initfini_array" + +EXTRA_OECONF_append_xilinx-standalone_microblaze = " --disable-__cxa_atexit" diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-cross-canadian_%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-cross-canadian_%.bbappend new file mode 100644 index 000000000..152348486 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-cross-canadian_%.bbappend @@ -0,0 +1,20 @@ +require gcc-configure-xilinx-standalone.inc +require gcc-xilinx-standalone.inc + +# We want to use the stock multilib configs, when available +EXTRACONFFUNCS_xilinx-standalone = "" + +EXTRA_OECONF_append_xilinx-standalone = " \ + --enable-multilib \ +" + +# Temporary hack to build gcc cross canadian for tclibc-newlib as --with-sysroot=/not/exist +# has been removed from TARGET_OS for elf and eabi in gcc-cross-canadian.inc + +python() { + if 'xilinx-standalone' in d.getVar("DISTROOVERRIDES").split(':'): + extraoeconfgcc = d.getVar('EXTRA_OECONF') + extraoeconfgcc += " --with-sysroot=/not/exist" + d.delVar('EXTRA_OECONF') + d.setVar('EXTRA_OECONF', extraoeconfgcc) +} diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-cross_%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-cross_%.bbappend new file mode 100644 index 000000000..22a3e3a9b --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-cross_%.bbappend @@ -0,0 +1,6 @@ +require gcc-configure-xilinx-standalone.inc +require gcc-xilinx-standalone.inc + +# We want to use the stock multilib configs, when available +EXTRACONFFUNCS_xilinx-standalone = "" + diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend new file mode 100644 index 000000000..7057a0576 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend @@ -0,0 +1,74 @@ +require gcc-configure-xilinx-standalone.inc + +COMPATIBLE_HOST = "${HOST_SYS}" + +EXTRA_OECONF_append_xilinx-standalone_class-target = " \ + --disable-libstdcxx-pch \ + --with-newlib \ + --disable-threads \ + --enable-plugins \ + --with-gnu-as \ + --disable-libitm \ +" + +EXTRA_OECONF_append_xilinx-standalone_aarch64_class-target = " \ + --disable-multiarch \ + --with-arch=armv8-a \ + " + +# Both arm and armrm overrides are set w/ cortex r5 +# So only set rmprofile if armrm is defined. +ARM_PROFILE = "aprofile" +ARM_PROFILE_armrm = "rmprofile" + +EXTRA_OECONF_append_xilinx-standalone_arm_class-target = " \ + --with-multilib-list=${ARM_PROFILE} \ + " + +EXTRA_OECONF_append_xilinx-standalone_armrm_class-target = " \ + --disable-tls \ + --disable-decimal-float \ + " + +EXTRA_OECONF_append_xilinx-standalone_microblaze_class-target = " \ + --enable-target-optspace \ + --without-long-double-128 \ + " + +# Changes local to gcc-runtime... + +# Dont build libitm, etc. +RUNTIMETARGET_xilinx-standalone_class-target = "libstdc++-v3" + +do_install_append_xilinx-standalone_class-target() { + # Fixup what gcc-runtime normally would do, we don't want linux directories! + rm -rf ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux + + # The multilibs have different headers, so stop combining them! + if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then + rm -rf ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS} + fi + + # link the C++ header into the place that multilib gcc expects + # C++ compiler looks at usr/include/c++/version/canonical-arch/mlib + if [ "${TARGET_SYS_MULTILIB_ORIGINAL}" != "" -a "${TARGET_SYS_MULTILIB_ORIGINAL}" != "${TARGET_SYS}" ]; then + mlib=${BASE_LIB_tune-${DEFAULTTUNE}} + mlib=${mlib##lib/} + + link_name=${D}${includedir}/c++/${BINV}/${TARGET_SYS_MULTILIB_ORIGINAL}/${mlib} + target=${D}${includedir}/c++/${BINV}/${TARGET_SYS} + + echo mkdir -p $link_name + mkdir -p $link_name + for each in bits ext ; do + relpath=$(python3 -c "import os.path; print(os.path.relpath('$target/$each', '$(dirname $link_name/$each)'))") + + echo ln -s $relpath $link_name/$each + ln -s $relpath $link_name/$each + done + fi +} + +FILES_${PN}-dbg_append_xilinx-standalone_class-target = "\ + ${libdir}/libstdc++.a-gdb.py \ +" diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend new file mode 100644 index 000000000..6a4a8c5a3 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend @@ -0,0 +1,7 @@ +COMPATIBLE_HOST = "${HOST_SYS}" + +# Add MicroBlaze Patches (only when using MicroBlaze) +FILESEXTRAPATHS_append_microblaze_xilinx-standalone := ":${THISDIR}/gcc-9" +SRC_URI_append_microblaze_xilinx-standalone = " \ + file://additional-microblaze-multilibs.patch \ +" diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-xilinx-standalone.inc b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-xilinx-standalone.inc new file mode 100644 index 000000000..29f67aff2 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/gcc-xilinx-standalone.inc @@ -0,0 +1,31 @@ +EXTRA_OECONF_append_xilinx-standalone = " \ + --disable-libstdcxx-pch \ + --with-newlib \ + --disable-threads \ + --enable-plugins \ + --with-gnu-as \ + --disable-libitm \ +" + +EXTRA_OECONF_append_xilinx-standalone_aarch64 = " \ + --disable-multiarch \ + --with-arch=armv8-a \ + " + +# Both arm and armrm overrides are set w/ cortex r5 +# So only set rmprofile if armrm is defined. +ARM_PROFILE = "aprofile" +ARM_PROFILE_armrm = "rmprofile" +EXTRA_OECONF_append_xilinx-standalone_arm = " \ + --with-multilib-list=${ARM_PROFILE} \ + " + +EXTRA_OECONF_append_xilinx-standalone_armrm = " \ + --disable-tls \ + --disable-decimal-float \ + " + +EXTRA_OECONF_append_xilinx-standalone_microblaze = " \ + --enable-target-optspace \ + --without-long-double-128 \ + " diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend new file mode 100644 index 000000000..e80b0b79f --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend @@ -0,0 +1,26 @@ +require gcc-configure-xilinx-standalone.inc + +COMPATIBLE_HOST = "${HOST_SYS}" + +python do_multilib_install_xilinx-standalone_class-target () { + pass +} + +standalone_fixup () { + ( + cd ${D}${libdir} + for each in ${TARGET_SYS}/*/* ; do + ln -s $each $(basename $each) + done + ) +} + +FIXUP_FUNCTION = "" +FIXUP_FUNCTION_xilinx-standalone_class-target = " standalone_fixup" + +do_install[postfuncs] .= "${FIXUP_FUNCTION}" + +FILES_${PN}-dev_append_xilinx-standalone_class-target = " \ + ${libdir}/*.a \ + ${libdir}/*.o \ +" diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh new file mode 100755 index 000000000..b59dff1e0 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh @@ -0,0 +1,16 @@ +#! /bin/bash + +# Call using: +#../microblaze/sysroots/x86_64-oesdk-linux/usr/bin/microblaze-xilinx-elf/microblaze-xilinx-elf-gcc -print-multi-lib | mb-convert-head.sh + +# Then copy the output into the special microblaze-tc BSP + +sed -e 's,;, ,' | + while read mlib args ; do + if [ $mlib = '.' ]; then + continue + fi + multilib="libmb$(echo $mlib | sed -e 's,/,,g')" + + echo 'MULTILIBS += "multilib:'${multilib}'"' + done diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh new file mode 100755 index 000000000..e05145ec4 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh @@ -0,0 +1,60 @@ +#! /bin/bash + +# Call using: +#../microblaze/sysroots/x86_64-oesdk-linux/usr/bin/microblaze-xilinx-elf/microblaze-xilinx-elf-gcc -print-multi-lib | mb-convert.sh + +# Then copy the output into the special microblaze-tc BSP + +mlib_to_feature() { + feature_base="microblaze" + feature_endian=" bigendian" + feature_barrel="" + feature_pattern="" + feature_multiply="" + feature_multiplyhigh="" + feature_sixtyfour="" + feature_math="" + while read feature ; do + case $feature in + le) feature_endian="";; + bs) feature_barrel=" barrel-shift";; + p) feature_pattern=" pattern-compare";; + m) if [ -z ${feature_multiplyhigh} ]; then feature_multiply=" multiply-low" ; fi ;; + mh) feature_multiply="" ; feature_multiplyhigh=" multiply-high";; + m64) feature_sixtyfour=" 64-bit";; + fpd) feature_math=" fpu-hard";; + *) echo "UNKNOWN $feature";; + esac + done + echo "${feature_base}${feature_sixtyfour}${feature_endian}${feature_barrel}${feature_pattern}${feature_multiply}${feature_multiplyhigh}${feature_math}" +} + +sed -e 's,;, ,' | + while read mlib args ; do + if [ $mlib = '.' ]; then + echo '# Base configuration' + echo '# CFLAGS:' + echo 'DEFAULTTUNE = "microblaze"' + echo + echo 'AVAILTUNES += "microblaze"' + echo 'BASE_LIB_tune-microblaze = "lib"' + echo 'TUNE_FEATURES_tune-microblaze = "microblaze bigendian"' + echo 'PACKAGE_EXTRA_ARCHS_tune-microblaze = "${TUNE_PKGARCH}"' + continue + fi + + cflags=$(echo $args | sed -e 's,@, -,g') + multilib="libmb$(echo $mlib | sed -e 's,/,,g')" + tune="microblaze$(echo $mlib | sed -e 's,m64,64,' -e 's,/,,g')" + features=$(echo $mlib | sed -e 's,/, ,g' | xargs -n 1 echo | mlib_to_feature) + echo + echo + echo "# $mlib" + echo "# CFLAGS:${cflags}" + echo "DEFAULTTUNE_virtclass-multilib-$multilib = \"$tune\"" + echo + echo "AVAILTUNES += \"$tune\"" + echo "BASE_LIB_tune-$tune = \"lib/$mlib\"" + echo "TUNE_FEATURES_tune-$tune = \"${features}\"" + echo "PACKAGE_EXTRA_ARCHS_tune-$tune = \"\${TUNE_PKGARCH}\"" + done diff --git a/meta-xilinx/meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend new file mode 100644 index 000000000..0d8243241 --- /dev/null +++ b/meta-xilinx/meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend @@ -0,0 +1 @@ +COMPATIBLE_HOST = "${HOST_SYS}" |