diff options
| author | Mark Hatle <mark.hatle@xilinx.com> | 2020-02-10 19:43:59 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@xilinx.com> | 2020-02-10 20:24:58 -0800 |
| commit | 4463b26653f0e1a21ed6f4755b83132153f3a4e5 (patch) | |
| tree | 563a552e5901c5db7e318ea561cb945ce2152bb2 /meta-xilinx-standalone/recipes-devtools/gcc | |
| parent | 06d46fd55343516fc079bec688c993a5382cd0d3 (diff) | |
| download | meta-xilinx-4463b26653f0e1a21ed6f4755b83132153f3a4e5.tar.gz | |
Adjust the microblaze standalone toolchain to match vitis expectations.
Enable the following multilibs:
.
le
bs
p
m
fpd
m/fpd
p/m
p/fpd
p/m/fpd
bs/p
bs/m
bs/fpd
bs/m/fpd
bs/p/m
bs/p/fpd
bs/p/m/fpd
le/m64
le/bs
le/p
le/m
le/fpd
le/m/fpd
le/p/m
le/p/fpd
le/p/m/fpd
le/bs/p
le/bs/m
le/bs/fpd
le/bs/m/fpd
le/bs/p/m
le/bs/p/fpd
le/bs/p/m/fpd
le/m64/bs
le/m64/p
le/m64/m
le/m64/fpd
le/m64/m/fpd
le/m64/p/m
le/m64/p/fpd
le/m64/p/m/fpd
le/m64/bs/p
le/m64/bs/m
le/m64/bs/fpd
le/m64/bs/m/fpd
le/m64/bs/p/m
le/m64/bs/p/fpd
le/m64/bs/p/m/fpd
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-standalone/recipes-devtools/gcc')
4 files changed, 165 insertions, 0 deletions
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch new file mode 100644 index 00000000..a32045bc --- /dev/null +++ b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | Change the multilib settings to match the expectations of Vitis and related. | ||
| 2 | |||
| 3 | The multilib list is as follows: | ||
| 4 | |||
| 5 | .; | ||
| 6 | le;@mlittle-endian | ||
| 7 | bs;@mxl-barrel-shift | ||
| 8 | p;@mxl-pattern-compare | ||
| 9 | m;@mno-xl-soft-mul | ||
| 10 | fpd;@mhard-float | ||
| 11 | m/fpd;@mno-xl-soft-mul@mhard-float | ||
| 12 | p/m;@mxl-pattern-compare@mno-xl-soft-mul | ||
| 13 | p/fpd;@mxl-pattern-compare@mhard-float | ||
| 14 | p/m/fpd;@mxl-pattern-compare@mno-xl-soft-mul@mhard-float | ||
| 15 | bs/p;@mxl-barrel-shift@mxl-pattern-compare | ||
| 16 | bs/m;@mxl-barrel-shift@mno-xl-soft-mul | ||
| 17 | bs/fpd;@mxl-barrel-shift@mhard-float | ||
| 18 | bs/m/fpd;@mxl-barrel-shift@mno-xl-soft-mul@mhard-float | ||
| 19 | bs/p/m;@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul | ||
| 20 | bs/p/fpd;@mxl-barrel-shift@mxl-pattern-compare@mhard-float | ||
| 21 | bs/p/m/fpd;@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float | ||
| 22 | le/m64;@mlittle-endian@m64 | ||
| 23 | le/bs;@mlittle-endian@mxl-barrel-shift | ||
| 24 | le/p;@mlittle-endian@mxl-pattern-compare | ||
| 25 | le/m;@mlittle-endian@mno-xl-soft-mul | ||
| 26 | le/fpd;@mlittle-endian@mhard-float | ||
| 27 | le/m/fpd;@mlittle-endian@mno-xl-soft-mul@mhard-float | ||
| 28 | le/p/m;@mlittle-endian@mxl-pattern-compare@mno-xl-soft-mul | ||
| 29 | le/p/fpd;@mlittle-endian@mxl-pattern-compare@mhard-float | ||
| 30 | le/p/m/fpd;@mlittle-endian@mxl-pattern-compare@mno-xl-soft-mul@mhard-float | ||
| 31 | le/bs/p;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare | ||
| 32 | le/bs/m;@mlittle-endian@mxl-barrel-shift@mno-xl-soft-mul | ||
| 33 | le/bs/fpd;@mlittle-endian@mxl-barrel-shift@mhard-float | ||
| 34 | le/bs/m/fpd;@mlittle-endian@mxl-barrel-shift@mno-xl-soft-mul@mhard-float | ||
| 35 | le/bs/p/m;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul | ||
| 36 | le/bs/p/fpd;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mhard-float | ||
| 37 | le/bs/p/m/fpd;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float | ||
| 38 | le/m64/bs;@mlittle-endian@m64@mxl-barrel-shift | ||
| 39 | le/m64/p;@mlittle-endian@m64@mxl-pattern-compare | ||
| 40 | le/m64/m;@mlittle-endian@m64@mno-xl-soft-mul | ||
| 41 | le/m64/fpd;@mlittle-endian@m64@mhard-float | ||
| 42 | le/m64/m/fpd;@mlittle-endian@m64@mno-xl-soft-mul@mhard-float | ||
| 43 | le/m64/p/m;@mlittle-endian@m64@mxl-pattern-compare@mno-xl-soft-mul | ||
| 44 | le/m64/p/fpd;@mlittle-endian@m64@mxl-pattern-compare@mhard-float | ||
| 45 | le/m64/p/m/fpd;@mlittle-endian@m64@mxl-pattern-compare@mno-xl-soft-mul@mhard-float | ||
| 46 | le/m64/bs/p;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare | ||
| 47 | le/m64/bs/m;@mlittle-endian@m64@mxl-barrel-shift@mno-xl-soft-mul | ||
| 48 | le/m64/bs/fpd;@mlittle-endian@m64@mxl-barrel-shift@mhard-float | ||
| 49 | le/m64/bs/m/fpd;@mlittle-endian@m64@mxl-barrel-shift@mno-xl-soft-mul@mhard-float | ||
| 50 | le/m64/bs/p/m;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul | ||
| 51 | le/m64/bs/p/fpd;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mhard-float | ||
| 52 | le/m64/bs/p/m/fpd;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float | ||
| 53 | |||
| 54 | As part of this the order of the multilibs was changes from upstream to make | ||
| 55 | it easier to avoid big-endian m64, which is not supported by the toolchain. | ||
| 56 | |||
| 57 | Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> | ||
| 58 | |||
| 59 | diff -ur gcc-9.2.0.orig/gcc/config/microblaze/t-microblaze gcc-9.2.0/gcc/config/microblaze/t-microblaze | ||
| 60 | --- gcc-9.2.0.orig/gcc/config/microblaze/t-microblaze 2020-02-07 09:46:48.286261214 -0800 | ||
| 61 | +++ gcc-9.2.0/gcc/config/microblaze/t-microblaze 2020-02-10 17:07:52.440598949 -0800 | ||
| 62 | @@ -1,16 +1,11 @@ | ||
| 63 | -MULTILIB_OPTIONS = m64 mxl-barrel-shift mlittle-endian mno-xl-soft-mul mxl-multiply-high | ||
| 64 | -MULTILIB_DIRNAMES = m64 bs le m mh | ||
| 65 | -MULTILIB_EXCEPTIONS = *m64/mxl-multiply-high mxl-multiply-high | ||
| 66 | -MULTILIB_EXCEPTIONS += *m64 | ||
| 67 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift | ||
| 68 | -MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul | ||
| 69 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul | ||
| 70 | -MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul | ||
| 71 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul/mxl-multiply-high | ||
| 72 | -MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul/mxl-multiply-high | ||
| 73 | +MULTILIB_OPTIONS = mlittle-endian m64 mxl-barrel-shift mxl-pattern-compare mno-xl-soft-mul mhard-float | ||
| 74 | +MULTILIB_DIRNAMES = le m64 bs p m fpd | ||
| 75 | +MULTILIB_EXCEPTIONS = mxl-multiply-high | ||
| 76 | MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high | ||
| 77 | MULTILIB_EXCEPTIONS += *mlittle-endian/mxl-multiply-high mxl-multiply-high | ||
| 78 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mlittle-endian/mxl-multiply-high | ||
| 79 | +MULTILIB_EXCEPTIONS += *mxl-pattern-compare*/*mxl-multiply-high* | ||
| 80 | +# Big endian m64 is not supported | ||
| 81 | +MULTILIB_EXCEPTIONS += m64* | ||
| 82 | |||
| 83 | # Extra files | ||
| 84 | microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \ | ||
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend new file mode 100644 index 00000000..24abdc11 --- /dev/null +++ b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # Add MicroBlaze Patches (only when using MicroBlaze) | ||
| 2 | FILESEXTRAPATHS_append_microblaze_xilinx-standalone := "${THISDIR}/gcc-9:" | ||
| 3 | SRC_URI_append_microblaze_xilinx-standalone = " \ | ||
| 4 | file://additional-microblaze-multilibs.patch \ | ||
| 5 | " | ||
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh b/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh new file mode 100755 index 00000000..b59dff1e --- /dev/null +++ b/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | # Call using: | ||
| 4 | #../microblaze/sysroots/x86_64-oesdk-linux/usr/bin/microblaze-xilinx-elf/microblaze-xilinx-elf-gcc -print-multi-lib | mb-convert-head.sh | ||
| 5 | |||
| 6 | # Then copy the output into the special microblaze-tc BSP | ||
| 7 | |||
| 8 | sed -e 's,;, ,' | | ||
| 9 | while read mlib args ; do | ||
| 10 | if [ $mlib = '.' ]; then | ||
| 11 | continue | ||
| 12 | fi | ||
| 13 | multilib="libmb$(echo $mlib | sed -e 's,/,,g')" | ||
| 14 | |||
| 15 | echo 'MULTILIBS += "multilib:'${multilib}'"' | ||
| 16 | done | ||
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh b/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh new file mode 100755 index 00000000..e05145ec --- /dev/null +++ b/meta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | # Call using: | ||
| 4 | #../microblaze/sysroots/x86_64-oesdk-linux/usr/bin/microblaze-xilinx-elf/microblaze-xilinx-elf-gcc -print-multi-lib | mb-convert.sh | ||
| 5 | |||
| 6 | # Then copy the output into the special microblaze-tc BSP | ||
| 7 | |||
| 8 | mlib_to_feature() { | ||
| 9 | feature_base="microblaze" | ||
| 10 | feature_endian=" bigendian" | ||
| 11 | feature_barrel="" | ||
| 12 | feature_pattern="" | ||
| 13 | feature_multiply="" | ||
| 14 | feature_multiplyhigh="" | ||
| 15 | feature_sixtyfour="" | ||
| 16 | feature_math="" | ||
| 17 | while read feature ; do | ||
| 18 | case $feature in | ||
| 19 | le) feature_endian="";; | ||
| 20 | bs) feature_barrel=" barrel-shift";; | ||
| 21 | p) feature_pattern=" pattern-compare";; | ||
| 22 | m) if [ -z ${feature_multiplyhigh} ]; then feature_multiply=" multiply-low" ; fi ;; | ||
| 23 | mh) feature_multiply="" ; feature_multiplyhigh=" multiply-high";; | ||
| 24 | m64) feature_sixtyfour=" 64-bit";; | ||
| 25 | fpd) feature_math=" fpu-hard";; | ||
| 26 | *) echo "UNKNOWN $feature";; | ||
| 27 | esac | ||
| 28 | done | ||
| 29 | echo "${feature_base}${feature_sixtyfour}${feature_endian}${feature_barrel}${feature_pattern}${feature_multiply}${feature_multiplyhigh}${feature_math}" | ||
| 30 | } | ||
| 31 | |||
| 32 | sed -e 's,;, ,' | | ||
| 33 | while read mlib args ; do | ||
| 34 | if [ $mlib = '.' ]; then | ||
| 35 | echo '# Base configuration' | ||
| 36 | echo '# CFLAGS:' | ||
| 37 | echo 'DEFAULTTUNE = "microblaze"' | ||
| 38 | echo | ||
| 39 | echo 'AVAILTUNES += "microblaze"' | ||
| 40 | echo 'BASE_LIB_tune-microblaze = "lib"' | ||
| 41 | echo 'TUNE_FEATURES_tune-microblaze = "microblaze bigendian"' | ||
| 42 | echo 'PACKAGE_EXTRA_ARCHS_tune-microblaze = "${TUNE_PKGARCH}"' | ||
| 43 | continue | ||
| 44 | fi | ||
| 45 | |||
| 46 | cflags=$(echo $args | sed -e 's,@, -,g') | ||
| 47 | multilib="libmb$(echo $mlib | sed -e 's,/,,g')" | ||
| 48 | tune="microblaze$(echo $mlib | sed -e 's,m64,64,' -e 's,/,,g')" | ||
| 49 | features=$(echo $mlib | sed -e 's,/, ,g' | xargs -n 1 echo | mlib_to_feature) | ||
| 50 | echo | ||
| 51 | echo | ||
| 52 | echo "# $mlib" | ||
| 53 | echo "# CFLAGS:${cflags}" | ||
| 54 | echo "DEFAULTTUNE_virtclass-multilib-$multilib = \"$tune\"" | ||
| 55 | echo | ||
| 56 | echo "AVAILTUNES += \"$tune\"" | ||
| 57 | echo "BASE_LIB_tune-$tune = \"lib/$mlib\"" | ||
| 58 | echo "TUNE_FEATURES_tune-$tune = \"${features}\"" | ||
| 59 | echo "PACKAGE_EXTRA_ARCHS_tune-$tune = \"\${TUNE_PKGARCH}\"" | ||
| 60 | done | ||
