summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone/recipes-devtools/gcc
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2020-02-10 19:43:59 -0800
committerMark Hatle <mark.hatle@xilinx.com>2020-02-10 20:24:58 -0800
commit4463b26653f0e1a21ed6f4755b83132153f3a4e5 (patch)
tree563a552e5901c5db7e318ea561cb945ce2152bb2 /meta-xilinx-standalone/recipes-devtools/gcc
parent06d46fd55343516fc079bec688c993a5382cd0d3 (diff)
downloadmeta-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')
-rw-r--r--meta-xilinx-standalone/recipes-devtools/gcc/gcc-9/additional-microblaze-multilibs.patch84
-rw-r--r--meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend5
-rwxr-xr-xmeta-xilinx-standalone/recipes-devtools/gcc/mb-convert-head.sh16
-rwxr-xr-xmeta-xilinx-standalone/recipes-devtools/gcc/mb-convert.sh60
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 @@
1Change the multilib settings to match the expectations of Vitis and related.
2
3The multilib list is as follows:
4
5.;
6le;@mlittle-endian
7bs;@mxl-barrel-shift
8p;@mxl-pattern-compare
9m;@mno-xl-soft-mul
10fpd;@mhard-float
11m/fpd;@mno-xl-soft-mul@mhard-float
12p/m;@mxl-pattern-compare@mno-xl-soft-mul
13p/fpd;@mxl-pattern-compare@mhard-float
14p/m/fpd;@mxl-pattern-compare@mno-xl-soft-mul@mhard-float
15bs/p;@mxl-barrel-shift@mxl-pattern-compare
16bs/m;@mxl-barrel-shift@mno-xl-soft-mul
17bs/fpd;@mxl-barrel-shift@mhard-float
18bs/m/fpd;@mxl-barrel-shift@mno-xl-soft-mul@mhard-float
19bs/p/m;@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul
20bs/p/fpd;@mxl-barrel-shift@mxl-pattern-compare@mhard-float
21bs/p/m/fpd;@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float
22le/m64;@mlittle-endian@m64
23le/bs;@mlittle-endian@mxl-barrel-shift
24le/p;@mlittle-endian@mxl-pattern-compare
25le/m;@mlittle-endian@mno-xl-soft-mul
26le/fpd;@mlittle-endian@mhard-float
27le/m/fpd;@mlittle-endian@mno-xl-soft-mul@mhard-float
28le/p/m;@mlittle-endian@mxl-pattern-compare@mno-xl-soft-mul
29le/p/fpd;@mlittle-endian@mxl-pattern-compare@mhard-float
30le/p/m/fpd;@mlittle-endian@mxl-pattern-compare@mno-xl-soft-mul@mhard-float
31le/bs/p;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare
32le/bs/m;@mlittle-endian@mxl-barrel-shift@mno-xl-soft-mul
33le/bs/fpd;@mlittle-endian@mxl-barrel-shift@mhard-float
34le/bs/m/fpd;@mlittle-endian@mxl-barrel-shift@mno-xl-soft-mul@mhard-float
35le/bs/p/m;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul
36le/bs/p/fpd;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mhard-float
37le/bs/p/m/fpd;@mlittle-endian@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float
38le/m64/bs;@mlittle-endian@m64@mxl-barrel-shift
39le/m64/p;@mlittle-endian@m64@mxl-pattern-compare
40le/m64/m;@mlittle-endian@m64@mno-xl-soft-mul
41le/m64/fpd;@mlittle-endian@m64@mhard-float
42le/m64/m/fpd;@mlittle-endian@m64@mno-xl-soft-mul@mhard-float
43le/m64/p/m;@mlittle-endian@m64@mxl-pattern-compare@mno-xl-soft-mul
44le/m64/p/fpd;@mlittle-endian@m64@mxl-pattern-compare@mhard-float
45le/m64/p/m/fpd;@mlittle-endian@m64@mxl-pattern-compare@mno-xl-soft-mul@mhard-float
46le/m64/bs/p;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare
47le/m64/bs/m;@mlittle-endian@m64@mxl-barrel-shift@mno-xl-soft-mul
48le/m64/bs/fpd;@mlittle-endian@m64@mxl-barrel-shift@mhard-float
49le/m64/bs/m/fpd;@mlittle-endian@m64@mxl-barrel-shift@mno-xl-soft-mul@mhard-float
50le/m64/bs/p/m;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul
51le/m64/bs/p/fpd;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mhard-float
52le/m64/bs/p/m/fpd;@mlittle-endian@m64@mxl-barrel-shift@mxl-pattern-compare@mno-xl-soft-mul@mhard-float
53
54As part of this the order of the multilibs was changes from upstream to make
55it easier to avoid big-endian m64, which is not supported by the toolchain.
56
57Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
58
59diff -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)
2FILESEXTRAPATHS_append_microblaze_xilinx-standalone := "${THISDIR}/gcc-9:"
3SRC_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
8sed -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
8mlib_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
32sed -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