diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2024-07-16 08:48:05 -0600 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2024-07-17 10:50:39 -0500 |
| commit | d7ef33e13555cca4c388cd3eea656f11190ebdb8 (patch) | |
| tree | 81df01979c3ba711a839e008a86c8d60ccd3e08e /meta-vitis-tc/recipes-devtools/gcc/mb-convert.sh | |
| parent | 3958e8ed2cbbc58cbb404785c39d3d9068e65bdf (diff) | |
| download | meta-xilinx-d7ef33e13555cca4c388cd3eea656f11190ebdb8.tar.gz | |
meta-vitis-tc: Create new layer from meta-petalinux as of 2024.1
These components are used to build SDKs that are often shipped with the
AMD Vitis and Vivado products.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
(cherry picked from commit 5f481ae55aa646b334e15e16ef826b8d42792edf)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-vitis-tc/recipes-devtools/gcc/mb-convert.sh')
| -rwxr-xr-x | meta-vitis-tc/recipes-devtools/gcc/mb-convert.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta-vitis-tc/recipes-devtools/gcc/mb-convert.sh b/meta-vitis-tc/recipes-devtools/gcc/mb-convert.sh new file mode 100755 index 00000000..ab689444 --- /dev/null +++ b/meta-vitis-tc/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 | ||
