diff options
31 files changed, 2826 insertions, 0 deletions
diff --git a/meta-vitis-tc/COPYING.MIT b/meta-vitis-tc/COPYING.MIT new file mode 100644 index 00000000..7ba8e404 --- /dev/null +++ b/meta-vitis-tc/COPYING.MIT | |||
@@ -0,0 +1,19 @@ | |||
1 | Copyright (c) 2016 Xilinx Inc | ||
2 | |||
3 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
4 | of this software and associated documentation files (the "Software"), to deal | ||
5 | in the Software without restriction, including without limitation the rights | ||
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
7 | copies of the Software, and to permit persons to whom the Software is | ||
8 | furnished to do so, subject to the following conditions: | ||
9 | |||
10 | The above copyright notice and this permission notice shall be included in | ||
11 | all copies or substantial portions of the Software. | ||
12 | |||
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
19 | THE SOFTWARE. | ||
diff --git a/meta-vitis-tc/README.md b/meta-vitis-tc/README.md new file mode 100644 index 00000000..a3de1c2e --- /dev/null +++ b/meta-vitis-tc/README.md | |||
@@ -0,0 +1,42 @@ | |||
1 | # meta-vitis-tc | ||
2 | |||
3 | This layer is used to build various toolchains that may be embedded into | ||
4 | the AMD Vitis (and Vivado) products. | ||
5 | |||
6 | ## Dependencies | ||
7 | |||
8 | This layer depends on: | ||
9 | |||
10 | URI: https://git.yoctoproject.org/poky | ||
11 | layers: meta, meta-poky | ||
12 | branch: master | ||
13 | |||
14 | URI: https://git.openembedded.org/meta-xilinx | ||
15 | layers: meta-xilinx-core, meta-microblaze, meta-xilinx-standalone | ||
16 | branch: master | ||
17 | |||
18 | optionally, you may alwys want to include: | ||
19 | |||
20 | URI: https://git.yoctoproject.org/meta-mingw | ||
21 | layers: meta-mingw | ||
22 | branch: master | ||
23 | |||
24 | --- | ||
25 | |||
26 | ## Configuring Machines | ||
27 | |||
28 | Baremetal toolchains can be built using: | ||
29 | |||
30 | MACHINE=<toolchain> DISTRO=xilinx-standalone bitbake meta-xilinx-toolchain | ||
31 | |||
32 | The <toolchain> value should be one of: | ||
33 | aarch32-tc - 32-bit Cortex-A toolchains | ||
34 | aarch64-tc - 64-bit Cortex-A toolchains | ||
35 | arm-rm-tc - ARM Cortex-R and M toolchains | ||
36 | microblaze-tc - Microblaze toolchains | ||
37 | riscv-tc - Risc-V toolchains | ||
38 | |||
39 | |||
40 | Also there is a standalone QEMU SDK: | ||
41 | |||
42 | MACHINE=zynqmp-generic bitbake meta-qemu-xilinx | ||
diff --git a/meta-vitis-tc/classes/plnx-baremetal-toolchain-scripts.bbclass b/meta-vitis-tc/classes/plnx-baremetal-toolchain-scripts.bbclass new file mode 100644 index 00000000..540ae807 --- /dev/null +++ b/meta-vitis-tc/classes/plnx-baremetal-toolchain-scripts.bbclass | |||
@@ -0,0 +1,205 @@ | |||
1 | # | ||
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | # Based on the version in oe-core Langdale | ||
7 | # | ||
8 | # This is optimized specifically for baremetal builds where we have a single | ||
9 | # common toolchain for each multilib. This configuration is unique to | ||
10 | # petalinux prebuilt toolchains and thus not applicable upstream. | ||
11 | |||
12 | # This function creates an environment-setup-script for use in a deployable SDK | ||
13 | toolchain_create_sdk_env_script:xilinx-standalone () { | ||
14 | # Create environment setup script. Remember that $SDKTARGETSYSROOT should | ||
15 | # only be expanded on the target at runtime. | ||
16 | base_sbindir=${10:-${base_sbindir_nativesdk}} | ||
17 | base_bindir=${9:-${base_bindir_nativesdk}} | ||
18 | sbindir=${8:-${sbindir_nativesdk}} | ||
19 | sdkpathnative=${7:-${SDKPATHNATIVE}} | ||
20 | prefix=${6:-${prefix_nativesdk}} | ||
21 | bindir=${5:-${bindir_nativesdk}} | ||
22 | libdir=${4:-${libdir}} | ||
23 | sysroot=${3:-${SDKTARGETSYSROOT}} | ||
24 | multimach_target_sys=${2:-${REAL_MULTIMACH_TARGET_SYS}} | ||
25 | script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-$multimach_target_sys} | ||
26 | rm -f $script | ||
27 | touch $script | ||
28 | |||
29 | echo '# Check for LD_LIBRARY_PATH being set, which can break SDK and generally is a bad practice' >> $script | ||
30 | echo '# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80' >> $script | ||
31 | echo '# http://xahlee.info/UnixResource_dir/_/ldpath.html' >> $script | ||
32 | echo '# Only disable this check if you are absolutely know what you are doing!' >> $script | ||
33 | echo 'if [ ! -z "${LD_LIBRARY_PATH:-}" ]; then' >> $script | ||
34 | echo " echo \"Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH'\"" >> $script | ||
35 | echo " echo \"but please check why this was set in the first place and that it's safe to unset.\"" >> $script | ||
36 | echo ' echo "The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set."' >> $script | ||
37 | echo ' echo "For more references see:"' >> $script | ||
38 | echo ' echo " http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80"' >> $script | ||
39 | echo ' echo " http://xahlee.info/UnixResource_dir/_/ldpath.html"' >> $script | ||
40 | echo ' return 1' >> $script | ||
41 | echo 'fi' >> $script | ||
42 | |||
43 | echo "${EXPORT_SDK_PS1}" >> $script | ||
44 | echo 'export SDKTARGETSYSROOT='"$sysroot" >> $script | ||
45 | EXTRAPATH="" | ||
46 | for i in ${CANADIANEXTRAOS}; do | ||
47 | EXTRAPATH="$EXTRAPATH:$sdkpathnative$bindir/${ORIGINAL_TARGET_ARCH}${ORIGINAL_TARGET_VENDOR}-$i" | ||
48 | done | ||
49 | echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${ORIGINAL_TARGET_SYS}"$EXTRAPATH':$PATH' >> $script | ||
50 | echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script | ||
51 | echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig' >> $script | ||
52 | echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script | ||
53 | echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script | ||
54 | echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script | ||
55 | echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script | ||
56 | echo 'export OECORE_BASELIB="${baselib}"' >> $script | ||
57 | echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script | ||
58 | echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script | ||
59 | |||
60 | echo 'unset command_not_found_handle' >> $script | ||
61 | |||
62 | toolchain_shared_env_script | ||
63 | } | ||
64 | |||
65 | toolchain_shared_env_script:xilinx-standalone () { | ||
66 | echo 'export CC="${ORIGINAL_TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script | ||
67 | echo 'export CXX="${ORIGINAL_TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script | ||
68 | echo 'export CPP="${ORIGINAL_TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script | ||
69 | echo 'export AS="${ORIGINAL_TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script | ||
70 | echo 'export LD="${ORIGINAL_TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script | ||
71 | echo 'export GDB=${ORIGINAL_TARGET_PREFIX}gdb' >> $script | ||
72 | echo 'export STRIP=${ORIGINAL_TARGET_PREFIX}strip' >> $script | ||
73 | echo 'export RANLIB=${ORIGINAL_TARGET_PREFIX}ranlib' >> $script | ||
74 | echo 'export OBJCOPY=${ORIGINAL_TARGET_PREFIX}objcopy' >> $script | ||
75 | echo 'export OBJDUMP=${ORIGINAL_TARGET_PREFIX}objdump' >> $script | ||
76 | echo 'export READELF=${ORIGINAL_TARGET_PREFIX}readelf' >> $script | ||
77 | echo 'export AR=${ORIGINAL_TARGET_PREFIX}ar' >> $script | ||
78 | echo 'export NM=${ORIGINAL_TARGET_PREFIX}nm' >> $script | ||
79 | echo 'export M4=m4' >> $script | ||
80 | echo 'export TARGET_PREFIX=${ORIGINAL_TARGET_PREFIX}' >> $script | ||
81 | echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"' >> $script | ||
82 | echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script | ||
83 | echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script | ||
84 | echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script | ||
85 | echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script | ||
86 | echo 'export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"' >> $script | ||
87 | echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script | ||
88 | echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script | ||
89 | echo 'export ARCH=${ARCH}' >> $script | ||
90 | echo 'export CROSS_COMPILE=${ORIGINAL_TARGET_PREFIX}' >> $script | ||
91 | echo 'export OECORE_TUNE_CCARGS="${TUNE_CCARGS}"' >> $script | ||
92 | |||
93 | cat >> $script <<EOF | ||
94 | |||
95 | # Append environment subscripts | ||
96 | if [ -d "\$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then | ||
97 | for envfile in \$OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do | ||
98 | . \$envfile | ||
99 | done | ||
100 | fi | ||
101 | if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then | ||
102 | for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do | ||
103 | . \$envfile | ||
104 | done | ||
105 | fi | ||
106 | EOF | ||
107 | } | ||
108 | |||
109 | ##### | ||
110 | # Following is copied from meta-mingw/classes/toolchain-scripts-mingw32.bbclass | ||
111 | # Based off of the oe-core meta/classes/toolchain-scripts.bbclass version | ||
112 | toolchain_create_sdk_env_script:sdkmingw32:xilinx-standalone () { | ||
113 | # Create environment setup script | ||
114 | sdkpathnative=${7:-${SDKPATHNATIVE}} | ||
115 | prefix=${6:-${prefix_nativesdk}} | ||
116 | bindir=${5:-${bindir_nativesdk}} | ||
117 | libdir=${4:-${libdir}} | ||
118 | sysroot=${3:-${SDKTARGETSYSROOT}} | ||
119 | multimach_target_sys=${2:-${REAL_MULTIMACH_TARGET_SYS}} | ||
120 | script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-$multimach_target_sys}.bat | ||
121 | rm -f $script | ||
122 | touch $script | ||
123 | # Be sure to use the 'short' path, so we can have deeper directories. | ||
124 | echo 'set SDKROOT=%~sdp0%' >> $script | ||
125 | |||
126 | # Convert to mingw32 subpaths | ||
127 | sysroot='%SDKROOT%'${sysroot##${SDKPATH}} | ||
128 | sdkpathnative='%SDKROOT%'${sdkpathnative##${SDKPATH}} | ||
129 | |||
130 | echo 'set SDKTARGETSYSROOT='"$sysroot" >> $script | ||
131 | EXTRAPATH="" | ||
132 | for i in ${CANADIANEXTRAOS}; do | ||
133 | EXTRAPATH="$EXTRAPATH;$sdkpathnative$bindir/${ORIGINAL_TARGET_ARCH}${ORIGINAL_TARGET_VENDOR}-$i" | ||
134 | done | ||
135 | echo "set PATH=$sdkpathnative$bindir;$sdkpathnative$bindir/../${HOST_SYS}/bin;$sdkpathnative$bindir/${ORIGINAL_TARGET_SYS}"$EXTRAPATH';%PATH%' >> $script | ||
136 | echo 'set PKG_CONFIG_SYSROOT_DIR=%SDKTARGETSYSROOT%' >> $script | ||
137 | echo 'set PKG_CONFIG_PATH=%SDKTARGETSYSROOT%'"$libdir"'/pkgconfig' >> $script | ||
138 | echo 'set CONFIG_SITE=%SDKROOT%/site-config-'"${multimach_target_sys}" >> $script | ||
139 | echo "set OECORE_NATIVE_SYSROOT=$sdkpathnative" >> $script | ||
140 | echo 'set OECORE_TARGET_SYSROOT=%SDKTARGETSYSROOT%' >> $script | ||
141 | echo "set OECORE_ACLOCAL_OPTS=-I $sdkpathnative/usr/share/aclocal" >> $script | ||
142 | echo 'set OECORE_BASELIB=${baselib}' >> $script | ||
143 | echo 'set OECORE_TARGET_ARCH=${TARGET_ARCH}' >> $script | ||
144 | echo 'set OECORE_TARGET_OS=${TARGET_OS}' >> $script | ||
145 | |||
146 | toolchain_shared_env_script | ||
147 | |||
148 | # Change unix '/' to Win32 '\' | ||
149 | sed -e 's,/,\\,g' -i $script | ||
150 | |||
151 | # set has some annoying properties: | ||
152 | # 1) If it is successful %ERRORLEVEL% is unchanged (as opposed to being set | ||
153 | # to 0 to indicate success) | ||
154 | # 2) Making an assignment like "set A=" is considered an error and sets | ||
155 | # %ERRORLEVEL% to 1. | ||
156 | # | ||
157 | # Practically, this means that if any of the set calls make an empty | ||
158 | # assignment that error will be propagated. To prevent this, a command is | ||
159 | # run to ensure that the "exit code" of this script is 0 | ||
160 | echo "@%COMSPEC% /C exit 0 > NUL" >> $script | ||
161 | |||
162 | # Make the file windows friendly... | ||
163 | awk 'sub("$", "\r")' $script > $script.new | ||
164 | mv $script.new $script | ||
165 | } | ||
166 | |||
167 | toolchain_shared_env_script:sdkmingw32:xilinx-standalone () { | ||
168 | echo 'set CC=${ORIGINAL_TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=%SDKTARGETSYSROOT%' >> $script | ||
169 | echo 'set CXX=${ORIGINAL_TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=%SDKTARGETSYSROOT%' >> $script | ||
170 | echo 'set CPP=${ORIGINAL_TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=%SDKTARGETSYSROOT%' >> $script | ||
171 | echo 'set AS=${ORIGINAL_TARGET_PREFIX}as ${TARGET_AS_ARCH}' >> $script | ||
172 | echo 'set LD=${ORIGINAL_TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=%SDKTARGETSYSROOT%' >> $script | ||
173 | echo 'set GDB=${ORIGINAL_TARGET_PREFIX}gdb' >> $script | ||
174 | echo 'set STRIP=${ORIGINAL_TARGET_PREFIX}strip' >> $script | ||
175 | echo 'set RANLIB=${ORIGINAL_TARGET_PREFIX}ranlib' >> $script | ||
176 | echo 'set OBJCOPY=${ORIGINAL_TARGET_PREFIX}objcopy' >> $script | ||
177 | echo 'set OBJDUMP=${ORIGINAL_TARGET_PREFIX}objdump' >> $script | ||
178 | echo 'set AR=${ORIGINAL_TARGET_PREFIX}ar' >> $script | ||
179 | echo 'set NM=${ORIGINAL_TARGET_PREFIX}nm' >> $script | ||
180 | echo 'set M4=m4' >> $script | ||
181 | echo 'set TARGET_PREFIX=${ORIGINAL_TARGET_PREFIX}' >> $script | ||
182 | echo 'set CONFIGURE_FLAGS=--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=%SDKTARGETSYSROOT%' >> $script | ||
183 | echo 'set CFLAGS=${TARGET_CFLAGS}' >> $script | ||
184 | echo 'set CXXFLAGS=${TARGET_CXXFLAGS}' >> $script | ||
185 | echo 'set LDFLAGS=${TARGET_LDFLAGS}' >> $script | ||
186 | echo 'set CPPFLAGS=${TARGET_CPPFLAGS}' >> $script | ||
187 | echo 'set KCFLAGS=--sysroot=%SDKTARGETSYSROOT%' >> $script | ||
188 | echo 'set OECORE_DISTRO_VERSION=${DISTRO_VERSION}' >> $script | ||
189 | echo 'set OECORE_SDK_VERSION=${SDK_VERSION}' >> $script | ||
190 | echo 'set ARCH=${ARCH}' >> $script | ||
191 | echo 'set CROSS_COMPILE=${ORIGINAL_TARGET_PREFIX}' >> $script | ||
192 | |||
193 | cat >> $script <<EOF | ||
194 | |||
195 | @REM Append environment subscripts | ||
196 | |||
197 | @IF EXIST %OECORE_TARGET_SYSROOT%\\environment-setup.d ( | ||
198 | FOR %%x IN (%OECORE_TARGET_SYSROOT%\\environment-setup.d\\*.bat) DO call "%%x" | ||
199 | ) | ||
200 | |||
201 | @IF EXIST %OECORE_NATIVE_SYSROOT%\\environment-setup.d ( | ||
202 | FOR %%x IN (%OECORE_NATIVE_SYSROOT%\\environment-setup.d\\*.bat) DO call "%%x" | ||
203 | ) | ||
204 | EOF | ||
205 | } | ||
diff --git a/meta-vitis-tc/conf/layer.conf b/meta-vitis-tc/conf/layer.conf new file mode 100644 index 00000000..34913777 --- /dev/null +++ b/meta-vitis-tc/conf/layer.conf | |||
@@ -0,0 +1,23 @@ | |||
1 | # We have a conf and classes directory, add to BBPATH | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | # Keep layer path so recipes can reference it | ||
5 | VITIS_TC_PATH = "${LAYERDIR}" | ||
6 | |||
7 | # We have a packages directory, add to BBFILES | ||
8 | BBFILES += " \ | ||
9 | ${LAYERDIR}/recipes-*/*/*.bb \ | ||
10 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
11 | |||
12 | BBFILE_COLLECTIONS += "vitis-tc" | ||
13 | BBFILE_PRIORITY_vitis-tc = "6" | ||
14 | BBFILE_PATTERN_vitis-tc := "^${LAYERDIR}/" | ||
15 | |||
16 | LAYERDEPENDS_vitis-tc = "\ | ||
17 | core \ | ||
18 | xilinx \ | ||
19 | xilinx-microblaze \ | ||
20 | xilinx-standalone \ | ||
21 | " | ||
22 | |||
23 | LAYERSERIES_COMPAT_vitis-tc = "scarthgap" | ||
diff --git a/meta-vitis-tc/conf/machine/aarch32-tc.conf b/meta-vitis-tc/conf/machine/aarch32-tc.conf new file mode 100644 index 00000000..5b59bc6a --- /dev/null +++ b/meta-vitis-tc/conf/machine/aarch32-tc.conf | |||
@@ -0,0 +1,221 @@ | |||
1 | require conf/machine/include/machine-xilinx-qemu.inc | ||
2 | require conf/multilib.conf | ||
3 | require conf/machine/include/arm/armv7a/tune-cortexa9.inc | ||
4 | require conf/machine/include/baremetal-tc.conf | ||
5 | |||
6 | # Define all of the multilibs supproted by this configuration | ||
7 | MULTILIB_GLOBAL_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" | ||
8 | |||
9 | MULTILIBS = "multilib:libarmv5tesoftfp multilib:libarmv5tehard" | ||
10 | MULTILIBS += "multilib:libnofp" | ||
11 | MULTILIBS += "multilib:libv7nofp multilib:libv7fpsoftfp multilib:libv7fphard" | ||
12 | MULTILIBS += "multilib:libv7anofp" | ||
13 | MULTILIBS += "multilib:libv7afpsoftfp" | ||
14 | MULTILIBS += "multilib:libv7afpthf multilib:libv7asimdsoftfp" | ||
15 | MULTILIBS += "multilib:libv7asimdhard multilib:libv7vesimdsoftfp" | ||
16 | MULTILIBS += "multilib:libvtvesimdhf" | ||
17 | MULTILIBS += "multilib:libv8anofp" | ||
18 | MULTILIBS += "multilib:libv8asimdsoftfp multilib:libv8asimdhard" | ||
19 | |||
20 | TUNE_CCARGS = "${TUNE_CCARGS:tune-${DEFAULTTUNE}}" | ||
21 | TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}" | ||
22 | |||
23 | # Base configuration | ||
24 | # CFLAGS: | ||
25 | DEFAULTTUNE = "aarch32" | ||
26 | |||
27 | AVAILTUNES += "aarch32" | ||
28 | PACKAGE_EXTRA_ARCHS:tune-aarch32 = "${TUNE_PKGARCH:tune-aarch32}" | ||
29 | BASE_LIB:tune-aarch32 = "lib" | ||
30 | TUNE_FEATURES:tune-aarch32 = "arm" | ||
31 | TUNE_CCARGS:tune-aarch32 = "" | ||
32 | TUNE_PKGARCH:tune-aarch32 = "aarch32" | ||
33 | |||
34 | |||
35 | # arm/v5te/softfp | ||
36 | # CFLAGS: -marm -march=armv5te+fp -mfloat-abi=softfp | ||
37 | DEFAULTTUNE:virtclass-multilib-libarmv5tesoftfp = "armv5tesoftfp" | ||
38 | |||
39 | AVAILTUNES += "armv5tesoftfp" | ||
40 | PACKAGE_EXTRA_ARCHS:tune-armv5tesoftfp = "${TUNE_PKGARCH:tune-armv5tesoftfp}" | ||
41 | BASE_LIB:tune-armv5tesoftfp = "lib/arm/v5te/softfp" | ||
42 | TUNE_FEATURES:tune-armv5tesoftfp = "arm" | ||
43 | TUNE_CCARGS:tune-armv5tesoftfp = "-marm -march=armv5te+fp -mfloat-abi=softfp" | ||
44 | TUNE_PKGARCH:tune-armv5tesoftfp = "armv5tefp" | ||
45 | |||
46 | |||
47 | # arm/v5te/hard | ||
48 | # CFLAGS: -marm -march=armv5te+fp -mfloat-abi=hard | ||
49 | DEFAULTTUNE:virtclass-multilib-libarmv5tehard = "armv5tehard" | ||
50 | |||
51 | AVAILTUNES += "armv5tehard" | ||
52 | PACKAGE_EXTRA_ARCHS:tune-armv5tehard = "${TUNE_PKGARCH:tune-armv5tehard}" | ||
53 | BASE_LIB:tune-armv5tehard = "lib/arm/v5te/hard" | ||
54 | TUNE_FEATURES:tune-armv5tehard = "arm" | ||
55 | TUNE_CCARGS:tune-armv5tehard = "-marm -march=armv5te+fp -mfloat-abi=hard" | ||
56 | TUNE_PKGARCH:tune-armv5tehard = "armv5tefphf" | ||
57 | |||
58 | |||
59 | # thumb/nofp | ||
60 | # CFLAGS: -mthumb -mfloat-abi=soft | ||
61 | DEFAULTTUNE:virtclass-multilib-libnofp = "armnofp" | ||
62 | |||
63 | AVAILTUNES += "armnofp" | ||
64 | PACKAGE_EXTRA_ARCHS:tune-armnofp = "${TUNE_PKGARCH:tune-armnofp}" | ||
65 | BASE_LIB:tune-armnofp = "lib/thumb/nofp" | ||
66 | TUNE_FEATURES:tune-armnofp = "arm" | ||
67 | TUNE_CCARGS:tune-armnofp = "-mthumb -mfloat-abi=soft" | ||
68 | TUNE_PKGARCH:tune-armnofp = "armt" | ||
69 | |||
70 | |||
71 | # thumb/v7/nofp | ||
72 | # CFLAGS: -mthumb -march=armv7 -mfloat-abi=soft | ||
73 | DEFAULTTUNE:virtclass-multilib-libv7nofp = "armv7nofp" | ||
74 | |||
75 | AVAILTUNES += "armv7nofp" | ||
76 | PACKAGE_EXTRA_ARCHS:tune-armv7nofp = "${TUNE_PKGARCH:tune-armv7nofp}" | ||
77 | BASE_LIB:tune-armv7nofp = "lib/thumb/v7/nofp" | ||
78 | TUNE_FEATURES:tune-armv7nofp = "arm" | ||
79 | TUNE_CCARGS:tune-armv7nofp = "-mthumb -march=armv7 -mfloat-abi=soft" | ||
80 | TUNE_PKGARCH:tune-armv7nofp = "armv7t" | ||
81 | |||
82 | |||
83 | # thumb/v7+fp/softfp | ||
84 | # CFLAGS: -mthumb -march=armv7+fp -mfloat-abi=softfp | ||
85 | DEFAULTTUNE:virtclass-multilib-libv7fpsoftfp = "armv7fpsoftfp" | ||
86 | |||
87 | AVAILTUNES += "armv7fpsoftfp" | ||
88 | PACKAGE_EXTRA_ARCHS:tune-armv7fpsoftfp = "${TUNE_PKGARCH:tune-armv7fpsoftfp}" | ||
89 | BASE_LIB:tune-armv7fpsoftfp = "lib/thumb/v7+fp/softfp" | ||
90 | TUNE_FEATURES:tune-armv7fpsoftfp = "arm" | ||
91 | TUNE_CCARGS:tune-armv7fpsoftfp = "-mthumb -march=armv7+fp -mfloat-abi=softfp" | ||
92 | TUNE_PKGARCH:tune-armv7fpsoftfp = "armv7fpt" | ||
93 | |||
94 | |||
95 | # thumb/v7+fp/hard | ||
96 | # CFLAGS: -mthumb -march=armv7+fp -mfloat-abi=hard | ||
97 | DEFAULTTUNE:virtclass-multilib-libv7fphard = "armv7fphard" | ||
98 | |||
99 | AVAILTUNES += "armv7fphard" | ||
100 | PACKAGE_EXTRA_ARCHS:tune-armv7fphard = "${TUNE_PKGARCH:tune-armv7fphard}" | ||
101 | BASE_LIB:tune-armv7fphard = "lib/thumb/v7+fp/hard" | ||
102 | TUNE_FEATURES:tune-armv7fphard = "arm" | ||
103 | TUNE_CCARGS:tune-armv7fphard = "-mthumb -march=armv7+fp -mfloat-abi=hard" | ||
104 | TUNE_PKGARCH:tune-armv7fphard = "armv7fpthf" | ||
105 | |||
106 | |||
107 | # thumb/v7-a/nofp | ||
108 | # CFLAGS: -mthumb -march=armv7-a -mfloat-abi=soft | ||
109 | DEFAULTTUNE:virtclass-multilib-libv7anofp = "armv7anofp" | ||
110 | |||
111 | AVAILTUNES += "armv7anofp" | ||
112 | PACKAGE_EXTRA_ARCHS:tune-armv7anofp = "${TUNE_PKGARCH:tune-armv7anofp}" | ||
113 | BASE_LIB:tune-armv7anofp = "lib/thumb/v7-a/nofp" | ||
114 | TUNE_FEATURES:tune-armv7anofp = "arm" | ||
115 | TUNE_CCARGS:tune-armv7anofp = "-mthumb -march=armv7-a -mfloat-abi=soft" | ||
116 | TUNE_PKGARCH:tune-armv7anofp = "armv7at" | ||
117 | |||
118 | |||
119 | # thumb/v7-a+fp/softfp | ||
120 | # CFLAGS: -mthumb -march=armv7-a+fp -mfloat-abi=softfp | ||
121 | DEFAULTTUNE:virtclass-multilib-libv7afpsoftfp = "armv7afpsoftfp" | ||
122 | |||
123 | AVAILTUNES += "armv7afpsoftfp" | ||
124 | PACKAGE_EXTRA_ARCHS:tune-armv7afpsoftfp = "${TUNE_PKGARCH:tune-armv7afpsoftfp}" | ||
125 | BASE_LIB:tune-armv7afpsoftfp = "lib/thumb/v7-a+fp/softfp" | ||
126 | TUNE_FEATURES:tune-armv7afpsoftfp = "arm" | ||
127 | TUNE_CCARGS:tune-armv7afpsoftfp = "-mthumb -march=armv7-a+fp -mfloat-abi=softfp" | ||
128 | TUNE_PKGARCH:tune-armv7afpsoftfp = "armv7afpt" | ||
129 | |||
130 | |||
131 | # thumb/v7-a+fp/hard | ||
132 | # CFLAGS: -mthumb -march=armv7-a+fp -mfloat-abi=hard | ||
133 | DEFAULTTUNE:virtclass-multilib-libv7afpthf = "armv7afpthf" | ||
134 | |||
135 | AVAILTUNES += "armv7afpthf" | ||
136 | PACKAGE_EXTRA_ARCHS:tune-armv7afpthf = "${TUNE_PKGARCH:tune-armv7afpthf}" | ||
137 | BASE_LIB:tune-armv7afpthf = "lib/thumb/v7-a+fp/hard" | ||
138 | TUNE_FEATURES:tune-armv7afpthf = "arm" | ||
139 | TUNE_CCARGS:tune-armv7afpthf = "-mthumb -march=armv7-a+fp -mfloat-abi=hard" | ||
140 | TUNE_PKGARCH:tune-armv7afpthf = "armv7afpthf" | ||
141 | |||
142 | # thumb/v7-a+simd/softfp | ||
143 | # CFLAGS: -mthumb -march=armv7-a+simd -mfloat-abi=softfp | ||
144 | DEFAULTTUNE:virtclass-multilib-libv7asimdsoftfp = "armv7asimdsoftfp" | ||
145 | |||
146 | AVAILTUNES += "armv7asimdsoftfp" | ||
147 | PACKAGE_EXTRA_ARCHS:tune-armv7asimdsoftfp = "${TUNE_PKGARCH:tune-armv7asimdsoftfp}" | ||
148 | BASE_LIB:tune-armv7asimdsoftfp = "lib/thumb/v7-a+simd/softfp" | ||
149 | TUNE_FEATURES:tune-armv7asimdsoftfp = "arm" | ||
150 | TUNE_CCARGS:tune-armv7asimdsoftfp = "-mthumb -march=armv7-a+simd -mfloat-abi=softfp" | ||
151 | TUNE_PKGARCH:tune-armv7asimdsoftfp = "armv7asimdt" | ||
152 | |||
153 | |||
154 | # thumb/v7-a+simd/hard | ||
155 | # CFLAGS: -mthumb -march=armv7-a+simd -mfloat-abi=hard | ||
156 | DEFAULTTUNE:virtclass-multilib-libv7asimdhard = "armv7asimdhard" | ||
157 | |||
158 | AVAILTUNES += "armv7asimdhard" | ||
159 | PACKAGE_EXTRA_ARCHS:tune-armv7asimdhard = "${TUNE_PKGARCH:tune-armv7asimdhard}" | ||
160 | BASE_LIB:tune-armv7asimdhard = "lib/thumb/v7-a+simd/hard" | ||
161 | TUNE_FEATURES:tune-armv7asimdhard = "arm" | ||
162 | TUNE_CCARGS:tune-armv7asimdhard = "-mthumb -march=armv7-a+simd -mfloat-abi=hard" | ||
163 | TUNE_PKGARCH:tune-armv7asimdhard = "armv7asimdthf" | ||
164 | |||
165 | |||
166 | # thumb/v7ve+simd/softfp | ||
167 | # CFLAGS: -mthumb -march=armv7ve+simd -mfloat-abi=softfp | ||
168 | DEFAULTTUNE:virtclass-multilib-libv7vesimdsoftfp = "armv7vesimdsoftfp" | ||
169 | |||
170 | AVAILTUNES += "armv7vesimdsoftfp" | ||
171 | PACKAGE_EXTRA_ARCHS:tune-armv7vesimdsoftfp = "${TUNE_PKGARCH:tune-armv7vesimdsoftfp}" | ||
172 | BASE_LIB:tune-armv7vesimdsoftfp = "lib/thumb/v7ve+simd/softfp" | ||
173 | TUNE_FEATURES:tune-armv7vesimdsoftfp = "arm" | ||
174 | TUNE_CCARGS:tune-armv7vesimdsoftfp = "-mthumb -march=armv7ve+simd -mfloat-abi=softfp" | ||
175 | TUNE_PKGARCH:tune-armv7vesimdsoftfp = "armv7vesimdt" | ||
176 | |||
177 | # thumb/v7ve+simd/hard | ||
178 | # CFLAGS: -mthumb -march=armv7ve+simd -mfloat-abi=hard | ||
179 | DEFAULTTUNE:virtclass-multilib-libvtvesimdhf = "armvtvesimdhf" | ||
180 | |||
181 | AVAILTUNES += "armvtvesimdhf" | ||
182 | PACKAGE_EXTRA_ARCHS:tune-armvtvesimdhf = "${TUNE_PKGARCH:tune-armvtvesimdhf}" | ||
183 | BASE_LIB:tune-armvtvesimdhf = "lib/thumb/v7ve+simd/hard" | ||
184 | TUNE_FEATURES:tune-armvtvesimdhf = "arm" | ||
185 | TUNE_CCARGS:tune-armvtvesimdhf = "-mthumb -march=armv7ve+simd -mfloat-abi=hard" | ||
186 | TUNE_PKGARCH:tune-armvtvesimdhf = "armv7vesimdthf" | ||
187 | |||
188 | |||
189 | # thumb/v8-a/nofp | ||
190 | # CFLAGS: -mthumb -march=armv8-a -mfloat-abi=soft | ||
191 | DEFAULTTUNE:virtclass-multilib-libv8anofp = "armv8anofp" | ||
192 | |||
193 | AVAILTUNES += "armv8anofp" | ||
194 | PACKAGE_EXTRA_ARCHS:tune-armv8anofp = "${TUNE_PKGARCH:tune-armv8anofp}" | ||
195 | BASE_LIB:tune-armv8anofp = "lib/thumb/v8-a/nofp" | ||
196 | TUNE_FEATURES:tune-armv8anofp = "arm" | ||
197 | TUNE_CCARGS:tune-armv8anofp = "-mthumb -march=armv8-a -mfloat-abi=soft" | ||
198 | TUNE_PKGARCH:tune-armv8anofp = "armv8at" | ||
199 | |||
200 | # thumb/v8-a+simd/softfp | ||
201 | # CFLAGS: -mthumb -march=armv8-a+simd -mfloat-abi=softfp | ||
202 | DEFAULTTUNE:virtclass-multilib-libv8asimdsoftfp = "armv8asimdsoftfp" | ||
203 | |||
204 | AVAILTUNES += "armv8asimdsoftfp" | ||
205 | PACKAGE_EXTRA_ARCHS:tune-armv8asimdsoftfp = "${TUNE_PKGARCH:tune-armv8asimdsoftfp}" | ||
206 | BASE_LIB:tune-armv8asimdsoftfp = "lib/thumb/v8-a+simd/softfp" | ||
207 | TUNE_FEATURES:tune-armv8asimdsoftfp = "arm" | ||
208 | TUNE_CCARGS:tune-armv8asimdsoftfp = "-mthumb -march=armv8-a+simd -mfloat-abi=softfp" | ||
209 | TUNE_PKGARCH:tune-armv8asimdsoftfp = "armv8asimdt" | ||
210 | |||
211 | |||
212 | # thumb/v8-a+simd/hard | ||
213 | # CFLAGS: -mthumb -march=armv8-a+simd -mfloat-abi=hard | ||
214 | DEFAULTTUNE:virtclass-multilib-libv8asimdhard = "armv8asimdhard" | ||
215 | |||
216 | AVAILTUNES += "armv8asimdhard" | ||
217 | PACKAGE_EXTRA_ARCHS:tune-armv8asimdhard = "${TUNE_PKGARCH:tune-armv8asimdhard}" | ||
218 | BASE_LIB:tune-armv8asimdhard = "lib/thumb/v8-a+simd/hard" | ||
219 | TUNE_FEATURES:tune-armv8asimdhard = "arm" | ||
220 | TUNE_CCARGS:tune-armv8asimdhard = "-mthumb -march=armv8-a+simd -mfloat-abi=hard" | ||
221 | TUNE_PKGARCH:tune-armv8asimdhard = "armv8asimdthf" | ||
diff --git a/meta-vitis-tc/conf/machine/aarch64-tc.conf b/meta-vitis-tc/conf/machine/aarch64-tc.conf new file mode 100644 index 00000000..b3ab4c6b --- /dev/null +++ b/meta-vitis-tc/conf/machine/aarch64-tc.conf | |||
@@ -0,0 +1,30 @@ | |||
1 | require conf/machine/include/machine-xilinx-qemu.inc | ||
2 | require conf/multilib.conf | ||
3 | require conf/machine/include/arm/armv8a/tune-cortexa72-cortexa53.inc | ||
4 | require conf/machine/include/baremetal-tc.conf | ||
5 | |||
6 | # Define ilp32 variant (not in tune files) | ||
7 | TUNEVALID[ilp32] = "ilp32 ABI" | ||
8 | |||
9 | TUNE_CCARGS .= '${@bb.utils.contains("TUNE_FEATURES", "ilp32", " -mabi=ilp32", "", d)}' | ||
10 | |||
11 | # ILP request an alternative machine dictionary | ||
12 | INHERIT += "xlnx-standalone" | ||
13 | PACKAGEQA_EXTRA_MACHDEFFUNCS .= '${@bb.utils.contains("TUNE_FEATURES", "ilp32", " xlnx_ilp32_dict", "", d)}' | ||
14 | |||
15 | # Define all of the multilibs supported by this configuration | ||
16 | MULTILIB_GLOBAL_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" | ||
17 | MULTILIBS = "multilib:libilp32" | ||
18 | |||
19 | # Base configuration | ||
20 | # CFLAGS: | ||
21 | DEFAULTTUNE = "cortexa72-cortexa53" | ||
22 | |||
23 | # CFLAGS: -mabi=ilp32 | ||
24 | DEFAULTTUNE:virtclass-multilib-libilp32 = "cortexa72-cortexa53-ilp32" | ||
25 | |||
26 | AVAILTUNES += "cortexa72-cortexa53-ilp32" | ||
27 | ARMPKGARCH:tune-cortexa72-cortexa53-ilp32 = "${ARMPKGARCH:tune-cortexa72-cortexa53}-ilp32" | ||
28 | TUNE_FEATURES:tune-cortexa72-cortexa53-ilp32 = "${TUNE_FEATURES:tune-cortexa72-cortexa53} ilp32" | ||
29 | PACKAGE_EXTRA_ARCHS:tune-cortexa72-cortexa53-ilp32 = "${PACKAGE_EXTRA_ARCHS:tune-cortexa72-cortexa53} cortexa72-cortexa53-ilp32" | ||
30 | BASE_LIB:tune-cortexa72-cortexa53-ilp32 = "lib/ilp32" | ||
diff --git a/meta-vitis-tc/conf/machine/arm-rm-tc.conf b/meta-vitis-tc/conf/machine/arm-rm-tc.conf new file mode 100644 index 00000000..6f0e5fbf --- /dev/null +++ b/meta-vitis-tc/conf/machine/arm-rm-tc.conf | |||
@@ -0,0 +1,275 @@ | |||
1 | require conf/machine/include/machine-xilinx-qemu.inc | ||
2 | require conf/multilib.conf | ||
3 | require conf/machine/include/arm/arch-armv8r.inc | ||
4 | require conf/machine/include/baremetal-tc.conf | ||
5 | |||
6 | # Since we're combining armv7r and armv8r into a single set of multilibs, | ||
7 | # copy the following machine setting to make sure it's available | ||
8 | # From conf/machine/include/arm/arch-armv7r.inc | ||
9 | |||
10 | TUNEVALID[armv7r] = "Enable instructions for ARMv7-r" | ||
11 | TUNE_CCARGS_MARCH = "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', ' -march=armv7-r', '', d)}" | ||
12 | MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', 'armv7r:', '', d)}" | ||
13 | TUNECONFLICTS[armv7r] = "armv4 armv5 armv6 armv7a" | ||
14 | |||
15 | |||
16 | # Define all of the multilibs supproted by this configuration | ||
17 | MULTILIB_GLOBAL_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" | ||
18 | |||
19 | MULTILIBS = "multilib:libarmv5tesoftfp multilib:libarmv5tehard" | ||
20 | MULTILIBS += "multilib:libnofp" | ||
21 | MULTILIBS += "multilib:libv7nofp multilib:libv7fpsoftfp multilib:libv7fphard" | ||
22 | MULTILIBS += "multilib:libv6mnofp" | ||
23 | MULTILIBS += "multilib:libv7mnofp" | ||
24 | MULTILIBS += "multilib:libv7emnofp multilib:libv7emfpsoftfp" | ||
25 | MULTILIBS += "multilib:libv7emfphard multilib:libv7emdpsoftfp" | ||
26 | MULTILIBS += "multilib:libv7emdphard" | ||
27 | MULTILIBS += "multilib:libv8mbasenofp" | ||
28 | MULTILIBS += "multilib:libv8mmainnofp multilib:libv8mmainfpsoftfp multilib:libv8mmainfphard multilib:libv8mmaindpsoftfp multilib:libv8mmaindphard" | ||
29 | |||
30 | TUNE_CCARGS = "${TUNE_CCARGS:tune-${DEFAULTTUNE}}" | ||
31 | TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}" | ||
32 | |||
33 | # Base configuration | ||
34 | # CFLAGS: | ||
35 | DEFAULTTUNE = "armv7r" | ||
36 | |||
37 | AVAILTUNES += "armv7r" | ||
38 | PACKAGE_EXTRA_ARCHS:tune-armv7r = "${TUNE_PKGARCH:tune-armv7r}" | ||
39 | BASE_LIB:tune-armv7r = "lib" | ||
40 | TUNE_FEATURES:tune-armv7r = "arm armv7r" | ||
41 | TUNE_CCARGS:tune-armv7r = "" | ||
42 | TUNE_PKGARCH:tune-armv7r = "armv7r" | ||
43 | |||
44 | |||
45 | # arm/v5te/softfp | ||
46 | # CFLAGS: -marm -march=armv5te+fp -mfloat-abi=softfp | ||
47 | DEFAULTTUNE:virtclass-multilib-libarmv5tesoftfp = "armv5tesoftfp" | ||
48 | |||
49 | AVAILTUNES += "armv5tesoftfp" | ||
50 | PACKAGE_EXTRA_ARCHS:tune-armv5tesoftfp = "${TUNE_PKGARCH:tune-armv5tesoftfp}" | ||
51 | BASE_LIB:tune-armv5tesoftfp = "lib/arm/v5te/softfp" | ||
52 | TUNE_FEATURES:tune-armv5tesoftfp = "arm armv7r" | ||
53 | TUNE_CCARGS:tune-armv5tesoftfp = "-marm -march=armv5te+fp -mfloat-abi=softfp" | ||
54 | TUNE_PKGARCH:tune-armv5tesoftfp = "armv5tefp" | ||
55 | |||
56 | |||
57 | # arm/v5te/hard | ||
58 | # CFLAGS: -marm -march=armv5te+fp -mfloat-abi=hard | ||
59 | DEFAULTTUNE:virtclass-multilib-libarmv5tehard = "armv5tehard" | ||
60 | |||
61 | AVAILTUNES += "armv5tehard" | ||
62 | PACKAGE_EXTRA_ARCHS:tune-armv5tehard = "${TUNE_PKGARCH:tune-armv5tehard}" | ||
63 | BASE_LIB:tune-armv5tehard = "lib/arm/v5te/hard" | ||
64 | TUNE_FEATURES:tune-armv5tehard = "arm armv7r" | ||
65 | TUNE_CCARGS:tune-armv5tehard = "-marm -march=armv5te+fp -mfloat-abi=hard" | ||
66 | TUNE_PKGARCH:tune-armv5tehard = "armv5tefphf" | ||
67 | |||
68 | |||
69 | # thumb/nofp | ||
70 | # CFLAGS: -mthumb -mfloat-abi=soft | ||
71 | DEFAULTTUNE:virtclass-multilib-libnofp = "armnofp" | ||
72 | |||
73 | AVAILTUNES += "armnofp" | ||
74 | PACKAGE_EXTRA_ARCHS:tune-armnofp = "${TUNE_PKGARCH:tune-armnofp}" | ||
75 | BASE_LIB:tune-armnofp = "lib/thumb/nofp" | ||
76 | TUNE_FEATURES:tune-armnofp = "arm armv7r" | ||
77 | TUNE_CCARGS:tune-armnofp = "-mthumb -mfloat-abi=soft" | ||
78 | TUNE_PKGARCH:tune-armnofp = "armt" | ||
79 | |||
80 | |||
81 | # thumb/v7/nofp | ||
82 | # CFLAGS: -mthumb -march=armv7 -mfloat-abi=soft | ||
83 | DEFAULTTUNE:virtclass-multilib-libv7nofp = "armv7nofp" | ||
84 | |||
85 | AVAILTUNES += "armv7nofp" | ||
86 | PACKAGE_EXTRA_ARCHS:tune-armv7nofp = "${TUNE_PKGARCH:tune-armv7nofp}" | ||
87 | BASE_LIB:tune-armv7nofp = "lib/thumb/v7/nofp" | ||
88 | TUNE_FEATURES:tune-armv7nofp ="arm armv7r" | ||
89 | TUNE_CCARGS:tune-armv7nofp = "-mthumb -march=armv7 -mfloat-abi=soft" | ||
90 | TUNE_PKGARCH:tune-armv7nofp = "armv7t" | ||
91 | |||
92 | |||
93 | # thumb/v7+fp/softfp | ||
94 | # CFLAGS: -mthumb -march=armv7+fp -mfloat-abi=softfp | ||
95 | DEFAULTTUNE:virtclass-multilib-libv7fpsoftfp = "armv7fpsoftfp" | ||
96 | |||
97 | AVAILTUNES += "armv7fpsoftfp" | ||
98 | PACKAGE_EXTRA_ARCHS:tune-armv7fpsoftfp = "${TUNE_PKGARCH:tune-armv7fpsoftfp}" | ||
99 | BASE_LIB:tune-armv7fpsoftfp = "lib/thumb/v7+fp/softfp" | ||
100 | TUNE_FEATURES:tune-armv7fpsoftfp ="arm armv7r" | ||
101 | TUNE_CCARGS:tune-armv7fpsoftfp = "-mthumb -march=armv7+fp -mfloat-abi=softfp" | ||
102 | TUNE_PKGARCH:tune-armv7fpsoftfp = "armv7fpt" | ||
103 | |||
104 | |||
105 | # thumb/v7+fp/hard | ||
106 | # CFLAGS: -mthumb -march=armv7+fp -mfloat-abi=hard | ||
107 | DEFAULTTUNE:virtclass-multilib-libv7fphard = "armv7fphard" | ||
108 | |||
109 | AVAILTUNES += "armv7fphard" | ||
110 | PACKAGE_EXTRA_ARCHS:tune-armv7fphard = "${TUNE_PKGARCH:tune-armv7fphard}" | ||
111 | BASE_LIB:tune-armv7fphard = "lib/thumb/v7+fp/hard" | ||
112 | TUNE_FEATURES:tune-armv7fphard ="arm armv7r" | ||
113 | TUNE_CCARGS:tune-armv7fphard = "-mthumb -march=armv7+fp -mfloat-abi=hard" | ||
114 | TUNE_PKGARCH:tune-armv7fphard = "armv7fpthf" | ||
115 | |||
116 | |||
117 | # thumb/v6-m/nofp | ||
118 | # CFLAGS: -mthumb -march=armv6s-m -mfloat-abi=soft | ||
119 | DEFAULTTUNE:virtclass-multilib-libv6mnofp = "armv6mnofp" | ||
120 | |||
121 | # Workaround for this multilib in newlib | ||
122 | # newlib/libc/sys/arm/trap.S:88: Error: lo register required -- `sub ip,sp,ip | ||
123 | EXTRA_OECONF:append:pn-libv6mnofp-newlib = " --disable-newlib-supplied-syscalls" | ||
124 | |||
125 | AVAILTUNES += "armv6mnofp" | ||
126 | PACKAGE_EXTRA_ARCHS:tune-armv6mnofp = "${TUNE_PKGARCH:tune-armv6mnofp}" | ||
127 | BASE_LIB:tune-armv6mnofp = "lib/thumb/v6-m/nofp" | ||
128 | TUNE_FEATURES:tune-armv6mnofp ="arm armv7r" | ||
129 | TUNE_CCARGS:tune-armv6mnofp = "-mthumb -march=armv6s-m -mfloat-abi=soft" | ||
130 | TUNE_PKGARCH:tune-armv6mnofp = "armv6smt" | ||
131 | |||
132 | |||
133 | # thumb/v7-m/nofp | ||
134 | # CFLAGS: -mthumb -march=armv7-m -mfloat-abi=soft | ||
135 | DEFAULTTUNE:virtclass-multilib-libv7mnofp = "armv7mnofp" | ||
136 | |||
137 | AVAILTUNES += "armv7mnofp" | ||
138 | PACKAGE_EXTRA_ARCHS:tune-armv7mnofp = "${TUNE_PKGARCH:tune-armv7mnofp}" | ||
139 | BASE_LIB:tune-armv7mnofp = "lib/thumb/v7-m/nofp" | ||
140 | TUNE_FEATURES:tune-armv7mnofp ="arm armv7r" | ||
141 | TUNE_CCARGS:tune-armv7mnofp = "-mthumb -march=armv7-m -mfloat-abi=soft" | ||
142 | TUNE_PKGARCH:tune-armv7mnofp = "armv7mt" | ||
143 | |||
144 | |||
145 | # thumb/v7e-m/nofp | ||
146 | # CFLAGS: -mthumb -march=armv7e-m -mfloat-abi=soft | ||
147 | DEFAULTTUNE:virtclass-multilib-libv7emnofp = "armv7emnofp" | ||
148 | |||
149 | AVAILTUNES += "armv7emnofp" | ||
150 | PACKAGE_EXTRA_ARCHS:tune-armv7emnofp = "${TUNE_PKGARCH:tune-armv7emnofp}" | ||
151 | BASE_LIB:tune-armv7emnofp = "lib/thumb/v7e-m/nofp" | ||
152 | TUNE_FEATURES:tune-armv7emnofp ="arm armv7r" | ||
153 | TUNE_CCARGS:tune-armv7emnofp = "-mthumb -march=armv7e-m -mfloat-abi=soft" | ||
154 | TUNE_PKGARCH:tune-armv7emnofp = "armv7emt" | ||
155 | |||
156 | |||
157 | # thumb/v7e-m+fp/softfp | ||
158 | # CFLAGS: -mthumb -march=armv7e-m+fp -mfloat-abi=softfp | ||
159 | DEFAULTTUNE:virtclass-multilib-libv7emfpsoftfp = "armv7emfpsoftfp" | ||
160 | |||
161 | AVAILTUNES += "armv7emfpsoftfp" | ||
162 | PACKAGE_EXTRA_ARCHS:tune-armv7emfpsoftfp = "${TUNE_PKGARCH:tune-armv7emfpsoftfp}" | ||
163 | BASE_LIB:tune-armv7emfpsoftfp = "lib/thumb/v7e-m+fp/softfp" | ||
164 | TUNE_FEATURES:tune-armv7emfpsoftfp ="arm armv7r" | ||
165 | TUNE_CCARGS:tune-armv7emfpsoftfp = "-mthumb -march=armv7e-m+fp -mfloat-abi=softfp" | ||
166 | TUNE_PKGARCH:tune-armv7emfpsoftfp = "armv7emfpt" | ||
167 | |||
168 | |||
169 | # thumb/v7e-m+fp/hard | ||
170 | # CFLAGS: -mthumb -march=armv7e-m+fp -mfloat-abi=hard | ||
171 | DEFAULTTUNE:virtclass-multilib-libv7emfphard = "armv7emfphard" | ||
172 | |||
173 | AVAILTUNES += "armv7emfphard" | ||
174 | PACKAGE_EXTRA_ARCHS:tune-armv7emfphard = "${TUNE_PKGARCH:tune-armv7emfphard}" | ||
175 | BASE_LIB:tune-armv7emfphard = "lib/thumb/v7e-m+fp/hard" | ||
176 | TUNE_FEATURES:tune-armv7emfphard ="arm armv7r" | ||
177 | TUNE_CCARGS:tune-armv7emfphard = "-mthumb -march=armv7e-m+fp -mfloat-abi=hard" | ||
178 | TUNE_PKGARCH:tune-armv7emfphard = "armv7emfpthf" | ||
179 | |||
180 | |||
181 | # thumb/v7e-m+dp/softfp | ||
182 | # CFLAGS: -mthumb -march=armv7e-m+fp.dp -mfloat-abi=softfp | ||
183 | DEFAULTTUNE:virtclass-multilib-libv7emdpsoftfp = "armv7emdpsoftfp" | ||
184 | |||
185 | AVAILTUNES += "armv7emdpsoftfp" | ||
186 | PACKAGE_EXTRA_ARCHS:tune-armv7emdpsoftfp = "${TUNE_PKGARCH:tune-armv7emdpsoftfp}" | ||
187 | BASE_LIB:tune-armv7emdpsoftfp = "lib/thumb/v7e-m+dp/softfp" | ||
188 | TUNE_FEATURES:tune-armv7emdpsoftfp ="arm armv7r" | ||
189 | TUNE_CCARGS:tune-armv7emdpsoftfp = "-mthumb -march=armv7e-m+fp.dp -mfloat-abi=softfp" | ||
190 | TUNE_PKGARCH:tune-armv7emdpsoftfp = "armv7emdp" | ||
191 | |||
192 | # thumb/v7e-m+dp/hard | ||
193 | # CFLAGS: -mthumb -march=armv7e-m+fp.dp -mfloat-abi=hard | ||
194 | DEFAULTTUNE:virtclass-multilib-libv7emdphard = "armv7emdphard" | ||
195 | |||
196 | AVAILTUNES += "armv7emdphard" | ||
197 | PACKAGE_EXTRA_ARCHS:tune-armv7emdphard = "${TUNE_PKGARCH:tune-armv7emdphard}" | ||
198 | BASE_LIB:tune-armv7emdphard = "lib/thumb/v7e-m+dp/hard" | ||
199 | TUNE_FEATURES:tune-armv7emdphard ="arm armv7r" | ||
200 | TUNE_CCARGS:tune-armv7emdphard = "-mthumb -march=armv7e-m+fp.dp -mfloat-abi=hard" | ||
201 | TUNE_PKGARCH:tune-armv7emdphard = "armv7emdpthf" | ||
202 | |||
203 | |||
204 | # thumb/v8-m.base/nofp | ||
205 | # CFLAGS: -mthumb -march=armv8-m.base -mfloat-abi=soft | ||
206 | DEFAULTTUNE:virtclass-multilib-libv8mbasenofp = "armv8mbasenofp" | ||
207 | |||
208 | # Workaround for this multilib in newlib | ||
209 | # newlib/libc/sys/arm/trap.S:88: Error: lo register required -- `sub ip,sp,ip' | ||
210 | EXTRA_OECONF:append:pn-libv8mbasenofp-newlib = " --disable-newlib-supplied-syscalls" | ||
211 | |||
212 | AVAILTUNES += "armv8mbasenofp" | ||
213 | PACKAGE_EXTRA_ARCHS:tune-armv8mbasenofp = "${TUNE_PKGARCH:tune-armv8mbasenofp}" | ||
214 | BASE_LIB:tune-armv8mbasenofp = "lib/thumb/v8-m.base/nofp" | ||
215 | TUNE_FEATURES:tune-armv8mbasenofp ="arm armv8r" | ||
216 | TUNE_CCARGS:tune-armv8mbasenofp = "-mthumb -march=armv8-m.base -mfloat-abi=soft" | ||
217 | TUNE_PKGARCH:tune-armv8mbasenofp = "armv8mbaset" | ||
218 | |||
219 | # thumb/v8-m.main/nofp | ||
220 | # CFLAGS: -mthumb -march=armv8-m.main -mfloat-abi=soft | ||
221 | DEFAULTTUNE:virtclass-multilib-libv8mmainnofp = "armv8mmainnofp" | ||
222 | |||
223 | AVAILTUNES += "armv8mmainnofp" | ||
224 | PACKAGE_EXTRA_ARCHS:tune-armv8mmainnofp = "${TUNE_PKGARCH:tune-armv8mmainnofp}" | ||
225 | BASE_LIB:tune-armv8mmainnofp = "lib/thumb/v8-m.main/nofp" | ||
226 | TUNE_FEATURES:tune-armv8mmainnofp ="arm armv8r" | ||
227 | TUNE_CCARGS:tune-armv8mmainnofp = "-mthumb -march=armv8-m.main -mfloat-abi=soft" | ||
228 | TUNE_PKGARCH:tune-armv8mmainnofp = "armv8mmaint" | ||
229 | |||
230 | |||
231 | # thumb/v8-m.main+fp/softfp | ||
232 | # CFLAGS: -mthumb -march=armv8-m.main+fp -mfloat-abi=softfp | ||
233 | DEFAULTTUNE:virtclass-multilib-libv8mmainfpsoftfp = "armv8mmainfpsoftfp" | ||
234 | |||
235 | AVAILTUNES += "armv8mmainfpsoftfp" | ||
236 | PACKAGE_EXTRA_ARCHS:tune-armv8mmainfpsoftfp = "${TUNE_PKGARCH:tune-armv8mmainfpsoftfp}" | ||
237 | BASE_LIB:tune-armv8mmainfpsoftfp = "lib/thumb/v8-m.main+fp/softfp" | ||
238 | TUNE_FEATURES:tune-armv8mmainfpsoftfp ="arm armv8r" | ||
239 | TUNE_CCARGS:tune-armv8mmainfpsoftfp = "-mthumb -march=armv8-m.main+fp -mfloat-abi=softfp" | ||
240 | TUNE_PKGARCH:tune-armv8mmainfpsoftfp = "armv8mmainfpt" | ||
241 | |||
242 | # thumb/v8-m.main+fp/hard | ||
243 | # CFLAGS: -mthumb -march=armv8-m.main+fp -mfloat-abi=hard | ||
244 | DEFAULTTUNE:virtclass-multilib-libv8mmainfphard = "armv8mmainfphard" | ||
245 | |||
246 | AVAILTUNES += "armv8mmainfphard" | ||
247 | PACKAGE_EXTRA_ARCHS:tune-armv8mmainfphard = "${TUNE_PKGARCH:tune-armv8mmainfphard}" | ||
248 | BASE_LIB:tune-armv8mmainfphard = "lib/thumb/v8-m.main+fp/hard" | ||
249 | TUNE_FEATURES:tune-armv8mmainfphard ="arm armv8r" | ||
250 | TUNE_CCARGS:tune-armv8mmainfphard = "-mthumb -march=armv8-m.main+fp -mfloat-abi=hard" | ||
251 | TUNE_PKGARCH:tune-armv8mmainfphard = "armv8mmainfpthf" | ||
252 | |||
253 | |||
254 | # thumb/v8-m.main+dp/softfp | ||
255 | # CFLAGS: -mthumb -march=armv8-m.main+fp.dp -mfloat-abi=softfp | ||
256 | DEFAULTTUNE:virtclass-multilib-libv8mmaindpsoftfp = "armv8mmaindpsoftfp" | ||
257 | |||
258 | AVAILTUNES += "armv8mmaindpsoftfp" | ||
259 | PACKAGE_EXTRA_ARCHS:tune-armv8mmaindpsoftfp = "${TUNE_PKGARCH:tune-armv8mmaindpsoftfp}" | ||
260 | BASE_LIB:tune-armv8mmaindpsoftfp = "lib/thumb/v8-m.main+dp/softfp" | ||
261 | TUNE_FEATURES:tune-armv8mmaindpsoftfp ="arm armv8r" | ||
262 | TUNE_CCARGS:tune-armv8mmaindpsoftfp = "-mthumb -march=armv8-m.main+fp.dp -mfloat-abi=softfp" | ||
263 | TUNE_PKGARCH:tune-armv8mmaindpsoftfp = "armv8mmainfpdpt" | ||
264 | |||
265 | |||
266 | # thumb/v8-m.main+dp/hard | ||
267 | # CFLAGS: -mthumb -march=armv8-m.main+fp.dp -mfloat-abi=hard | ||
268 | DEFAULTTUNE:virtclass-multilib-libv8mmaindphard = "armv8mmaindphard" | ||
269 | |||
270 | AVAILTUNES += "armv8mmaindphard" | ||
271 | PACKAGE_EXTRA_ARCHS:tune-armv8mmaindphard = "${TUNE_PKGARCH:tune-armv8mmaindphard}" | ||
272 | BASE_LIB:tune-armv8mmaindphard = "lib/thumb/v8-m.main+dp/hard" | ||
273 | TUNE_FEATURES:tune-armv8mmaindphard ="arm armv8r" | ||
274 | TUNE_CCARGS:tune-armv8mmaindphard = "-mthumb -march=armv8-m.main+fp.dp -mfloat-abi=hard" | ||
275 | TUNE_PKGARCH:tune-armv8mmaindphard = "armv8mmainfpdpthf" | ||
diff --git a/meta-vitis-tc/conf/machine/include/baremetal-tc.conf b/meta-vitis-tc/conf/machine/include/baremetal-tc.conf new file mode 100644 index 00000000..c9f5c614 --- /dev/null +++ b/meta-vitis-tc/conf/machine/include/baremetal-tc.conf | |||
@@ -0,0 +1,7 @@ | |||
1 | # This is specific to baremetal toolchains only. | ||
2 | # | ||
3 | # Some of the operations we want to do are different then regular Yocto | ||
4 | # Project SDK workflows, so wrap baremetal toolchain items in a custom | ||
5 | # override: | ||
6 | |||
7 | MACHINEOVERRIDES:append = ":baremetal-multilib-tc" | ||
diff --git a/meta-vitis-tc/conf/machine/microblaze-tc.conf b/meta-vitis-tc/conf/machine/microblaze-tc.conf new file mode 100644 index 00000000..38e0b01b --- /dev/null +++ b/meta-vitis-tc/conf/machine/microblaze-tc.conf | |||
@@ -0,0 +1,550 @@ | |||
1 | require conf/machine/include/machine-xilinx-qemu.inc | ||
2 | require conf/multilib.conf | ||
3 | require conf/machine/include/microblaze/arch-microblaze.inc | ||
4 | require conf/machine/include/baremetal-tc.conf | ||
5 | |||
6 | # Set defaults | ||
7 | # pie is not supported on microblaze, disable it to avoid: | ||
8 | # .../microblaze-xilinx-elf/12.2.0/ld: -pie not supported | ||
9 | GCCPIE:microblaze = "" | ||
10 | GLIBCPIE:microblaze = "" | ||
11 | SECURITY_CFLAGS:remove:microblaze = "${SECURITY_PIE_CFLAGS}" | ||
12 | SECURITY_CFLAGS:pn-libgcc:microblaze = "" | ||
13 | |||
14 | # ILP request an alternative machine dictionary | ||
15 | INHERIT += "xlnx-standalone" | ||
16 | PACKAGEQA_EXTRA_MACHDEFFUNCS .= '${@bb.utils.contains("TUNE_FEATURES", "64-bit", " xlnx_mb64_dict", "", d)}' | ||
17 | |||
18 | # GNU hash style not supported | ||
19 | LINKER_HASH_STYLE:microblaze = "" | ||
20 | |||
21 | # Define all of the multilibs supproted by this configuration | ||
22 | MULTILIB_GLOBAL_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" | ||
23 | |||
24 | MULTILIBS += "multilib:libmble" | ||
25 | MULTILIBS += "multilib:libmbbs" | ||
26 | MULTILIBS += "multilib:libmbp" | ||
27 | MULTILIBS += "multilib:libmbm" | ||
28 | MULTILIBS += "multilib:libmbfpd" | ||
29 | MULTILIBS += "multilib:libmbmfpd" | ||
30 | MULTILIBS += "multilib:libmbpm" | ||
31 | MULTILIBS += "multilib:libmbpfpd" | ||
32 | MULTILIBS += "multilib:libmbpmfpd" | ||
33 | MULTILIBS += "multilib:libmbbsp" | ||
34 | MULTILIBS += "multilib:libmbbsm" | ||
35 | MULTILIBS += "multilib:libmbbsfpd" | ||
36 | MULTILIBS += "multilib:libmbbsmfpd" | ||
37 | MULTILIBS += "multilib:libmbbspm" | ||
38 | MULTILIBS += "multilib:libmbbspfpd" | ||
39 | MULTILIBS += "multilib:libmbbspmfpd" | ||
40 | MULTILIBS += "multilib:libmblem64" | ||
41 | MULTILIBS += "multilib:libmblebs" | ||
42 | MULTILIBS += "multilib:libmblep" | ||
43 | MULTILIBS += "multilib:libmblem" | ||
44 | MULTILIBS += "multilib:libmblefpd" | ||
45 | MULTILIBS += "multilib:libmblemfpd" | ||
46 | MULTILIBS += "multilib:libmblepm" | ||
47 | MULTILIBS += "multilib:libmblepfpd" | ||
48 | MULTILIBS += "multilib:libmblepmfpd" | ||
49 | MULTILIBS += "multilib:libmblebsp" | ||
50 | MULTILIBS += "multilib:libmblebsm" | ||
51 | MULTILIBS += "multilib:libmblebsfpd" | ||
52 | MULTILIBS += "multilib:libmblebsmfpd" | ||
53 | MULTILIBS += "multilib:libmblebspm" | ||
54 | MULTILIBS += "multilib:libmblebspfpd" | ||
55 | MULTILIBS += "multilib:libmblebspmfpd" | ||
56 | MULTILIBS += "multilib:libmblem64bs" | ||
57 | MULTILIBS += "multilib:libmblem64p" | ||
58 | MULTILIBS += "multilib:libmblem64m" | ||
59 | MULTILIBS += "multilib:libmblem64fpd" | ||
60 | MULTILIBS += "multilib:libmblem64mfpd" | ||
61 | MULTILIBS += "multilib:libmblem64pm" | ||
62 | MULTILIBS += "multilib:libmblem64pfpd" | ||
63 | MULTILIBS += "multilib:libmblem64pmfpd" | ||
64 | MULTILIBS += "multilib:libmblem64bsp" | ||
65 | MULTILIBS += "multilib:libmblem64bsm" | ||
66 | MULTILIBS += "multilib:libmblem64bsfpd" | ||
67 | MULTILIBS += "multilib:libmblem64bsmfpd" | ||
68 | MULTILIBS += "multilib:libmblem64bspm" | ||
69 | MULTILIBS += "multilib:libmblem64bspfpd" | ||
70 | MULTILIBS += "multilib:libmblem64bspmfpd" | ||
71 | |||
72 | |||
73 | # Base configuration | ||
74 | # CFLAGS: | ||
75 | DEFAULTTUNE = "microblaze" | ||
76 | |||
77 | AVAILTUNES += "microblaze" | ||
78 | BASE_LIB:tune-microblaze = "lib" | ||
79 | TUNE_FEATURES:tune-microblaze = "microblaze bigendian" | ||
80 | PACKAGE_EXTRA_ARCHS:tune-microblaze = "${TUNE_PKGARCH}" | ||
81 | |||
82 | |||
83 | # le | ||
84 | # CFLAGS: -mlittle-endian | ||
85 | DEFAULTTUNE:virtclass-multilib-libmble = "microblazele" | ||
86 | |||
87 | AVAILTUNES += "microblazele" | ||
88 | BASE_LIB:tune-microblazele = "lib/le" | ||
89 | TUNE_FEATURES:tune-microblazele = "microblaze" | ||
90 | PACKAGE_EXTRA_ARCHS:tune-microblazele = "${TUNE_PKGARCH}" | ||
91 | |||
92 | |||
93 | # bs | ||
94 | # CFLAGS: -mxl-barrel-shift | ||
95 | DEFAULTTUNE:virtclass-multilib-libmbbs = "microblazebs" | ||
96 | |||
97 | AVAILTUNES += "microblazebs" | ||
98 | BASE_LIB:tune-microblazebs = "lib/bs" | ||
99 | TUNE_FEATURES:tune-microblazebs = "microblaze bigendian barrel-shift" | ||
100 | PACKAGE_EXTRA_ARCHS:tune-microblazebs = "${TUNE_PKGARCH}" | ||
101 | |||
102 | |||
103 | # p | ||
104 | # CFLAGS: -mxl-pattern-compare | ||
105 | DEFAULTTUNE:virtclass-multilib-libmbp = "microblazep" | ||
106 | |||
107 | AVAILTUNES += "microblazep" | ||
108 | BASE_LIB:tune-microblazep = "lib/p" | ||
109 | TUNE_FEATURES:tune-microblazep = "microblaze bigendian pattern-compare" | ||
110 | PACKAGE_EXTRA_ARCHS:tune-microblazep = "${TUNE_PKGARCH}" | ||
111 | |||
112 | |||
113 | # m | ||
114 | # CFLAGS: -mno-xl-soft-mul | ||
115 | DEFAULTTUNE:virtclass-multilib-libmbm = "microblazem" | ||
116 | |||
117 | AVAILTUNES += "microblazem" | ||
118 | BASE_LIB:tune-microblazem = "lib/m" | ||
119 | TUNE_FEATURES:tune-microblazem = "microblaze bigendian multiply-low" | ||
120 | PACKAGE_EXTRA_ARCHS:tune-microblazem = "${TUNE_PKGARCH}" | ||
121 | |||
122 | |||
123 | # fpd | ||
124 | # CFLAGS: -mhard-float | ||
125 | DEFAULTTUNE:virtclass-multilib-libmbfpd = "microblazefpd" | ||
126 | |||
127 | AVAILTUNES += "microblazefpd" | ||
128 | BASE_LIB:tune-microblazefpd = "lib/fpd" | ||
129 | TUNE_FEATURES:tune-microblazefpd = "microblaze bigendian fpu-hard" | ||
130 | PACKAGE_EXTRA_ARCHS:tune-microblazefpd = "${TUNE_PKGARCH}" | ||
131 | |||
132 | |||
133 | # m/fpd | ||
134 | # CFLAGS: -mno-xl-soft-mul -mhard-float | ||
135 | DEFAULTTUNE:virtclass-multilib-libmbmfpd = "microblazemfpd" | ||
136 | |||
137 | AVAILTUNES += "microblazemfpd" | ||
138 | BASE_LIB:tune-microblazemfpd = "lib/m/fpd" | ||
139 | TUNE_FEATURES:tune-microblazemfpd = "microblaze bigendian multiply-low fpu-hard" | ||
140 | PACKAGE_EXTRA_ARCHS:tune-microblazemfpd = "${TUNE_PKGARCH}" | ||
141 | |||
142 | |||
143 | # p/m | ||
144 | # CFLAGS: -mxl-pattern-compare -mno-xl-soft-mul | ||
145 | DEFAULTTUNE:virtclass-multilib-libmbpm = "microblazepm" | ||
146 | |||
147 | AVAILTUNES += "microblazepm" | ||
148 | BASE_LIB:tune-microblazepm = "lib/p/m" | ||
149 | TUNE_FEATURES:tune-microblazepm = "microblaze bigendian pattern-compare multiply-low" | ||
150 | PACKAGE_EXTRA_ARCHS:tune-microblazepm = "${TUNE_PKGARCH}" | ||
151 | |||
152 | |||
153 | # p/fpd | ||
154 | # CFLAGS: -mxl-pattern-compare -mhard-float | ||
155 | DEFAULTTUNE:virtclass-multilib-libmbpfpd = "microblazepfpd" | ||
156 | |||
157 | AVAILTUNES += "microblazepfpd" | ||
158 | BASE_LIB:tune-microblazepfpd = "lib/p/fpd" | ||
159 | TUNE_FEATURES:tune-microblazepfpd = "microblaze bigendian pattern-compare fpu-hard" | ||
160 | PACKAGE_EXTRA_ARCHS:tune-microblazepfpd = "${TUNE_PKGARCH}" | ||
161 | |||
162 | |||
163 | # p/m/fpd | ||
164 | # CFLAGS: -mxl-pattern-compare -mno-xl-soft-mul -mhard-float | ||
165 | DEFAULTTUNE:virtclass-multilib-libmbpmfpd = "microblazepmfpd" | ||
166 | |||
167 | AVAILTUNES += "microblazepmfpd" | ||
168 | BASE_LIB:tune-microblazepmfpd = "lib/p/m/fpd" | ||
169 | TUNE_FEATURES:tune-microblazepmfpd = "microblaze bigendian pattern-compare multiply-low fpu-hard" | ||
170 | PACKAGE_EXTRA_ARCHS:tune-microblazepmfpd = "${TUNE_PKGARCH}" | ||
171 | |||
172 | |||
173 | # bs/p | ||
174 | # CFLAGS: -mxl-barrel-shift -mxl-pattern-compare | ||
175 | DEFAULTTUNE:virtclass-multilib-libmbbsp = "microblazebsp" | ||
176 | |||
177 | AVAILTUNES += "microblazebsp" | ||
178 | BASE_LIB:tune-microblazebsp = "lib/bs/p" | ||
179 | TUNE_FEATURES:tune-microblazebsp = "microblaze bigendian barrel-shift pattern-compare" | ||
180 | PACKAGE_EXTRA_ARCHS:tune-microblazebsp = "${TUNE_PKGARCH}" | ||
181 | |||
182 | |||
183 | # bs/m | ||
184 | # CFLAGS: -mxl-barrel-shift -mno-xl-soft-mul | ||
185 | DEFAULTTUNE:virtclass-multilib-libmbbsm = "microblazebsm" | ||
186 | |||
187 | AVAILTUNES += "microblazebsm" | ||
188 | BASE_LIB:tune-microblazebsm = "lib/bs/m" | ||
189 | TUNE_FEATURES:tune-microblazebsm = "microblaze bigendian barrel-shift multiply-low" | ||
190 | PACKAGE_EXTRA_ARCHS:tune-microblazebsm = "${TUNE_PKGARCH}" | ||
191 | |||
192 | |||
193 | # bs/fpd | ||
194 | # CFLAGS: -mxl-barrel-shift -mhard-float | ||
195 | DEFAULTTUNE:virtclass-multilib-libmbbsfpd = "microblazebsfpd" | ||
196 | |||
197 | AVAILTUNES += "microblazebsfpd" | ||
198 | BASE_LIB:tune-microblazebsfpd = "lib/bs/fpd" | ||
199 | TUNE_FEATURES:tune-microblazebsfpd = "microblaze bigendian barrel-shift fpu-hard" | ||
200 | PACKAGE_EXTRA_ARCHS:tune-microblazebsfpd = "${TUNE_PKGARCH}" | ||
201 | |||
202 | |||
203 | # bs/m/fpd | ||
204 | # CFLAGS: -mxl-barrel-shift -mno-xl-soft-mul -mhard-float | ||
205 | DEFAULTTUNE:virtclass-multilib-libmbbsmfpd = "microblazebsmfpd" | ||
206 | |||
207 | AVAILTUNES += "microblazebsmfpd" | ||
208 | BASE_LIB:tune-microblazebsmfpd = "lib/bs/m/fpd" | ||
209 | TUNE_FEATURES:tune-microblazebsmfpd = "microblaze bigendian barrel-shift multiply-low fpu-hard" | ||
210 | PACKAGE_EXTRA_ARCHS:tune-microblazebsmfpd = "${TUNE_PKGARCH}" | ||
211 | |||
212 | |||
213 | # bs/p/m | ||
214 | # CFLAGS: -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-mul | ||
215 | DEFAULTTUNE:virtclass-multilib-libmbbspm = "microblazebspm" | ||
216 | |||
217 | AVAILTUNES += "microblazebspm" | ||
218 | BASE_LIB:tune-microblazebspm = "lib/bs/p/m" | ||
219 | TUNE_FEATURES:tune-microblazebspm = "microblaze bigendian barrel-shift pattern-compare multiply-low" | ||
220 | PACKAGE_EXTRA_ARCHS:tune-microblazebspm = "${TUNE_PKGARCH}" | ||
221 | |||
222 | |||
223 | # bs/p/fpd | ||
224 | # CFLAGS: -mxl-barrel-shift -mxl-pattern-compare -mhard-float | ||
225 | DEFAULTTUNE:virtclass-multilib-libmbbspfpd = "microblazebspfpd" | ||
226 | |||
227 | AVAILTUNES += "microblazebspfpd" | ||
228 | BASE_LIB:tune-microblazebspfpd = "lib/bs/p/fpd" | ||
229 | TUNE_FEATURES:tune-microblazebspfpd = "microblaze bigendian barrel-shift pattern-compare fpu-hard" | ||
230 | PACKAGE_EXTRA_ARCHS:tune-microblazebspfpd = "${TUNE_PKGARCH}" | ||
231 | |||
232 | |||
233 | # bs/p/m/fpd | ||
234 | # CFLAGS: -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-mul -mhard-float | ||
235 | DEFAULTTUNE:virtclass-multilib-libmbbspmfpd = "microblazebspmfpd" | ||
236 | |||
237 | AVAILTUNES += "microblazebspmfpd" | ||
238 | BASE_LIB:tune-microblazebspmfpd = "lib/bs/p/m/fpd" | ||
239 | TUNE_FEATURES:tune-microblazebspmfpd = "microblaze bigendian barrel-shift pattern-compare multiply-low fpu-hard" | ||
240 | PACKAGE_EXTRA_ARCHS:tune-microblazebspmfpd = "${TUNE_PKGARCH}" | ||
241 | |||
242 | |||
243 | # le/m64 | ||
244 | # CFLAGS: -mlittle-endian -m64 | ||
245 | DEFAULTTUNE:virtclass-multilib-libmblem64 = "microblazele64" | ||
246 | |||
247 | AVAILTUNES += "microblazele64" | ||
248 | BASE_LIB:tune-microblazele64 = "lib/le/m64" | ||
249 | TUNE_FEATURES:tune-microblazele64 = "microblaze 64-bit" | ||
250 | PACKAGE_EXTRA_ARCHS:tune-microblazele64 = "${TUNE_PKGARCH}" | ||
251 | |||
252 | |||
253 | # le/bs | ||
254 | # CFLAGS: -mlittle-endian -mxl-barrel-shift | ||
255 | DEFAULTTUNE:virtclass-multilib-libmblebs = "microblazelebs" | ||
256 | |||
257 | AVAILTUNES += "microblazelebs" | ||
258 | BASE_LIB:tune-microblazelebs = "lib/le/bs" | ||
259 | TUNE_FEATURES:tune-microblazelebs = "microblaze barrel-shift" | ||
260 | PACKAGE_EXTRA_ARCHS:tune-microblazelebs = "${TUNE_PKGARCH}" | ||
261 | |||
262 | |||
263 | # le/p | ||
264 | # CFLAGS: -mlittle-endian -mxl-pattern-compare | ||
265 | DEFAULTTUNE:virtclass-multilib-libmblep = "microblazelep" | ||
266 | |||
267 | AVAILTUNES += "microblazelep" | ||
268 | BASE_LIB:tune-microblazelep = "lib/le/p" | ||
269 | TUNE_FEATURES:tune-microblazelep = "microblaze pattern-compare" | ||
270 | PACKAGE_EXTRA_ARCHS:tune-microblazelep = "${TUNE_PKGARCH}" | ||
271 | |||
272 | |||
273 | # le/m | ||
274 | # CFLAGS: -mlittle-endian -mno-xl-soft-mul | ||
275 | DEFAULTTUNE:virtclass-multilib-libmblem = "microblazelem" | ||
276 | |||
277 | AVAILTUNES += "microblazelem" | ||
278 | BASE_LIB:tune-microblazelem = "lib/le/m" | ||
279 | TUNE_FEATURES:tune-microblazelem = "microblaze multiply-low" | ||
280 | PACKAGE_EXTRA_ARCHS:tune-microblazelem = "${TUNE_PKGARCH}" | ||
281 | |||
282 | |||
283 | # le/fpd | ||
284 | # CFLAGS: -mlittle-endian -mhard-float | ||
285 | DEFAULTTUNE:virtclass-multilib-libmblefpd = "microblazelefpd" | ||
286 | |||
287 | AVAILTUNES += "microblazelefpd" | ||
288 | BASE_LIB:tune-microblazelefpd = "lib/le/fpd" | ||
289 | TUNE_FEATURES:tune-microblazelefpd = "microblaze fpu-hard" | ||
290 | PACKAGE_EXTRA_ARCHS:tune-microblazelefpd = "${TUNE_PKGARCH}" | ||
291 | |||
292 | |||
293 | # le/m/fpd | ||
294 | # CFLAGS: -mlittle-endian -mno-xl-soft-mul -mhard-float | ||
295 | DEFAULTTUNE:virtclass-multilib-libmblemfpd = "microblazelemfpd" | ||
296 | |||
297 | AVAILTUNES += "microblazelemfpd" | ||
298 | BASE_LIB:tune-microblazelemfpd = "lib/le/m/fpd" | ||
299 | TUNE_FEATURES:tune-microblazelemfpd = "microblaze multiply-low fpu-hard" | ||
300 | PACKAGE_EXTRA_ARCHS:tune-microblazelemfpd = "${TUNE_PKGARCH}" | ||
301 | |||
302 | |||
303 | # le/p/m | ||
304 | # CFLAGS: -mlittle-endian -mxl-pattern-compare -mno-xl-soft-mul | ||
305 | DEFAULTTUNE:virtclass-multilib-libmblepm = "microblazelepm" | ||
306 | |||
307 | AVAILTUNES += "microblazelepm" | ||
308 | BASE_LIB:tune-microblazelepm = "lib/le/p/m" | ||
309 | TUNE_FEATURES:tune-microblazelepm = "microblaze pattern-compare multiply-low" | ||
310 | PACKAGE_EXTRA_ARCHS:tune-microblazelepm = "${TUNE_PKGARCH}" | ||
311 | |||
312 | |||
313 | # le/p/fpd | ||
314 | # CFLAGS: -mlittle-endian -mxl-pattern-compare -mhard-float | ||
315 | DEFAULTTUNE:virtclass-multilib-libmblepfpd = "microblazelepfpd" | ||
316 | |||
317 | AVAILTUNES += "microblazelepfpd" | ||
318 | BASE_LIB:tune-microblazelepfpd = "lib/le/p/fpd" | ||
319 | TUNE_FEATURES:tune-microblazelepfpd = "microblaze pattern-compare fpu-hard" | ||
320 | PACKAGE_EXTRA_ARCHS:tune-microblazelepfpd = "${TUNE_PKGARCH}" | ||
321 | |||
322 | |||
323 | # le/p/m/fpd | ||
324 | # CFLAGS: -mlittle-endian -mxl-pattern-compare -mno-xl-soft-mul -mhard-float | ||
325 | DEFAULTTUNE:virtclass-multilib-libmblepmfpd = "microblazelepmfpd" | ||
326 | |||
327 | AVAILTUNES += "microblazelepmfpd" | ||
328 | BASE_LIB:tune-microblazelepmfpd = "lib/le/p/m/fpd" | ||
329 | TUNE_FEATURES:tune-microblazelepmfpd = "microblaze pattern-compare multiply-low fpu-hard" | ||
330 | PACKAGE_EXTRA_ARCHS:tune-microblazelepmfpd = "${TUNE_PKGARCH}" | ||
331 | |||
332 | |||
333 | # le/bs/p | ||
334 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare | ||
335 | DEFAULTTUNE:virtclass-multilib-libmblebsp = "microblazelebsp" | ||
336 | |||
337 | AVAILTUNES += "microblazelebsp" | ||
338 | BASE_LIB:tune-microblazelebsp = "lib/le/bs/p" | ||
339 | TUNE_FEATURES:tune-microblazelebsp = "microblaze barrel-shift pattern-compare" | ||
340 | PACKAGE_EXTRA_ARCHS:tune-microblazelebsp = "${TUNE_PKGARCH}" | ||
341 | |||
342 | |||
343 | # le/bs/m | ||
344 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mno-xl-soft-mul | ||
345 | DEFAULTTUNE:virtclass-multilib-libmblebsm = "microblazelebsm" | ||
346 | |||
347 | AVAILTUNES += "microblazelebsm" | ||
348 | BASE_LIB:tune-microblazelebsm = "lib/le/bs/m" | ||
349 | TUNE_FEATURES:tune-microblazelebsm = "microblaze barrel-shift multiply-low" | ||
350 | PACKAGE_EXTRA_ARCHS:tune-microblazelebsm = "${TUNE_PKGARCH}" | ||
351 | |||
352 | |||
353 | # le/bs/fpd | ||
354 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mhard-float | ||
355 | DEFAULTTUNE:virtclass-multilib-libmblebsfpd = "microblazelebsfpd" | ||
356 | |||
357 | AVAILTUNES += "microblazelebsfpd" | ||
358 | BASE_LIB:tune-microblazelebsfpd = "lib/le/bs/fpd" | ||
359 | TUNE_FEATURES:tune-microblazelebsfpd = "microblaze barrel-shift fpu-hard" | ||
360 | PACKAGE_EXTRA_ARCHS:tune-microblazelebsfpd = "${TUNE_PKGARCH}" | ||
361 | |||
362 | |||
363 | # le/bs/m/fpd | ||
364 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mno-xl-soft-mul -mhard-float | ||
365 | DEFAULTTUNE:virtclass-multilib-libmblebsmfpd = "microblazelebsmfpd" | ||
366 | |||
367 | AVAILTUNES += "microblazelebsmfpd" | ||
368 | BASE_LIB:tune-microblazelebsmfpd = "lib/le/bs/m/fpd" | ||
369 | TUNE_FEATURES:tune-microblazelebsmfpd = "microblaze barrel-shift multiply-low fpu-hard" | ||
370 | PACKAGE_EXTRA_ARCHS:tune-microblazelebsmfpd = "${TUNE_PKGARCH}" | ||
371 | |||
372 | |||
373 | # le/bs/p/m | ||
374 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-mul | ||
375 | DEFAULTTUNE:virtclass-multilib-libmblebspm = "microblazelebspm" | ||
376 | |||
377 | AVAILTUNES += "microblazelebspm" | ||
378 | BASE_LIB:tune-microblazelebspm = "lib/le/bs/p/m" | ||
379 | TUNE_FEATURES:tune-microblazelebspm = "microblaze barrel-shift pattern-compare multiply-low" | ||
380 | PACKAGE_EXTRA_ARCHS:tune-microblazelebspm = "${TUNE_PKGARCH}" | ||
381 | |||
382 | |||
383 | # le/bs/p/fpd | ||
384 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mhard-float | ||
385 | DEFAULTTUNE:virtclass-multilib-libmblebspfpd = "microblazelebspfpd" | ||
386 | |||
387 | AVAILTUNES += "microblazelebspfpd" | ||
388 | BASE_LIB:tune-microblazelebspfpd = "lib/le/bs/p/fpd" | ||
389 | TUNE_FEATURES:tune-microblazelebspfpd = "microblaze barrel-shift pattern-compare fpu-hard" | ||
390 | PACKAGE_EXTRA_ARCHS:tune-microblazelebspfpd = "${TUNE_PKGARCH}" | ||
391 | |||
392 | |||
393 | # le/bs/p/m/fpd | ||
394 | # CFLAGS: -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-mul -mhard-float | ||
395 | DEFAULTTUNE:virtclass-multilib-libmblebspmfpd = "microblazelebspmfpd" | ||
396 | |||
397 | AVAILTUNES += "microblazelebspmfpd" | ||
398 | BASE_LIB:tune-microblazelebspmfpd = "lib/le/bs/p/m/fpd" | ||
399 | TUNE_FEATURES:tune-microblazelebspmfpd = "microblaze barrel-shift pattern-compare multiply-low fpu-hard" | ||
400 | PACKAGE_EXTRA_ARCHS:tune-microblazelebspmfpd = "${TUNE_PKGARCH}" | ||
401 | |||
402 | |||
403 | # le/m64/bs | ||
404 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift | ||
405 | DEFAULTTUNE:virtclass-multilib-libmblem64bs = "microblazele64bs" | ||
406 | |||
407 | AVAILTUNES += "microblazele64bs" | ||
408 | BASE_LIB:tune-microblazele64bs = "lib/le/m64/bs" | ||
409 | TUNE_FEATURES:tune-microblazele64bs = "microblaze 64-bit barrel-shift" | ||
410 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bs = "${TUNE_PKGARCH}" | ||
411 | |||
412 | |||
413 | # le/m64/p | ||
414 | # CFLAGS: -mlittle-endian -m64 -mxl-pattern-compare | ||
415 | DEFAULTTUNE:virtclass-multilib-libmblem64p = "microblazele64p" | ||
416 | |||
417 | AVAILTUNES += "microblazele64p" | ||
418 | BASE_LIB:tune-microblazele64p = "lib/le/m64/p" | ||
419 | TUNE_FEATURES:tune-microblazele64p = "microblaze 64-bit pattern-compare" | ||
420 | PACKAGE_EXTRA_ARCHS:tune-microblazele64p = "${TUNE_PKGARCH}" | ||
421 | |||
422 | |||
423 | # le/m64/m | ||
424 | # CFLAGS: -mlittle-endian -m64 -mno-xl-soft-mul | ||
425 | DEFAULTTUNE:virtclass-multilib-libmblem64m = "microblazele64m" | ||
426 | |||
427 | AVAILTUNES += "microblazele64m" | ||
428 | BASE_LIB:tune-microblazele64m = "lib/le/m64/m" | ||
429 | TUNE_FEATURES:tune-microblazele64m = "microblaze 64-bit multiply-low" | ||
430 | PACKAGE_EXTRA_ARCHS:tune-microblazele64m = "${TUNE_PKGARCH}" | ||
431 | |||
432 | |||
433 | # le/m64/fpd | ||
434 | # CFLAGS: -mlittle-endian -m64 -mhard-float | ||
435 | DEFAULTTUNE:virtclass-multilib-libmblem64fpd = "microblazele64fpd" | ||
436 | |||
437 | AVAILTUNES += "microblazele64fpd" | ||
438 | BASE_LIB:tune-microblazele64fpd = "lib/le/m64/fpd" | ||
439 | TUNE_FEATURES:tune-microblazele64fpd = "microblaze 64-bit fpu-hard" | ||
440 | PACKAGE_EXTRA_ARCHS:tune-microblazele64fpd = "${TUNE_PKGARCH}" | ||
441 | |||
442 | |||
443 | # le/m64/m/fpd | ||
444 | # CFLAGS: -mlittle-endian -m64 -mno-xl-soft-mul -mhard-float | ||
445 | DEFAULTTUNE:virtclass-multilib-libmblem64mfpd = "microblazele64mfpd" | ||
446 | |||
447 | AVAILTUNES += "microblazele64mfpd" | ||
448 | BASE_LIB:tune-microblazele64mfpd = "lib/le/m64/m/fpd" | ||
449 | TUNE_FEATURES:tune-microblazele64mfpd = "microblaze 64-bit multiply-low fpu-hard" | ||
450 | PACKAGE_EXTRA_ARCHS:tune-microblazele64mfpd = "${TUNE_PKGARCH}" | ||
451 | |||
452 | |||
453 | # le/m64/p/m | ||
454 | # CFLAGS: -mlittle-endian -m64 -mxl-pattern-compare -mno-xl-soft-mul | ||
455 | DEFAULTTUNE:virtclass-multilib-libmblem64pm = "microblazele64pm" | ||
456 | |||
457 | AVAILTUNES += "microblazele64pm" | ||
458 | BASE_LIB:tune-microblazele64pm = "lib/le/m64/p/m" | ||
459 | TUNE_FEATURES:tune-microblazele64pm = "microblaze 64-bit pattern-compare multiply-low" | ||
460 | PACKAGE_EXTRA_ARCHS:tune-microblazele64pm = "${TUNE_PKGARCH}" | ||
461 | |||
462 | |||
463 | # le/m64/p/fpd | ||
464 | # CFLAGS: -mlittle-endian -m64 -mxl-pattern-compare -mhard-float | ||
465 | DEFAULTTUNE:virtclass-multilib-libmblem64pfpd = "microblazele64pfpd" | ||
466 | |||
467 | AVAILTUNES += "microblazele64pfpd" | ||
468 | BASE_LIB:tune-microblazele64pfpd = "lib/le/m64/p/fpd" | ||
469 | TUNE_FEATURES:tune-microblazele64pfpd = "microblaze 64-bit pattern-compare fpu-hard" | ||
470 | PACKAGE_EXTRA_ARCHS:tune-microblazele64pfpd = "${TUNE_PKGARCH}" | ||
471 | |||
472 | |||
473 | # le/m64/p/m/fpd | ||
474 | # CFLAGS: -mlittle-endian -m64 -mxl-pattern-compare -mno-xl-soft-mul -mhard-float | ||
475 | DEFAULTTUNE:virtclass-multilib-libmblem64pmfpd = "microblazele64pmfpd" | ||
476 | |||
477 | AVAILTUNES += "microblazele64pmfpd" | ||
478 | BASE_LIB:tune-microblazele64pmfpd = "lib/le/m64/p/m/fpd" | ||
479 | TUNE_FEATURES:tune-microblazele64pmfpd = "microblaze 64-bit pattern-compare multiply-low fpu-hard" | ||
480 | PACKAGE_EXTRA_ARCHS:tune-microblazele64pmfpd = "${TUNE_PKGARCH}" | ||
481 | |||
482 | |||
483 | # le/m64/bs/p | ||
484 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mxl-pattern-compare | ||
485 | DEFAULTTUNE:virtclass-multilib-libmblem64bsp = "microblazele64bsp" | ||
486 | |||
487 | AVAILTUNES += "microblazele64bsp" | ||
488 | BASE_LIB:tune-microblazele64bsp = "lib/le/m64/bs/p" | ||
489 | TUNE_FEATURES:tune-microblazele64bsp = "microblaze 64-bit barrel-shift pattern-compare" | ||
490 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bsp = "${TUNE_PKGARCH}" | ||
491 | |||
492 | |||
493 | # le/m64/bs/m | ||
494 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mno-xl-soft-mul | ||
495 | DEFAULTTUNE:virtclass-multilib-libmblem64bsm = "microblazele64bsm" | ||
496 | |||
497 | AVAILTUNES += "microblazele64bsm" | ||
498 | BASE_LIB:tune-microblazele64bsm = "lib/le/m64/bs/m" | ||
499 | TUNE_FEATURES:tune-microblazele64bsm = "microblaze 64-bit barrel-shift multiply-low" | ||
500 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bsm = "${TUNE_PKGARCH}" | ||
501 | |||
502 | |||
503 | # le/m64/bs/fpd | ||
504 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mhard-float | ||
505 | DEFAULTTUNE:virtclass-multilib-libmblem64bsfpd = "microblazele64bsfpd" | ||
506 | |||
507 | AVAILTUNES += "microblazele64bsfpd" | ||
508 | BASE_LIB:tune-microblazele64bsfpd = "lib/le/m64/bs/fpd" | ||
509 | TUNE_FEATURES:tune-microblazele64bsfpd = "microblaze 64-bit barrel-shift fpu-hard" | ||
510 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bsfpd = "${TUNE_PKGARCH}" | ||
511 | |||
512 | |||
513 | # le/m64/bs/m/fpd | ||
514 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mno-xl-soft-mul -mhard-float | ||
515 | DEFAULTTUNE:virtclass-multilib-libmblem64bsmfpd = "microblazele64bsmfpd" | ||
516 | |||
517 | AVAILTUNES += "microblazele64bsmfpd" | ||
518 | BASE_LIB:tune-microblazele64bsmfpd = "lib/le/m64/bs/m/fpd" | ||
519 | TUNE_FEATURES:tune-microblazele64bsmfpd = "microblaze 64-bit barrel-shift multiply-low fpu-hard" | ||
520 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bsmfpd = "${TUNE_PKGARCH}" | ||
521 | |||
522 | |||
523 | # le/m64/bs/p/m | ||
524 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-mul | ||
525 | DEFAULTTUNE:virtclass-multilib-libmblem64bspm = "microblazele64bspm" | ||
526 | |||
527 | AVAILTUNES += "microblazele64bspm" | ||
528 | BASE_LIB:tune-microblazele64bspm = "lib/le/m64/bs/p/m" | ||
529 | TUNE_FEATURES:tune-microblazele64bspm = "microblaze 64-bit barrel-shift pattern-compare multiply-low" | ||
530 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bspm = "${TUNE_PKGARCH}" | ||
531 | |||
532 | |||
533 | # le/m64/bs/p/fpd | ||
534 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mxl-pattern-compare -mhard-float | ||
535 | DEFAULTTUNE:virtclass-multilib-libmblem64bspfpd = "microblazele64bspfpd" | ||
536 | |||
537 | AVAILTUNES += "microblazele64bspfpd" | ||
538 | BASE_LIB:tune-microblazele64bspfpd = "lib/le/m64/bs/p/fpd" | ||
539 | TUNE_FEATURES:tune-microblazele64bspfpd = "microblaze 64-bit barrel-shift pattern-compare fpu-hard" | ||
540 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bspfpd = "${TUNE_PKGARCH}" | ||
541 | |||
542 | |||
543 | # le/m64/bs/p/m/fpd | ||
544 | # CFLAGS: -mlittle-endian -m64 -mxl-barrel-shift -mxl-pattern-compare -mno-xl-soft-mul -mhard-float | ||
545 | DEFAULTTUNE:virtclass-multilib-libmblem64bspmfpd = "microblazele64bspmfpd" | ||
546 | |||
547 | AVAILTUNES += "microblazele64bspmfpd" | ||
548 | BASE_LIB:tune-microblazele64bspmfpd = "lib/le/m64/bs/p/m/fpd" | ||
549 | TUNE_FEATURES:tune-microblazele64bspmfpd = "microblaze 64-bit barrel-shift pattern-compare multiply-low fpu-hard" | ||
550 | PACKAGE_EXTRA_ARCHS:tune-microblazele64bspmfpd = "${TUNE_PKGARCH}" | ||
diff --git a/meta-vitis-tc/conf/machine/riscv-tc.conf b/meta-vitis-tc/conf/machine/riscv-tc.conf new file mode 100644 index 00000000..0a6c6d08 --- /dev/null +++ b/meta-vitis-tc/conf/machine/riscv-tc.conf | |||
@@ -0,0 +1,303 @@ | |||
1 | require conf/machine/include/machine-xilinx-qemu.inc | ||
2 | require conf/multilib.conf | ||
3 | require conf/machine/include/riscv/tune-riscv.inc | ||
4 | require conf/machine/include/baremetal-tc.conf | ||
5 | |||
6 | # Set defaults | ||
7 | # We don't know why pie is not supported, but when enabled results in: | ||
8 | # .../riscv32-xilinx-elf/12.2.0/ld: -pie not supported | ||
9 | GCCPIE:riscv-tc = "" | ||
10 | GLIBCPIE:riscv-tc = "" | ||
11 | SECURITY_CFLAGS:remove:riscv-tc = "${SECURITY_PIE_CFLAGS}" | ||
12 | SECURITY_CFLAGS:pn-libgcc:riscv-tc = "" | ||
13 | |||
14 | # Make 'riscv' a valid tune feature | ||
15 | TUNEVALID[riscv] = "Define the entire architecture family" | ||
16 | TUNE_CCARGS = "${TUNE_CCARGS:tune-${DEFAULTTUNE}}" | ||
17 | |||
18 | # Define all of the multilibs supported by this configuration | ||
19 | MULTILIB_GLOBAL_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" | ||
20 | |||
21 | ############# DEFAULT SET ################## | ||
22 | MULTILIBS = "" | ||
23 | |||
24 | # Base configuration | ||
25 | # CFLAGS: | ||
26 | DEFAULTTUNE = "riscv" | ||
27 | |||
28 | AVAILTUNES += "riscv" | ||
29 | PACKAGE_EXTRA_ARCHS:tune-riscv = "${TUNE_PKGARCH:tune-riscv}" | ||
30 | BASE_LIB:tune-riscv = "lib" | ||
31 | TUNE_FEATURES:tune-riscv = "riscv" | ||
32 | TUNE_CCARGS:tune-riscv = "" | ||
33 | TUNE_PKGARCH:tune-riscv = "riscv32" | ||
34 | TUNE_ARCH:tune-riscv = "riscv32" | ||
35 | |||
36 | ############ GENERATED ############# | ||
37 | # Multilibs defined in recipes-devtools/gcc/gcc-xilinx-standalone-multilib.inc | ||
38 | # Everything below is generated by riscv-convert.sh | ||
39 | MULTILIBS = "" | ||
40 | MULTILIBS += "multilib:librv32iilp32" | ||
41 | MULTILIBS += "multilib:librv32if_zicsrilp32f" | ||
42 | MULTILIBS += "multilib:librv32icilp32" | ||
43 | MULTILIBS += "multilib:librv32ifc_zicsrilp32f" | ||
44 | MULTILIBS += "multilib:librv32imilp32" | ||
45 | MULTILIBS += "multilib:librv32imf_zicsrilp32f" | ||
46 | MULTILIBS += "multilib:librv32imcilp32" | ||
47 | MULTILIBS += "multilib:librv32imfc_zicsrilp32f" | ||
48 | MULTILIBS += "multilib:librv64ilp64" | ||
49 | MULTILIBS += "multilib:librv64if_zicsrlp64f" | ||
50 | MULTILIBS += "multilib:librv64iclp64" | ||
51 | MULTILIBS += "multilib:librv64ifc_zicsrlp64f" | ||
52 | MULTILIBS += "multilib:librv64imlp64" | ||
53 | MULTILIBS += "multilib:librv64imf_zicsrlp64f" | ||
54 | MULTILIBS += "multilib:librv64imclp64" | ||
55 | MULTILIBS += "multilib:librv64imfc_zicsrlp64f" | ||
56 | MULTILIBS += "multilib:librv32imfdc_zicsrilp32d" | ||
57 | MULTILIBS += "multilib:librv64imfdc_zicsrlp64d" | ||
58 | |||
59 | # Base configuration | ||
60 | # CFLAGS: | ||
61 | DEFAULTTUNE = "riscv" | ||
62 | |||
63 | AVAILTUNES += "riscv" | ||
64 | PACKAGE_EXTRA_ARCHS:tune-riscv = "${TUNE_PKGARCH:tune-riscv}" | ||
65 | BASE_LIB:tune-riscv = "lib" | ||
66 | TUNE_FEATURES:tune-riscv = "riscv" | ||
67 | TUNE_CCARGS:tune-riscv = "" | ||
68 | TUNE_PKGARCH:tune-riscv = "riscv32" | ||
69 | TUNE_ARCH:tune-riscv = "riscv32" | ||
70 | |||
71 | |||
72 | # rv32i/ilp32 | ||
73 | # CFLAGS: -march=rv32i -mabi=ilp32 | ||
74 | DEFAULTTUNE:virtclass-multilib-librv32iilp32 = "rv32iilp32" | ||
75 | |||
76 | AVAILTUNES += "rv32iilp32" | ||
77 | PACKAGE_EXTRA_ARCHS:tune-rv32iilp32 = "${TUNE_PKGARCH:tune-rv32iilp32}" | ||
78 | BASE_LIB:tune-rv32iilp32 = "lib/rv32i/ilp32" | ||
79 | TUNE_FEATURES:tune-rv32iilp32 = "riscv" | ||
80 | TUNE_CCARGS:tune-rv32iilp32 = " -march=rv32i -mabi=ilp32" | ||
81 | TUNE_PKGARCH:tune-rv32iilp32 = "rv32iilp32" | ||
82 | TUNE_ARCH:tune-rv32iilp32 = "riscv32" | ||
83 | |||
84 | |||
85 | # rv32if_zicsr/ilp32f | ||
86 | # CFLAGS: -march=rv32if_zicsr -mabi=ilp32f | ||
87 | DEFAULTTUNE:virtclass-multilib-librv32if_zicsrilp32f = "rv32if_zicsrilp32f" | ||
88 | |||
89 | AVAILTUNES += "rv32if_zicsrilp32f" | ||
90 | PACKAGE_EXTRA_ARCHS:tune-rv32if_zicsrilp32f = "${TUNE_PKGARCH:tune-rv32if_zicsrilp32f}" | ||
91 | BASE_LIB:tune-rv32if_zicsrilp32f = "lib/rv32if_zicsr/ilp32f" | ||
92 | TUNE_FEATURES:tune-rv32if_zicsrilp32f = "riscv" | ||
93 | TUNE_CCARGS:tune-rv32if_zicsrilp32f = " -march=rv32if_zicsr -mabi=ilp32f" | ||
94 | TUNE_PKGARCH:tune-rv32if_zicsrilp32f = "rv32if_zicsrilp32f" | ||
95 | TUNE_ARCH:tune-rv32if_zicsrilp32f = "riscv32" | ||
96 | |||
97 | |||
98 | # rv32ic/ilp32 | ||
99 | # CFLAGS: -march=rv32ic -mabi=ilp32 | ||
100 | DEFAULTTUNE:virtclass-multilib-librv32icilp32 = "rv32icilp32" | ||
101 | |||
102 | AVAILTUNES += "rv32icilp32" | ||
103 | PACKAGE_EXTRA_ARCHS:tune-rv32icilp32 = "${TUNE_PKGARCH:tune-rv32icilp32}" | ||
104 | BASE_LIB:tune-rv32icilp32 = "lib/rv32ic/ilp32" | ||
105 | TUNE_FEATURES:tune-rv32icilp32 = "riscv" | ||
106 | TUNE_CCARGS:tune-rv32icilp32 = " -march=rv32ic -mabi=ilp32" | ||
107 | TUNE_PKGARCH:tune-rv32icilp32 = "rv32icilp32" | ||
108 | TUNE_ARCH:tune-rv32icilp32 = "riscv32" | ||
109 | |||
110 | |||
111 | # rv32ifc_zicsr/ilp32f | ||
112 | # CFLAGS: -march=rv32ifc_zicsr -mabi=ilp32f | ||
113 | DEFAULTTUNE:virtclass-multilib-librv32ifc_zicsrilp32f = "rv32ifc_zicsrilp32f" | ||
114 | |||
115 | AVAILTUNES += "rv32ifc_zicsrilp32f" | ||
116 | PACKAGE_EXTRA_ARCHS:tune-rv32ifc_zicsrilp32f = "${TUNE_PKGARCH:tune-rv32ifc_zicsrilp32f}" | ||
117 | BASE_LIB:tune-rv32ifc_zicsrilp32f = "lib/rv32ifc_zicsr/ilp32f" | ||
118 | TUNE_FEATURES:tune-rv32ifc_zicsrilp32f = "riscv" | ||
119 | TUNE_CCARGS:tune-rv32ifc_zicsrilp32f = " -march=rv32ifc_zicsr -mabi=ilp32f" | ||
120 | TUNE_PKGARCH:tune-rv32ifc_zicsrilp32f = "rv32ifc_zicsrilp32f" | ||
121 | TUNE_ARCH:tune-rv32ifc_zicsrilp32f = "riscv32" | ||
122 | |||
123 | |||
124 | # rv32im/ilp32 | ||
125 | # CFLAGS: -march=rv32im -mabi=ilp32 | ||
126 | DEFAULTTUNE:virtclass-multilib-librv32imilp32 = "rv32imilp32" | ||
127 | |||
128 | AVAILTUNES += "rv32imilp32" | ||
129 | PACKAGE_EXTRA_ARCHS:tune-rv32imilp32 = "${TUNE_PKGARCH:tune-rv32imilp32}" | ||
130 | BASE_LIB:tune-rv32imilp32 = "lib/rv32im/ilp32" | ||
131 | TUNE_FEATURES:tune-rv32imilp32 = "riscv" | ||
132 | TUNE_CCARGS:tune-rv32imilp32 = " -march=rv32im -mabi=ilp32" | ||
133 | TUNE_PKGARCH:tune-rv32imilp32 = "rv32imilp32" | ||
134 | TUNE_ARCH:tune-rv32imilp32 = "riscv32" | ||
135 | |||
136 | |||
137 | # rv32imf_zicsr/ilp32f | ||
138 | # CFLAGS: -march=rv32imf_zicsr -mabi=ilp32f | ||
139 | DEFAULTTUNE:virtclass-multilib-librv32imf_zicsrilp32f = "rv32imf_zicsrilp32f" | ||
140 | |||
141 | AVAILTUNES += "rv32imf_zicsrilp32f" | ||
142 | PACKAGE_EXTRA_ARCHS:tune-rv32imf_zicsrilp32f = "${TUNE_PKGARCH:tune-rv32imf_zicsrilp32f}" | ||
143 | BASE_LIB:tune-rv32imf_zicsrilp32f = "lib/rv32imf_zicsr/ilp32f" | ||
144 | TUNE_FEATURES:tune-rv32imf_zicsrilp32f = "riscv" | ||
145 | TUNE_CCARGS:tune-rv32imf_zicsrilp32f = " -march=rv32imf_zicsr -mabi=ilp32f" | ||
146 | TUNE_PKGARCH:tune-rv32imf_zicsrilp32f = "rv32imf_zicsrilp32f" | ||
147 | TUNE_ARCH:tune-rv32imf_zicsrilp32f = "riscv32" | ||
148 | |||
149 | |||
150 | # rv32imc/ilp32 | ||
151 | # CFLAGS: -march=rv32imc -mabi=ilp32 | ||
152 | DEFAULTTUNE:virtclass-multilib-librv32imcilp32 = "rv32imcilp32" | ||
153 | |||
154 | AVAILTUNES += "rv32imcilp32" | ||
155 | PACKAGE_EXTRA_ARCHS:tune-rv32imcilp32 = "${TUNE_PKGARCH:tune-rv32imcilp32}" | ||
156 | BASE_LIB:tune-rv32imcilp32 = "lib/rv32imc/ilp32" | ||
157 | TUNE_FEATURES:tune-rv32imcilp32 = "riscv" | ||
158 | TUNE_CCARGS:tune-rv32imcilp32 = " -march=rv32imc -mabi=ilp32" | ||
159 | TUNE_PKGARCH:tune-rv32imcilp32 = "rv32imcilp32" | ||
160 | TUNE_ARCH:tune-rv32imcilp32 = "riscv32" | ||
161 | |||
162 | |||
163 | # rv32imfc_zicsr/ilp32f | ||
164 | # CFLAGS: -march=rv32imfc_zicsr -mabi=ilp32f | ||
165 | DEFAULTTUNE:virtclass-multilib-librv32imfc_zicsrilp32f = "rv32imfc_zicsrilp32f" | ||
166 | |||
167 | AVAILTUNES += "rv32imfc_zicsrilp32f" | ||
168 | PACKAGE_EXTRA_ARCHS:tune-rv32imfc_zicsrilp32f = "${TUNE_PKGARCH:tune-rv32imfc_zicsrilp32f}" | ||
169 | BASE_LIB:tune-rv32imfc_zicsrilp32f = "lib/rv32imfc_zicsr/ilp32f" | ||
170 | TUNE_FEATURES:tune-rv32imfc_zicsrilp32f = "riscv" | ||
171 | TUNE_CCARGS:tune-rv32imfc_zicsrilp32f = " -march=rv32imfc_zicsr -mabi=ilp32f" | ||
172 | TUNE_PKGARCH:tune-rv32imfc_zicsrilp32f = "rv32imfc_zicsrilp32f" | ||
173 | TUNE_ARCH:tune-rv32imfc_zicsrilp32f = "riscv32" | ||
174 | |||
175 | |||
176 | # rv64i/lp64 | ||
177 | # CFLAGS: -march=rv64i -mabi=lp64 | ||
178 | DEFAULTTUNE:virtclass-multilib-librv64ilp64 = "rv64ilp64" | ||
179 | |||
180 | AVAILTUNES += "rv64ilp64" | ||
181 | PACKAGE_EXTRA_ARCHS:tune-rv64ilp64 = "${TUNE_PKGARCH:tune-rv64ilp64}" | ||
182 | BASE_LIB:tune-rv64ilp64 = "lib/rv64i/lp64" | ||
183 | TUNE_FEATURES:tune-rv64ilp64 = "riscv" | ||
184 | TUNE_CCARGS:tune-rv64ilp64 = " -march=rv64i -mabi=lp64" | ||
185 | TUNE_PKGARCH:tune-rv64ilp64 = "rv64ilp64" | ||
186 | TUNE_ARCH:tune-rv64ilp64 = "riscv64" | ||
187 | |||
188 | |||
189 | # rv64if_zicsr/lp64f | ||
190 | # CFLAGS: -march=rv64if_zicsr -mabi=lp64f | ||
191 | DEFAULTTUNE:virtclass-multilib-librv64if_zicsrlp64f = "rv64if_zicsrlp64f" | ||
192 | |||
193 | AVAILTUNES += "rv64if_zicsrlp64f" | ||
194 | PACKAGE_EXTRA_ARCHS:tune-rv64if_zicsrlp64f = "${TUNE_PKGARCH:tune-rv64if_zicsrlp64f}" | ||
195 | BASE_LIB:tune-rv64if_zicsrlp64f = "lib/rv64if_zicsr/lp64f" | ||
196 | TUNE_FEATURES:tune-rv64if_zicsrlp64f = "riscv" | ||
197 | TUNE_CCARGS:tune-rv64if_zicsrlp64f = " -march=rv64if_zicsr -mabi=lp64f" | ||
198 | TUNE_PKGARCH:tune-rv64if_zicsrlp64f = "rv64if_zicsrlp64f" | ||
199 | TUNE_ARCH:tune-rv64if_zicsrlp64f = "riscv64" | ||
200 | |||
201 | |||
202 | # rv64ic/lp64 | ||
203 | # CFLAGS: -march=rv64ic -mabi=lp64 | ||
204 | DEFAULTTUNE:virtclass-multilib-librv64iclp64 = "rv64iclp64" | ||
205 | |||
206 | AVAILTUNES += "rv64iclp64" | ||
207 | PACKAGE_EXTRA_ARCHS:tune-rv64iclp64 = "${TUNE_PKGARCH:tune-rv64iclp64}" | ||
208 | BASE_LIB:tune-rv64iclp64 = "lib/rv64ic/lp64" | ||
209 | TUNE_FEATURES:tune-rv64iclp64 = "riscv" | ||
210 | TUNE_CCARGS:tune-rv64iclp64 = " -march=rv64ic -mabi=lp64" | ||
211 | TUNE_PKGARCH:tune-rv64iclp64 = "rv64iclp64" | ||
212 | TUNE_ARCH:tune-rv64iclp64 = "riscv64" | ||
213 | |||
214 | |||
215 | # rv64ifc_zicsr/lp64f | ||
216 | # CFLAGS: -march=rv64ifc_zicsr -mabi=lp64f | ||
217 | DEFAULTTUNE:virtclass-multilib-librv64ifc_zicsrlp64f = "rv64ifc_zicsrlp64f" | ||
218 | |||
219 | AVAILTUNES += "rv64ifc_zicsrlp64f" | ||
220 | PACKAGE_EXTRA_ARCHS:tune-rv64ifc_zicsrlp64f = "${TUNE_PKGARCH:tune-rv64ifc_zicsrlp64f}" | ||
221 | BASE_LIB:tune-rv64ifc_zicsrlp64f = "lib/rv64ifc_zicsr/lp64f" | ||
222 | TUNE_FEATURES:tune-rv64ifc_zicsrlp64f = "riscv" | ||
223 | TUNE_CCARGS:tune-rv64ifc_zicsrlp64f = " -march=rv64ifc_zicsr -mabi=lp64f" | ||
224 | TUNE_PKGARCH:tune-rv64ifc_zicsrlp64f = "rv64ifc_zicsrlp64f" | ||
225 | TUNE_ARCH:tune-rv64ifc_zicsrlp64f = "riscv64" | ||
226 | |||
227 | |||
228 | # rv64im/lp64 | ||
229 | # CFLAGS: -march=rv64im -mabi=lp64 | ||
230 | DEFAULTTUNE:virtclass-multilib-librv64imlp64 = "rv64imlp64" | ||
231 | |||
232 | AVAILTUNES += "rv64imlp64" | ||
233 | PACKAGE_EXTRA_ARCHS:tune-rv64imlp64 = "${TUNE_PKGARCH:tune-rv64imlp64}" | ||
234 | BASE_LIB:tune-rv64imlp64 = "lib/rv64im/lp64" | ||
235 | TUNE_FEATURES:tune-rv64imlp64 = "riscv" | ||
236 | TUNE_CCARGS:tune-rv64imlp64 = " -march=rv64im -mabi=lp64" | ||
237 | TUNE_PKGARCH:tune-rv64imlp64 = "rv64imlp64" | ||
238 | TUNE_ARCH:tune-rv64imlp64 = "riscv64" | ||
239 | |||
240 | |||
241 | # rv64imf_zicsr/lp64f | ||
242 | # CFLAGS: -march=rv64imf_zicsr -mabi=lp64f | ||
243 | DEFAULTTUNE:virtclass-multilib-librv64imf_zicsrlp64f = "rv64imf_zicsrlp64f" | ||
244 | |||
245 | AVAILTUNES += "rv64imf_zicsrlp64f" | ||
246 | PACKAGE_EXTRA_ARCHS:tune-rv64imf_zicsrlp64f = "${TUNE_PKGARCH:tune-rv64imf_zicsrlp64f}" | ||
247 | BASE_LIB:tune-rv64imf_zicsrlp64f = "lib/rv64imf_zicsr/lp64f" | ||
248 | TUNE_FEATURES:tune-rv64imf_zicsrlp64f = "riscv" | ||
249 | TUNE_CCARGS:tune-rv64imf_zicsrlp64f = " -march=rv64imf_zicsr -mabi=lp64f" | ||
250 | TUNE_PKGARCH:tune-rv64imf_zicsrlp64f = "rv64imf_zicsrlp64f" | ||
251 | TUNE_ARCH:tune-rv64imf_zicsrlp64f = "riscv64" | ||
252 | |||
253 | |||
254 | # rv64imc/lp64 | ||
255 | # CFLAGS: -march=rv64imc -mabi=lp64 | ||
256 | DEFAULTTUNE:virtclass-multilib-librv64imclp64 = "rv64imclp64" | ||
257 | |||
258 | AVAILTUNES += "rv64imclp64" | ||
259 | PACKAGE_EXTRA_ARCHS:tune-rv64imclp64 = "${TUNE_PKGARCH:tune-rv64imclp64}" | ||
260 | BASE_LIB:tune-rv64imclp64 = "lib/rv64imc/lp64" | ||
261 | TUNE_FEATURES:tune-rv64imclp64 = "riscv" | ||
262 | TUNE_CCARGS:tune-rv64imclp64 = " -march=rv64imc -mabi=lp64" | ||
263 | TUNE_PKGARCH:tune-rv64imclp64 = "rv64imclp64" | ||
264 | TUNE_ARCH:tune-rv64imclp64 = "riscv64" | ||
265 | |||
266 | |||
267 | # rv64imfc_zicsr/lp64f | ||
268 | # CFLAGS: -march=rv64imfc_zicsr -mabi=lp64f | ||
269 | DEFAULTTUNE:virtclass-multilib-librv64imfc_zicsrlp64f = "rv64imfc_zicsrlp64f" | ||
270 | |||
271 | AVAILTUNES += "rv64imfc_zicsrlp64f" | ||
272 | PACKAGE_EXTRA_ARCHS:tune-rv64imfc_zicsrlp64f = "${TUNE_PKGARCH:tune-rv64imfc_zicsrlp64f}" | ||
273 | BASE_LIB:tune-rv64imfc_zicsrlp64f = "lib/rv64imfc_zicsr/lp64f" | ||
274 | TUNE_FEATURES:tune-rv64imfc_zicsrlp64f = "riscv" | ||
275 | TUNE_CCARGS:tune-rv64imfc_zicsrlp64f = " -march=rv64imfc_zicsr -mabi=lp64f" | ||
276 | TUNE_PKGARCH:tune-rv64imfc_zicsrlp64f = "rv64imfc_zicsrlp64f" | ||
277 | TUNE_ARCH:tune-rv64imfc_zicsrlp64f = "riscv64" | ||
278 | |||
279 | |||
280 | # rv32imfdc_zicsr/ilp32d | ||
281 | # CFLAGS: -march=rv32imfdc_zicsr -mabi=ilp32d | ||
282 | DEFAULTTUNE:virtclass-multilib-librv32imfdc_zicsrilp32d = "rv32imfdc_zicsrilp32d" | ||
283 | |||
284 | AVAILTUNES += "rv32imfdc_zicsrilp32d" | ||
285 | PACKAGE_EXTRA_ARCHS:tune-rv32imfdc_zicsrilp32d = "${TUNE_PKGARCH:tune-rv32imfdc_zicsrilp32d}" | ||
286 | BASE_LIB:tune-rv32imfdc_zicsrilp32d = "lib/rv32imfdc_zicsr/ilp32d" | ||
287 | TUNE_FEATURES:tune-rv32imfdc_zicsrilp32d = "riscv" | ||
288 | TUNE_CCARGS:tune-rv32imfdc_zicsrilp32d = " -march=rv32imfdc_zicsr -mabi=ilp32d" | ||
289 | TUNE_PKGARCH:tune-rv32imfdc_zicsrilp32d = "rv32imfdc_zicsrilp32d" | ||
290 | TUNE_ARCH:tune-rv32imfdc_zicsrilp32d = "riscv32" | ||
291 | |||
292 | |||
293 | # rv64imfdc_zicsr/lp64d | ||
294 | # CFLAGS: -march=rv64imfdc_zicsr -mabi=lp64d | ||
295 | DEFAULTTUNE:virtclass-multilib-librv64imfdc_zicsrlp64d = "rv64imfdc_zicsrlp64d" | ||
296 | |||
297 | AVAILTUNES += "rv64imfdc_zicsrlp64d" | ||
298 | PACKAGE_EXTRA_ARCHS:tune-rv64imfdc_zicsrlp64d = "${TUNE_PKGARCH:tune-rv64imfdc_zicsrlp64d}" | ||
299 | BASE_LIB:tune-rv64imfdc_zicsrlp64d = "lib/rv64imfdc_zicsr/lp64d" | ||
300 | TUNE_FEATURES:tune-rv64imfdc_zicsrlp64d = "riscv" | ||
301 | TUNE_CCARGS:tune-rv64imfdc_zicsrlp64d = " -march=rv64imfdc_zicsr -mabi=lp64d" | ||
302 | TUNE_PKGARCH:tune-rv64imfdc_zicsrlp64d = "rv64imfdc_zicsrlp64d" | ||
303 | TUNE_ARCH:tune-rv64imfdc_zicsrlp64d = "riscv64" | ||
diff --git a/meta-vitis-tc/files/toolchain-shar-extract.sh b/meta-vitis-tc/files/toolchain-shar-extract.sh new file mode 100644 index 00000000..ec2008c8 --- /dev/null +++ b/meta-vitis-tc/files/toolchain-shar-extract.sh | |||
@@ -0,0 +1,303 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | export LC_ALL=en_US.UTF-8 | ||
4 | #Make sure at least one python is installed | ||
5 | INIT_PYTHON=$(which python3 2>/dev/null ) | ||
6 | [ -z "$INIT_PYTHON" ] && INIT_PYTHON=$(which python2 2>/dev/null) | ||
7 | [ -z "$INIT_PYTHON" ] && echo "Error: The SDK needs a python installed" && exit 1 | ||
8 | |||
9 | # Remove invalid PATH elements first (maybe from a previously setup toolchain now deleted | ||
10 | PATH=`$INIT_PYTHON -c 'import os; print(":".join(e for e in os.environ["PATH"].split(":") if os.path.exists(e)))'` | ||
11 | |||
12 | tweakpath () { | ||
13 | case ":${PATH}:" in | ||
14 | *:"$1":*) | ||
15 | ;; | ||
16 | *) | ||
17 | PATH=$PATH:$1 | ||
18 | esac | ||
19 | } | ||
20 | |||
21 | # Some systems don't have /usr/sbin or /sbin in the cleaned environment PATH but we make need it | ||
22 | # for the system's host tooling checks | ||
23 | tweakpath /usr/sbin | ||
24 | tweakpath /sbin | ||
25 | |||
26 | INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") | ||
27 | SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") | ||
28 | |||
29 | INST_GCC_VER=$(gcc --version 2>/dev/null | sed -ne 's/.* \([0-9]\+\.[0-9]\+\)\.[0-9]\+.*/\1/p') | ||
30 | SDK_GCC_VER='@SDK_GCC_VER@' | ||
31 | |||
32 | verlte () { | ||
33 | [ "$1" = "`printf "$1\n$2" | sort -V | head -n1`" ] | ||
34 | } | ||
35 | |||
36 | verlt() { | ||
37 | [ "$1" = "$2" ] && return 1 || verlte $1 $2 | ||
38 | } | ||
39 | |||
40 | verlt `uname -r` @OLDEST_KERNEL@ | ||
41 | if [ $? = 0 ]; then | ||
42 | echo "Error: The SDK needs a kernel > @OLDEST_KERNEL@" | ||
43 | exit 1 | ||
44 | fi | ||
45 | |||
46 | if [ "$INST_ARCH" != "$SDK_ARCH" ]; then | ||
47 | # Allow for installation of ix86 SDK on x86_64 host | ||
48 | if [ "$INST_ARCH" != x86_64 -o "$SDK_ARCH" != ix86 ]; then | ||
49 | echo "Error: Incompatible SDK installer! Your host is $INST_ARCH and this SDK was built for $SDK_ARCH hosts." | ||
50 | exit 1 | ||
51 | fi | ||
52 | fi | ||
53 | |||
54 | if ! xz -V > /dev/null 2>&1; then | ||
55 | echo "Error: xz is required for installation of this SDK, please install it first" | ||
56 | exit 1 | ||
57 | fi | ||
58 | |||
59 | SDK_BUILD_PATH="@SDKPATH@" | ||
60 | DEFAULT_INSTALL_DIR="@SDKPATHINSTALL@" | ||
61 | SUDO_EXEC="" | ||
62 | EXTRA_TAR_OPTIONS="" | ||
63 | target_sdk_dir="" | ||
64 | answer="" | ||
65 | relocate=1 | ||
66 | savescripts=0 | ||
67 | verbose=0 | ||
68 | publish=0 | ||
69 | listcontents=0 | ||
70 | while getopts ":yd:npDRrSl" OPT; do | ||
71 | case $OPT in | ||
72 | y) | ||
73 | answer="Y" | ||
74 | ;; | ||
75 | d) | ||
76 | target_sdk_dir=$OPTARG | ||
77 | ;; | ||
78 | n) | ||
79 | prepare_buildsystem="no" | ||
80 | ;; | ||
81 | p) | ||
82 | prepare_buildsystem="no" | ||
83 | publish=1 | ||
84 | ;; | ||
85 | D) | ||
86 | verbose=1 | ||
87 | ;; | ||
88 | r) | ||
89 | relocate=2 | ||
90 | ;; | ||
91 | R) | ||
92 | relocate=0 | ||
93 | savescripts=1 | ||
94 | ;; | ||
95 | S) | ||
96 | savescripts=1 | ||
97 | ;; | ||
98 | l) | ||
99 | listcontents=1 | ||
100 | ;; | ||
101 | *) | ||
102 | echo "Usage: $(basename "$0") [-y] [-d <dir>]" | ||
103 | echo " -y Automatic yes to all prompts" | ||
104 | echo " -d <dir> Install the SDK to <dir>" | ||
105 | echo "======== PetaLinux SDK only options ============" | ||
106 | echo " -r Enable runtime relocation, note this is slower" | ||
107 | #echo "======== Extensible SDK only options ============" | ||
108 | #echo " -n Do not prepare the build system" | ||
109 | #echo " -p Publish mode (implies -n)" | ||
110 | echo "======== Advanced DEBUGGING ONLY OPTIONS ========" | ||
111 | echo " -S Save relocation scripts" | ||
112 | echo " -R Do not relocate executables" | ||
113 | echo " -D use set -x to see what is going on" | ||
114 | echo " -l list files that will be extracted" | ||
115 | exit 1 | ||
116 | ;; | ||
117 | esac | ||
118 | done | ||
119 | |||
120 | payload_offset=$(($(grep -na -m1 "^MARKER:$" "$0"|cut -d':' -f1) + 1)) | ||
121 | if [ "$listcontents" = "1" ] ; then | ||
122 | if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then | ||
123 | tail -n +$payload_offset "$0" > sdk.zip | ||
124 | if unzip -l sdk.zip;then | ||
125 | rm sdk.zip | ||
126 | else | ||
127 | rm sdk.zip && exit 1 | ||
128 | fi | ||
129 | else | ||
130 | tail -n +$payload_offset "$0"| tar tvJ || exit 1 | ||
131 | fi | ||
132 | exit | ||
133 | fi | ||
134 | |||
135 | titlestr="@SDK_TITLE@ installer version @SDK_VERSION@" | ||
136 | printf "%s\n" "$titlestr" | ||
137 | printf "%${#titlestr}s\n" | tr " " "=" | ||
138 | |||
139 | if [ $verbose = 1 ] ; then | ||
140 | set -x | ||
141 | fi | ||
142 | |||
143 | @SDK_PRE_INSTALL_COMMAND@ | ||
144 | |||
145 | # SDK_EXTENSIBLE is exposed from the SDK_PRE_INSTALL_COMMAND above | ||
146 | if [ "$SDK_EXTENSIBLE" = "1" ]; then | ||
147 | DEFAULT_INSTALL_DIR="@SDKEXTPATH@" | ||
148 | if [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '4.9' ] || [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '' ] || \ | ||
149 | [ "$INST_GCC_VER" = '4.9' -a "$SDK_GCC_VER" = '' ]; then | ||
150 | echo "Error: Incompatible SDK installer! Your host gcc version is $INST_GCC_VER and this SDK was built by gcc higher version." | ||
151 | exit 1 | ||
152 | fi | ||
153 | fi | ||
154 | |||
155 | if [ "$target_sdk_dir" = "" ]; then | ||
156 | if [ "$answer" = "Y" ]; then | ||
157 | target_sdk_dir="$DEFAULT_INSTALL_DIR" | ||
158 | else | ||
159 | read -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir | ||
160 | [ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR | ||
161 | fi | ||
162 | fi | ||
163 | |||
164 | eval target_sdk_dir=$(echo "$target_sdk_dir"|sed 's/ /\\ /g') | ||
165 | if [ -d "$target_sdk_dir" ]; then | ||
166 | target_sdk_dir=$(cd "$target_sdk_dir"; pwd) | ||
167 | else | ||
168 | target_sdk_dir=$(readlink -m "$target_sdk_dir") | ||
169 | fi | ||
170 | |||
171 | # limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result. | ||
172 | if [ ${#target_sdk_dir} -gt 2048 ]; then | ||
173 | echo "Error: The target directory path is too long!!!" | ||
174 | exit 1 | ||
175 | fi | ||
176 | |||
177 | if [ "$SDK_EXTENSIBLE" = "1" ]; then | ||
178 | # We're going to be running the build system, additional restrictions apply | ||
179 | if echo "$target_sdk_dir" | grep -q '[+\ @$]'; then | ||
180 | echo "The target directory path ($target_sdk_dir) contains illegal" \ | ||
181 | "characters such as spaces, @, \$ or +. Abort!" | ||
182 | exit 1 | ||
183 | fi | ||
184 | # The build system doesn't work well with /tmp on NFS | ||
185 | fs_dev_path="$target_sdk_dir" | ||
186 | while [ ! -d "$fs_dev_path" ] ; do | ||
187 | fs_dev_path=`dirname $fs_dev_path` | ||
188 | done | ||
189 | fs_dev_type=`stat -f -c '%t' "$fs_dev_path"` | ||
190 | if [ "$fsdevtype" = "6969" ] ; then | ||
191 | echo "The target directory path $target_sdk_dir is on NFS, this is not possible. Abort!" | ||
192 | exit 1 | ||
193 | fi | ||
194 | else | ||
195 | if [ -n "$(echo $target_sdk_dir|grep ' ')" ]; then | ||
196 | echo "The target directory path ($target_sdk_dir) contains spaces. Abort!" | ||
197 | exit 1 | ||
198 | fi | ||
199 | fi | ||
200 | |||
201 | if [ -e "$target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@" ]; then | ||
202 | echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture." | ||
203 | printf "If you continue, existing files will be overwritten! Proceed [y/N]? " | ||
204 | |||
205 | default_answer="n" | ||
206 | else | ||
207 | printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed [Y/n]? " | ||
208 | |||
209 | default_answer="y" | ||
210 | fi | ||
211 | |||
212 | if [ "$answer" = "" ]; then | ||
213 | read answer | ||
214 | [ "$answer" = "" ] && answer="$default_answer" | ||
215 | else | ||
216 | echo $answer | ||
217 | fi | ||
218 | |||
219 | if [ "$answer" != "Y" -a "$answer" != "y" ]; then | ||
220 | echo "Installation aborted!" | ||
221 | exit 1 | ||
222 | fi | ||
223 | |||
224 | # Try to create the directory (this will not succeed if user doesn't have rights) | ||
225 | mkdir -p $target_sdk_dir >/dev/null 2>&1 | ||
226 | |||
227 | # if don't have the right to access dir, gain by sudo | ||
228 | if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then | ||
229 | if [ "$SDK_EXTENSIBLE" = "1" ]; then | ||
230 | echo "Unable to access \"$target_sdk_dir\", will not attempt to use" \ | ||
231 | "sudo as as extensible SDK cannot be used as root." | ||
232 | exit 1 | ||
233 | fi | ||
234 | |||
235 | SUDO_EXEC=$(which "sudo") | ||
236 | if [ -z $SUDO_EXEC ]; then | ||
237 | echo "No command 'sudo' found, please install sudo first. Abort!" | ||
238 | exit 1 | ||
239 | fi | ||
240 | |||
241 | # test sudo could gain root right | ||
242 | $SUDO_EXEC pwd >/dev/null 2>&1 | ||
243 | [ $? -ne 0 ] && echo "Sorry, you are not allowed to execute as root." && exit 1 | ||
244 | |||
245 | # now that we have sudo rights, create the directory | ||
246 | $SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1 | ||
247 | fi | ||
248 | |||
249 | printf "Extracting SDK..." | ||
250 | if [ @SDK_ARCHIVE_TYPE@ = "zip" ]; then | ||
251 | tail -n +$payload_offset "$0" > sdk.zip | ||
252 | if $SUDO_EXEC unzip $EXTRA_TAR_OPTIONS sdk.zip -d $target_sdk_dir;then | ||
253 | rm sdk.zip | ||
254 | else | ||
255 | rm sdk.zip && exit 1 | ||
256 | fi | ||
257 | else | ||
258 | tail -n +$payload_offset "$0"| $SUDO_EXEC tar mxJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1 | ||
259 | fi | ||
260 | echo "done" | ||
261 | |||
262 | printf "Setting it up..." | ||
263 | # fix environment paths | ||
264 | real_env_setup_script="" | ||
265 | for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do | ||
266 | if grep -q 'OECORE_NATIVE_SYSROOT=' $env_setup_script; then | ||
267 | # Handle custom env setup scripts that are only named | ||
268 | # environment-setup-* so that they have relocation | ||
269 | # applied - what we want beyond here is the main one | ||
270 | # rather than the one that simply sorts last | ||
271 | real_env_setup_script="$env_setup_script" | ||
272 | fi | ||
273 | $SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $env_setup_script | ||
274 | done | ||
275 | if [ -n "$real_env_setup_script" ] ; then | ||
276 | env_setup_script="$real_env_setup_script" | ||
277 | fi | ||
278 | |||
279 | @SDK_POST_INSTALL_COMMAND@ | ||
280 | |||
281 | # delete the relocating script, so that user is forced to re-run the installer | ||
282 | # if he/she wants another location for the sdk | ||
283 | if [ $savescripts = 0 ] ; then | ||
284 | $SUDO_EXEC rm -f ${env_setup_script%/*}/relocate_sdk.py ${env_setup_script%/*}/relocate_sdk.sh ${env_setup_script%/*}/relocate-wrapper.py | ||
285 | fi | ||
286 | |||
287 | # Execute post-relocation script | ||
288 | post_relocate="$target_sdk_dir/post-relocate-setup.sh" | ||
289 | if [ -e "$post_relocate" ]; then | ||
290 | $SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $post_relocate | ||
291 | $SUDO_EXEC /bin/sh $post_relocate "$target_sdk_dir" "@SDKPATH@" | ||
292 | $SUDO_EXEC rm -f $post_relocate | ||
293 | fi | ||
294 | |||
295 | echo "SDK has been successfully set up and is ready to be used." | ||
296 | echo "Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g." | ||
297 | for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do | ||
298 | echo " \$ . $env_setup_script" | ||
299 | done | ||
300 | |||
301 | exit 0 | ||
302 | |||
303 | MARKER: | ||
diff --git a/meta-vitis-tc/files/toolchain-shar-relocate.sh b/meta-vitis-tc/files/toolchain-shar-relocate.sh new file mode 100644 index 00000000..0c396e6d --- /dev/null +++ b/meta-vitis-tc/files/toolchain-shar-relocate.sh | |||
@@ -0,0 +1,117 @@ | |||
1 | if ! xargs --version > /dev/null 2>&1; then | ||
2 | echo "xargs is required by the relocation script, please install it first. Abort!" | ||
3 | exit 1 | ||
4 | fi | ||
5 | |||
6 | # fix dynamic loader paths in all ELF SDK binaries | ||
7 | native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"') | ||
8 | dl_path=$($SUDO_EXEC find $native_sysroot/lib -maxdepth 1 -name "ld-linux*") | ||
9 | if [ "$dl_path" = "" ] ; then | ||
10 | echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!" | ||
11 | exit 1 | ||
12 | fi | ||
13 | executable_files=$($SUDO_EXEC find $native_sysroot -type f \ | ||
14 | \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -printf "'%h/%f' ") | ||
15 | if [ "x$executable_files" = "x" ]; then | ||
16 | echo "SDK relocate failed, could not get executalbe files" | ||
17 | exit 1 | ||
18 | fi | ||
19 | |||
20 | tdir=`mktemp -d` | ||
21 | if [ x$tdir = x ] ; then | ||
22 | echo "SDK relocate failed, could not create a temporary directory" | ||
23 | exit 1 | ||
24 | fi | ||
25 | cat <<EOF >> $tdir/relocate_sdk.sh | ||
26 | #!/bin/sh | ||
27 | for py in python python2 python3 | ||
28 | do | ||
29 | PYTHON=\`which \${py} 2>/dev/null\` | ||
30 | if [ \$? -eq 0 ]; then | ||
31 | break; | ||
32 | fi | ||
33 | done | ||
34 | |||
35 | if [ x\${PYTHON} = "x" ]; then | ||
36 | echo "SDK could not be relocated. No python found." | ||
37 | exit 1 | ||
38 | fi | ||
39 | \${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files | ||
40 | EOF | ||
41 | |||
42 | $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh | ||
43 | $SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh | ||
44 | rm -rf $tdir | ||
45 | # Run for either relocate = 1 or = 2 | ||
46 | if [ $relocate = 1 -o $relocate = 2 ] ; then | ||
47 | $SUDO_EXEC ${env_setup_script%/*}/relocate_sdk.sh | ||
48 | if [ $? -ne 0 ]; then | ||
49 | echo "SDK could not be set up. Relocate script failed. Abort!" | ||
50 | exit 1 | ||
51 | fi | ||
52 | fi | ||
53 | if [ $relocate = 2 ] ; then | ||
54 | $SUDO_EXEC ${PYTHON} ${env_setup_script%/*}/relocate-wrapper.py $target_sdk_dir > relocate.log 2>&1 | ||
55 | if [ $? -ne 0 ]; then | ||
56 | cat relocate.log | ||
57 | echo "SDK could not be set up. Runtime-Relocate script failed. Abort!" | ||
58 | exit 1 | ||
59 | fi | ||
60 | rm -f relocate.log | ||
61 | |||
62 | for env_setup_scripts in `ls $target_sdk_dir/environment-setup-*`; do | ||
63 | cat << EOF > ${env_setup_scripts}.new | ||
64 | if [ -n "\$BASH_SOURCE" ]; then | ||
65 | THIS_SCRIPT=\$BASH_SOURCE | ||
66 | elif [ -n "\$ZSH_NAME" ]; then | ||
67 | THIS_SCRIPT=\$0 | ||
68 | else | ||
69 | THIS_SCRIPT="\$(pwd)/$env_setup_scripts" | ||
70 | if [ ! -e "\$THIS_SCRIPT" ]; then | ||
71 | echo "Error: \$THIS_SCRIPT doesn't exist!" >&2 | ||
72 | echo "Please run this script in sdk directory." >&2 | ||
73 | exit 1 | ||
74 | fi | ||
75 | fi | ||
76 | |||
77 | THIS_SCRIPT=\$(realpath \${THIS_SCRIPT}) | ||
78 | SDK_BASE_PATH=\$(dirname \${THIS_SCRIPT}) | ||
79 | echo "Configuring environment for base path of \$SDK_BASE_PATH" | ||
80 | |||
81 | EOF | ||
82 | cat ${env_setup_scripts} >> ${env_setup_scripts}.new | ||
83 | $SUDO_EXEC sed -e "s:$target_sdk_dir:\${SDK_BASE_PATH}:g" -i ${env_setup_scripts}.new | ||
84 | mv ${env_setup_scripts}.new ${env_setup_scripts} | ||
85 | done | ||
86 | fi | ||
87 | |||
88 | # replace @SDKPATH@ with the new prefix in all text files: configs/scripts/etc. | ||
89 | # replace the host perl with SDK perl. | ||
90 | for replace in "$target_sdk_dir -maxdepth 1" "$native_sysroot"; do | ||
91 | $SUDO_EXEC find $replace -type f | ||
92 | done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \ | ||
93 | awk -F': ' '{printf "\"%s\"\n", $1}' | \ | ||
94 | grep -Fv -e "$target_sdk_dir/environment-setup-" \ | ||
95 | -e "$target_sdk_dir/relocate_sdk" \ | ||
96 | -e "$target_sdk_dir/post-relocate-setup" \ | ||
97 | -e "$target_sdk_dir/${0##*/}" | \ | ||
98 | xargs -n100 $SUDO_EXEC sed -i \ | ||
99 | -e "s:$SDK_BUILD_PATH:$target_sdk_dir:g" \ | ||
100 | -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \ | ||
101 | -e "s: /usr/bin/perl: /usr/bin/env perl:g" | ||
102 | |||
103 | if [ $? -ne 0 ]; then | ||
104 | echo "Failed to replace perl. Relocate script failed. Abort!" | ||
105 | exit 1 | ||
106 | fi | ||
107 | |||
108 | # change all symlinks pointing to @SDKPATH@ | ||
109 | for l in $($SUDO_EXEC find $native_sysroot -type l); do | ||
110 | $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$SDK_BUILD_PATH:$target_sdk_dir:") $l | ||
111 | if [ $? -ne 0 ]; then | ||
112 | echo "Failed to setup symlinks. Relocate script failed. Abort!" | ||
113 | exit 1 | ||
114 | fi | ||
115 | done | ||
116 | |||
117 | echo done | ||
diff --git a/meta-vitis-tc/recipes-core/meta/meta-environment.bbappend b/meta-vitis-tc/recipes-core/meta/meta-environment.bbappend new file mode 100644 index 00000000..7c4e4c16 --- /dev/null +++ b/meta-vitis-tc/recipes-core/meta/meta-environment.bbappend | |||
@@ -0,0 +1,11 @@ | |||
1 | # If this is a baremetal build, we want to further optimize the toolchain | ||
2 | # scripts | ||
3 | BAREMETAL_ENV = "" | ||
4 | BAREMETAL_ENV:xilinx-standalone:baremetal-multilib-tc = "plnx-baremetal-toolchain-scripts" | ||
5 | |||
6 | inherit ${BAREMETAL_ENV} | ||
7 | |||
8 | ORIGINAL_TARGET_ARCH := "${TARGET_ARCH}" | ||
9 | ORIGINAL_TARGET_VENDOR := "${TARGET_VENDOR}" | ||
10 | ORIGINAL_TARGET_SYS := "${TARGET_SYS}" | ||
11 | ORIGINAL_TARGET_PREFIX := "${TARGET_PREFIX}" | ||
diff --git a/meta-vitis-tc/recipes-core/meta/meta-qemu-xilinx.bb b/meta-vitis-tc/recipes-core/meta/meta-qemu-xilinx.bb new file mode 100644 index 00000000..06c7ff86 --- /dev/null +++ b/meta-vitis-tc/recipes-core/meta/meta-qemu-xilinx.bb | |||
@@ -0,0 +1,75 @@ | |||
1 | SUMMARY = "Meta package for building a installable qemu SDK" | ||
2 | LICENSE = "MIT" | ||
3 | |||
4 | |||
5 | PLNX_ADD_VAI_SDK = "" | ||
6 | |||
7 | TOOLCHAIN_TARGET_TASK = "" | ||
8 | TOOLCHAIN_HOST_TASK = "nativesdk-sdk-provides-dummy meta-environment-${MACHINE} nativesdk-qemu-xilinx" | ||
9 | |||
10 | MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}" | ||
11 | PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}" | ||
12 | PACKAGE_ARCHS = "" | ||
13 | TARGET_ARCH = "none" | ||
14 | TARGET_OS = "none" | ||
15 | |||
16 | SDK_PACKAGE_ARCHS += "buildtools-dummy-${SDKPKGSUFFIX}" | ||
17 | |||
18 | TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-qemu-xilinx-nativesdk-standalone-${DISTRO_VERSION}" | ||
19 | |||
20 | SDK_TITLE = "QEMU Xilinx" | ||
21 | |||
22 | RDEPENDS = "${TOOLCHAIN_HOST_TASK}" | ||
23 | |||
24 | EXCLUDE_FROM_WORLD = "1" | ||
25 | |||
26 | inherit populate_sdk | ||
27 | inherit toolchain-scripts-base | ||
28 | inherit nopackages | ||
29 | |||
30 | deltask install | ||
31 | deltask populate_sysroot | ||
32 | |||
33 | do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}" | ||
34 | |||
35 | REAL_MULTIMACH_TARGET_SYS = "none" | ||
36 | |||
37 | create_sdk_files:append () { | ||
38 | rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-* | ||
39 | rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-* | ||
40 | rm -f ${SDK_OUTPUT}/${SDKPATH}/version-* | ||
41 | |||
42 | # Generate new (mini) sdk-environment-setup file | ||
43 | script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}} | ||
44 | touch $script | ||
45 | echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script | ||
46 | echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script | ||
47 | echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script | ||
48 | echo 'export SSL_CERT_FILE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script | ||
49 | |||
50 | toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS} | ||
51 | |||
52 | cat >> $script <<EOF | ||
53 | if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then | ||
54 | for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do | ||
55 | . \$envfile | ||
56 | done | ||
57 | fi | ||
58 | # We have to unset this else it can confuse oe-selftest and other tools | ||
59 | # which may also use the overlapping namespace. | ||
60 | unset OECORE_NATIVE_SYSROOT | ||
61 | EOF | ||
62 | |||
63 | if [ "${SDKMACHINE}" = "i686" ]; then | ||
64 | echo 'export NO32LIBS="0"' >>$script | ||
65 | echo 'echo "$BB_ENV_PASSTHROUGH_ADDITIONS" | grep -q "NO32LIBS"' >>$script | ||
66 | echo '[ $? != 0 ] && export BB_ENV_PASSTHROUGH_ADDITIONS="NO32LIBS $BB_ENV_PASSTHROUGH_ADDITIONS"' >>$script | ||
67 | fi | ||
68 | } | ||
69 | |||
70 | # buildtools-tarball doesn't need config site | ||
71 | TOOLCHAIN_NEED_CONFIGSITE_CACHE = "" | ||
72 | |||
73 | # The recipe doesn't need any default deps | ||
74 | INHIBIT_DEFAULT_DEPS = "1" | ||
75 | |||
diff --git a/meta-vitis-tc/recipes-core/meta/meta-xilinx-toolchain.bb b/meta-vitis-tc/recipes-core/meta/meta-xilinx-toolchain.bb new file mode 100644 index 00000000..a276dee7 --- /dev/null +++ b/meta-vitis-tc/recipes-core/meta/meta-xilinx-toolchain.bb | |||
@@ -0,0 +1,38 @@ | |||
1 | SUMMARY = "Meta package for building a Xilinx prebuilt installable toolchain" | ||
2 | LICENSE = "MIT" | ||
3 | |||
4 | FILESEXTRAPATHS:append = ":${VITIS_TC_PATH}/scripts" | ||
5 | |||
6 | SRC_URI += " \ | ||
7 | file://relocate-wrapper.py \ | ||
8 | " | ||
9 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
10 | |||
11 | inherit populate_sdk | ||
12 | |||
13 | COMPATIBLE_HOST = "${HOST_SYS}" | ||
14 | |||
15 | # This is a bare minimum toolchain, so limit to only the basic host | ||
16 | # dependencies | ||
17 | HOST_DEPENDS = " \ | ||
18 | nativesdk-sdk-provides-dummy \ | ||
19 | " | ||
20 | |||
21 | PLNX_ADD_VAI_SDK = "" | ||
22 | |||
23 | TOOLCHAIN_HOST_TASK = "${HOST_DEPENDS} packagegroup-cross-canadian-${MACHINE}" | ||
24 | TOOLCHAIN_TARGET_TASK:xilinx-standalone:baremetal-multilib-tc = "${@multilib_pkg_extend(d, 'packagegroup-newlib-standalone-sdk-target')}" | ||
25 | |||
26 | TOOLCHAIN_SHAR_EXT_TMPL = "${VITIS_TC_PATH}/files/toolchain-shar-extract.sh" | ||
27 | TOOLCHAIN_SHAR_REL_TMPL = "${VITIS_TC_PATH}/files/toolchain-shar-relocate.sh" | ||
28 | |||
29 | create_sdk_files:append () { | ||
30 | cp ${WORKDIR}/relocate-wrapper.py ${SDK_OUTPUT}/${SDKPATH}/ | ||
31 | } | ||
32 | |||
33 | # The wrappers don't do anything, remove them! | ||
34 | create_sdk_files:append:sdkmingw32 () { | ||
35 | rm -f ${SDK_OUTPUT}/${SDKPATH}/relocate-wrapper.py | ||
36 | rm -f ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py | ||
37 | rm -f ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh | ||
38 | } | ||
diff --git a/meta-vitis-tc/recipes-core/newlib/libgloss_4.%.bbappend b/meta-vitis-tc/recipes-core/newlib/libgloss_4.%.bbappend new file mode 100644 index 00000000..e60d06a6 --- /dev/null +++ b/meta-vitis-tc/recipes-core/newlib/libgloss_4.%.bbappend | |||
@@ -0,0 +1,13 @@ | |||
1 | # When building multiple, we need to depend on the multilib newlib | ||
2 | DEPENDS:append:xilinx-standalone:baremetal-multilib-tc = " ${MLPREFIX}newlib" | ||
3 | |||
4 | # RISC-V mulitlib compiler expects the newlib to be in the 'libdir', but places it in ${D}/usr/lib | ||
5 | do_install:append:xilinx-standalone:baremetal-multilib-tc () { | ||
6 | if [ "/usr/lib" != "${libdir}" ]; then | ||
7 | for each in ${D}/usr/lib/* ; do | ||
8 | if [ -f ${each} ]; then | ||
9 | mv -v ${each} ${D}/${libdir} | ||
10 | fi | ||
11 | done | ||
12 | fi | ||
13 | } | ||
diff --git a/meta-vitis-tc/recipes-core/newlib/newlib_4.%.bbappend b/meta-vitis-tc/recipes-core/newlib/newlib_4.%.bbappend new file mode 100644 index 00000000..455193e6 --- /dev/null +++ b/meta-vitis-tc/recipes-core/newlib/newlib_4.%.bbappend | |||
@@ -0,0 +1,6 @@ | |||
1 | # Fix for multilib newlib installations | ||
2 | do_install:prepend:xilinx-standalone:baremetal-multilib-tc () { | ||
3 | mkdir -p $(dirname ${D}${libdir}) | ||
4 | mkdir -p $(dirname ${D}${includedir}) | ||
5 | } | ||
6 | |||
diff --git a/meta-vitis-tc/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend b/meta-vitis-tc/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend new file mode 100644 index 00000000..78df7ae1 --- /dev/null +++ b/meta-vitis-tc/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend | |||
@@ -0,0 +1,9 @@ | |||
1 | # Avoid installing all of the alternative toolchains | ||
2 | # due to multilib enabled in the primary toolchain. | ||
3 | |||
4 | RDEPENDS:${PN}:xilinx-standalone:baremetal-multilib-tc = " \ | ||
5 | ${BINUTILS} \ | ||
6 | ${GCC} \ | ||
7 | ${GDB} \ | ||
8 | meta-environment-${MACHINE} \ | ||
9 | " | ||
diff --git a/meta-vitis-tc/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb b/meta-vitis-tc/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb new file mode 100644 index 00000000..5534e1d9 --- /dev/null +++ b/meta-vitis-tc/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb | |||
@@ -0,0 +1,13 @@ | |||
1 | COMPATIBLE_HOST = "${HOST_SYS}" | ||
2 | |||
3 | SUMMARY = "Target packages for the standalone SDK" | ||
4 | |||
5 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | ||
6 | |||
7 | inherit packagegroup | ||
8 | |||
9 | RDEPENDS:${PN} = "\ | ||
10 | libgcc-dev \ | ||
11 | libstdc++-dev \ | ||
12 | ${LIBC_DEPENDENCIES} \ | ||
13 | " | ||
diff --git a/meta-vitis-tc/recipes-devtools/binutils/binutils-cross-canadian%.bbappend b/meta-vitis-tc/recipes-devtools/binutils/binutils-cross-canadian%.bbappend new file mode 100644 index 00000000..a4716d7a --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/binutils/binutils-cross-canadian%.bbappend | |||
@@ -0,0 +1,12 @@ | |||
1 | # When building for petalinux, we want to enable multilib support | ||
2 | EXTRA_OECONF:append:xilinx-standalone:baremetal-multilib-tc = " \ | ||
3 | --enable-multilib \ | ||
4 | " | ||
5 | |||
6 | # PetaLinux adds SIZE to the environment | ||
7 | do_install:append () { | ||
8 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d | ||
9 | echo "export SIZE=\"${TARGET_PREFIX}size\"" > ${D}${SDKPATHNATIVE}/environment-setup.d/binutils.sh | ||
10 | } | ||
11 | |||
12 | FILES:${PN} += "${SDKPATHNATIVE}/environment-setup.d/binutils.sh" | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-12/additional-microblaze-multilibs.patch b/meta-vitis-tc/recipes-devtools/gcc/gcc-12/additional-microblaze-multilibs.patch new file mode 100644 index 00000000..5907f1ca --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-12/additional-microblaze-multilibs.patch | |||
@@ -0,0 +1,86 @@ | |||
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 | Index: gcc-12.2.0/gcc/config/microblaze/t-microblaze | ||
60 | =================================================================== | ||
61 | --- gcc-12.2.0.orig/gcc/config/microblaze/t-microblaze | ||
62 | +++ gcc-12.2.0/gcc/config/microblaze/t-microblaze | ||
63 | @@ -1,17 +1,11 @@ | ||
64 | -MULTILIB_OPTIONS = m64 mxl-barrel-shift mlittle-endian mno-xl-soft-mul mxl-multiply-high | ||
65 | -#MULTILIB_DIRNAMES = m64 bs le m mh | ||
66 | -MULTILIB_DIRNAMES = . . . . . | ||
67 | -MULTILIB_EXCEPTIONS = *m64/mxl-multiply-high mxl-multiply-high | ||
68 | -MULTILIB_EXCEPTIONS += *m64 | ||
69 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift | ||
70 | -MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul | ||
71 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul | ||
72 | -MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul | ||
73 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul/mxl-multiply-high | ||
74 | -MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul/mxl-multiply-high | ||
75 | +MULTILIB_OPTIONS = mlittle-endian m64 mxl-barrel-shift mxl-pattern-compare mno-xl-soft-mul mhard-float | ||
76 | +MULTILIB_DIRNAMES = le m64 bs p m fpd | ||
77 | +MULTILIB_EXCEPTIONS = mxl-multiply-high | ||
78 | MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high | ||
79 | MULTILIB_EXCEPTIONS += *mlittle-endian/mxl-multiply-high mxl-multiply-high | ||
80 | -MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mlittle-endian/mxl-multiply-high | ||
81 | +MULTILIB_EXCEPTIONS += *mxl-pattern-compare*/*mxl-multiply-high* | ||
82 | +# Big endian m64 is not supported | ||
83 | +MULTILIB_EXCEPTIONS += m64* | ||
84 | |||
85 | # Extra files | ||
86 | microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.cc \ | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-12/riscv-multilib-generator-python.patch b/meta-vitis-tc/recipes-devtools/gcc/gcc-12/riscv-multilib-generator-python.patch new file mode 100644 index 00000000..6d720411 --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-12/riscv-multilib-generator-python.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | Use python3 instead of python when calling the mutlib-generator | ||
2 | |||
3 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
4 | |||
5 | --- gcc-12.2.0/gcc/config/riscv/multilib-generator.orig 2024-02-22 19:23:07.166805418 -0700 | ||
6 | +++ gcc-12.2.0/gcc/config/riscv/multilib-generator 2024-02-22 19:18:12.803798625 -0700 | ||
7 | @@ -1,4 +1,4 @@ | ||
8 | -#!/usr/bin/env python | ||
9 | +#!/usr/bin/env python3 | ||
10 | |||
11 | # RISC-V multilib list generator. | ||
12 | # Copyright (C) 2011-2022 Free Software Foundation, Inc. | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-cross-canadian_%.bbappend b/meta-vitis-tc/recipes-devtools/gcc/gcc-cross-canadian_%.bbappend new file mode 100644 index 00000000..4ee8fde2 --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-cross-canadian_%.bbappend | |||
@@ -0,0 +1,8 @@ | |||
1 | require gcc-xilinx-standalone-multilib.inc | ||
2 | |||
3 | # We want to use the stock multilib configs, when available | ||
4 | EXTRACONFFUNCS:xilinx-standalone:baremetal-multilib-tc = "" | ||
5 | |||
6 | EXTRA_OECONF:append:xilinx-standalone:baremetal-multilib-tc = " \ | ||
7 | --enable-multilib \ | ||
8 | " | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-cross_%.bbappend b/meta-vitis-tc/recipes-devtools/gcc/gcc-cross_%.bbappend new file mode 100644 index 00000000..e27a2228 --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-cross_%.bbappend | |||
@@ -0,0 +1,4 @@ | |||
1 | require gcc-xilinx-standalone-multilib.inc | ||
2 | |||
3 | # We want to use the stock multilib configs, when available | ||
4 | EXTRACONFFUNCS:xilinx-standalone:baremetal-multilib-tc = "" | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-runtime_%.bbappend b/meta-vitis-tc/recipes-devtools/gcc/gcc-runtime_%.bbappend new file mode 100644 index 00000000..fd2ebbca --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-runtime_%.bbappend | |||
@@ -0,0 +1,35 @@ | |||
1 | # Both arm and armv7r/armv8r overrides are set w/ cortex r5 | ||
2 | # So only set rmprofile if armv*r is defined. | ||
3 | ARM_PROFILE = "aprofile" | ||
4 | ARM_PROFILE:armv7r = "rmprofile" | ||
5 | ARM_PROFILE:armv8r = "rmprofile" | ||
6 | |||
7 | EXTRA_OECONF:append:xilinx-standalone:arm:class-target:baremetal-multilib-tc = " \ | ||
8 | --with-multilib-list=${ARM_PROFILE} \ | ||
9 | " | ||
10 | |||
11 | do_install:append:xilinx-standalone:class-target:baremetal-multilib-tc () { | ||
12 | # The multilibs have different headers, so stop combining them! | ||
13 | if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then | ||
14 | rm -rf ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS} | ||
15 | fi | ||
16 | |||
17 | # link the C++ header into the place that multilib gcc expects | ||
18 | # C++ compiler looks at usr/include/c++/version/canonical-arch/mlib | ||
19 | if [ "${TARGET_SYS_MULTILIB_ORIGINAL}" != "" -a "${TARGET_SYS_MULTILIB_ORIGINAL}" != "${TARGET_SYS}" ]; then | ||
20 | mlib=${BASE_LIB:tune-${DEFAULTTUNE}} | ||
21 | mlib=${mlib##lib/} | ||
22 | |||
23 | link_name=${D}${includedir}/c++/${BINV}/${TARGET_SYS_MULTILIB_ORIGINAL}/${mlib} | ||
24 | target=${D}${includedir}/c++/${BINV}/${TARGET_SYS} | ||
25 | |||
26 | echo mkdir -p $link_name | ||
27 | mkdir -p $link_name | ||
28 | for each in bits ext ; do | ||
29 | relpath=$(python3 -c "import os.path; print(os.path.relpath('$target/$each', '$(dirname $link_name/$each)'))") | ||
30 | |||
31 | echo ln -s $relpath $link_name/$each | ||
32 | ln -s $relpath $link_name/$each | ||
33 | done | ||
34 | fi | ||
35 | } | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-source_12.%.bbappend b/meta-vitis-tc/recipes-devtools/gcc/gcc-source_12.%.bbappend new file mode 100644 index 00000000..a439407d --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-source_12.%.bbappend | |||
@@ -0,0 +1,6 @@ | |||
1 | # Add MicroBlaze Patches (only when using MicroBlaze) | ||
2 | FILESEXTRAPATHS:append := ":${THISDIR}/gcc-12" | ||
3 | SRC_URI += " \ | ||
4 | file://additional-microblaze-multilibs.patch \ | ||
5 | file://riscv-multilib-generator-python.patch \ | ||
6 | " | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/gcc-xilinx-standalone-multilib.inc b/meta-vitis-tc/recipes-devtools/gcc/gcc-xilinx-standalone-multilib.inc new file mode 100644 index 00000000..f69ac4d8 --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/gcc-xilinx-standalone-multilib.inc | |||
@@ -0,0 +1,24 @@ | |||
1 | # Both arm and armv*r overrides are set w/ cortex r5 | ||
2 | # So only set rmprofile if armv*r is defined. | ||
3 | ARM_PROFILE = "aprofile" | ||
4 | ARM_PROFILE:armv7r = "rmprofile" | ||
5 | ARM_PROFILE:armv8r = "rmprofile" | ||
6 | EXTRA_OECONF:append:xilinx-standalone:arm:baremetal-multilib-tc = " \ | ||
7 | --with-multilib-list=${ARM_PROFILE} \ | ||
8 | " | ||
9 | |||
10 | # RISC V configuration | ||
11 | RISCV_MULTILIB = "\ | ||
12 | rv32i-ilp32--;rv32if-ilp32f--;rv32ic-ilp32--;rv32ifc-ilp32f--;\ | ||
13 | rv32im-ilp32--;rv32imf-ilp32f--;rv32imc-ilp32--;rv32imfc-ilp32f--;\ | ||
14 | rv64i-lp64--;rv64if-lp64f--;rv64ic-lp64--;rv64ifc-lp64f--;\ | ||
15 | rv64im-lp64--;rv64imf-lp64f--;rv64imc-lp64--;rv64imfc-lp64f--;\ | ||
16 | rv32imfdc-ilp32d--;rv64imfdc-lp64d--\ | ||
17 | " | ||
18 | |||
19 | EXTRA_OECONF:append:xilinx-standalone:riscv32:baremetal-multilib-tc = " \ | ||
20 | --with-multilib-generator='${RISCV_MULTILIB}' \ | ||
21 | " | ||
22 | EXTRA_OECONF:append:xilinx-standalone:riscv64:baremetal-multilib-tc = " \ | ||
23 | --with-multilib-generator='${RISCV_MULTILIB}' \ | ||
24 | " | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/mb-convert-head.sh b/meta-vitis-tc/recipes-devtools/gcc/mb-convert-head.sh new file mode 100755 index 00000000..b59dff1e --- /dev/null +++ b/meta-vitis-tc/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-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 | ||
diff --git a/meta-vitis-tc/recipes-devtools/gcc/riscv-convert.sh b/meta-vitis-tc/recipes-devtools/gcc/riscv-convert.sh new file mode 100755 index 00000000..bc8af794 --- /dev/null +++ b/meta-vitis-tc/recipes-devtools/gcc/riscv-convert.sh | |||
@@ -0,0 +1,56 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | # Call using: | ||
4 | #../riscv/sysroots/x86_64-oesdk-linux/usr/bin/riscv-xilinx-elf/riscv-xilinx-elf-gcc -print-multi-lib | riscv-convert.sh | ||
5 | |||
6 | # Then copy the output into the special riscv-tc BSP | ||
7 | |||
8 | tempfile=`mktemp` | ||
9 | |||
10 | echo "MULTILIBS = \"\"" | ||
11 | |||
12 | sed -e 's,;, ,' | | ||
13 | while read mlib args ; do | ||
14 | if [ $mlib = '.' ]; then | ||
15 | echo '# Base configuration' >> $tempfile | ||
16 | echo '# CFLAGS:' >> $tempfile | ||
17 | echo 'DEFAULTTUNE = "riscv"' >> $tempfile | ||
18 | echo >> $tempfile | ||
19 | echo 'AVAILTUNES += "riscv"' >> $tempfile | ||
20 | echo 'PACKAGE_EXTRA_ARCHS:tune-riscv = "${TUNE_PKGARCH:tune-riscv}"' >> $tempfile | ||
21 | echo 'BASE_LIB:tune-riscv = "lib"' >> $tempfile | ||
22 | echo 'TUNE_FEATURES:tune-riscv = "riscv"' >> $tempfile | ||
23 | echo 'TUNE_CCARGS:tune-riscv = ""' >> $tempfile | ||
24 | echo 'TUNE_PKGARCH:tune-riscv = "riscv32"' >> $tempfile | ||
25 | echo 'TUNE_ARCH:tune-riscv = "riscv32"' >> $tempfile | ||
26 | continue | ||
27 | fi | ||
28 | |||
29 | cflags=$(echo $args | sed -e 's,@, -,g') | ||
30 | multilib="lib$(echo $mlib | sed -e 's,/,,g')" | ||
31 | tune="$(echo $mlib | sed -e 's,/,,g')" | ||
32 | case $mlib in | ||
33 | .) arch="riscv32" ;; | ||
34 | rv32*) arch="riscv32" ;; | ||
35 | rv64*) arch="riscv64" ;; | ||
36 | *) arch="unknwon" ;; | ||
37 | esac | ||
38 | echo "MULTILIBS += \"multilib:${multilib}\"" | ||
39 | echo >> $tempfile | ||
40 | echo >> $tempfile | ||
41 | echo "# $mlib" >> $tempfile | ||
42 | echo "# CFLAGS:${cflags}" >> $tempfile | ||
43 | echo "DEFAULTTUNE:virtclass-multilib-$multilib = \"$tune\"" >> $tempfile | ||
44 | echo >> $tempfile | ||
45 | echo "AVAILTUNES += \"$tune\"" >> $tempfile | ||
46 | echo "PACKAGE_EXTRA_ARCHS:tune-$tune = \"\${TUNE_PKGARCH:tune-$tune}\"" >> $tempfile | ||
47 | echo "BASE_LIB:tune-$tune = \"lib/$mlib\"" >> $tempfile | ||
48 | echo "TUNE_FEATURES:tune-$tune = \"riscv\"" >> $tempfile | ||
49 | echo "TUNE_CCARGS:tune-$tune = \"$cflags\"" >> $tempfile | ||
50 | echo "TUNE_PKGARCH:tune-$tune = \"$tune\"" >> $tempfile | ||
51 | echo "TUNE_ARCH:tune-$tune = \"$arch\"" >> $tempfile | ||
52 | done | ||
53 | |||
54 | echo | ||
55 | cat $tempfile | ||
56 | rm $tempfile | ||
diff --git a/meta-vitis-tc/scripts/relocate-wrapper.py b/meta-vitis-tc/scripts/relocate-wrapper.py new file mode 100755 index 00000000..6523241b --- /dev/null +++ b/meta-vitis-tc/scripts/relocate-wrapper.py | |||
@@ -0,0 +1,247 @@ | |||
1 | #!/usr/bin/env python3 | ||
2 | # | ||
3 | # Copyright (c) 2012 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0-only | ||
6 | # | ||
7 | # AUTHORS | ||
8 | # Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
9 | # | ||
10 | |||
11 | # Copyright (C) 2019-2020, Xilinx, Inc. All rights reserved. | ||
12 | # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. | ||
13 | # | ||
14 | # DESCRIPTION | ||
15 | # Runtime-relocation wrapper scripting based on YP relocation scripting | ||
16 | # | ||
17 | # AUTHORS | ||
18 | # Mark Hatle <mark.hatle@amd.com> | ||
19 | |||
20 | import struct | ||
21 | import sys | ||
22 | import stat | ||
23 | import os | ||
24 | import re | ||
25 | import errno | ||
26 | |||
27 | if sys.version < '3': | ||
28 | def b(x): | ||
29 | return x | ||
30 | else: | ||
31 | def b(x): | ||
32 | return x.encode(sys.getfilesystemencoding()) | ||
33 | |||
34 | old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##")) | ||
35 | |||
36 | def get_arch(): | ||
37 | global endian_prefix | ||
38 | f.seek(0) | ||
39 | e_ident =f.read(16) | ||
40 | ei_mag0,ei_mag1_3,ei_class,ei_data,ei_version = struct.unpack("<B3sBBB9x", e_ident) | ||
41 | |||
42 | # ei_data = 1 for little-endian & 0 for big-endian | ||
43 | if ei_data == 1: | ||
44 | endian_prefix = '<' | ||
45 | else: | ||
46 | endian_prefix = '>' | ||
47 | |||
48 | if (ei_mag0 != 0x7f and ei_mag1_3 != "ELF") or ei_class == 0: | ||
49 | return 0 | ||
50 | |||
51 | if ei_class == 1: | ||
52 | return 32 | ||
53 | elif ei_class == 2: | ||
54 | return 64 | ||
55 | |||
56 | def parse_elf_header(f): | ||
57 | global e_type, e_machine, e_version, e_entry, e_phoff, e_shoff, e_flags,\ | ||
58 | e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum, e_shstrndx | ||
59 | |||
60 | f.seek(0) | ||
61 | elf_header = f.read(64) | ||
62 | |||
63 | if arch == 32: | ||
64 | # 32bit | ||
65 | hdr_fmt = endian_prefix + "HHILLLIHHHHHH" | ||
66 | hdr_size = 52 | ||
67 | else: | ||
68 | # 64bit | ||
69 | hdr_fmt = endian_prefix + "HHIQQQIHHHHHH" | ||
70 | hdr_size = 64 | ||
71 | |||
72 | e_type, e_machine, e_version, e_entry, e_phoff, e_shoff, e_flags,\ | ||
73 | e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum, e_shstrndx =\ | ||
74 | struct.unpack(hdr_fmt, elf_header[16:hdr_size]) | ||
75 | |||
76 | def is_elf_executable(f): | ||
77 | global interp | ||
78 | |||
79 | rc = False | ||
80 | |||
81 | if arch == 32: | ||
82 | ph_fmt = endian_prefix + "IIIIIIII" | ||
83 | else: | ||
84 | ph_fmt = endian_prefix + "IIQQQQQQ" | ||
85 | |||
86 | """ look for PT_INTERP section """ | ||
87 | for i in range(0,e_phnum): | ||
88 | f.seek(e_phoff + i * e_phentsize) | ||
89 | ph_hdr = f.read(e_phentsize) | ||
90 | if arch == 32: | ||
91 | # 32bit | ||
92 | p_type, p_offset, p_vaddr, p_paddr, p_filesz,\ | ||
93 | p_memsz, p_flags, p_align = struct.unpack(ph_fmt, ph_hdr) | ||
94 | else: | ||
95 | # 64bit | ||
96 | p_type, p_flags, p_offset, p_vaddr, p_paddr, \ | ||
97 | p_filesz, p_memsz, p_align = struct.unpack(ph_fmt, ph_hdr) | ||
98 | |||
99 | """ change interpreter """ | ||
100 | if p_type == 3: | ||
101 | # PT_INTERP section | ||
102 | f.seek(p_offset) | ||
103 | # External SDKs with mixed pre-compiled binaries should not get | ||
104 | # relocated so look for some variant of /lib | ||
105 | fname = f.read(11) | ||
106 | if fname.startswith(b("/lib/")) or fname.startswith(b("/lib64/")) or \ | ||
107 | fname.startswith(b("/lib32/")) or fname.startswith(b("/usr/lib32/")) or \ | ||
108 | fname.startswith(b("/usr/lib32/")) or fname.startswith(b("/usr/lib64/")): | ||
109 | break | ||
110 | if p_filesz == 0: | ||
111 | break | ||
112 | rc = True | ||
113 | # Store the interpretor name to global interp | ||
114 | f.seek(p_offset) | ||
115 | chars = [] | ||
116 | while True: | ||
117 | c = f.read(1) | ||
118 | if c == b'\x00': | ||
119 | interp = (b''.join(chars)).decode('utf-8') | ||
120 | break | ||
121 | chars.append(c) | ||
122 | break | ||
123 | |||
124 | return rc | ||
125 | |||
126 | # MAIN | ||
127 | if len(sys.argv) < 2: | ||
128 | print('%s: <path>' % sys.argv[0]) | ||
129 | sys.exit(-1) | ||
130 | |||
131 | # In python > 3, strings may also contain Unicode characters. So, convert | ||
132 | # them to bytes | ||
133 | if sys.version_info < (3,): | ||
134 | process_path = sys.argv[1] | ||
135 | else: | ||
136 | process_path = sys.argv[1] | ||
137 | |||
138 | process_path = os.path.realpath(process_path) | ||
139 | |||
140 | for root, _, files in os.walk(process_path): | ||
141 | for file in files: | ||
142 | if file.endswith('.real'): | ||
143 | continue | ||
144 | |||
145 | e = os.path.join(root, file) | ||
146 | |||
147 | if not os.path.isfile(e) or not os.access(e, os.X_OK) or os.path.islink(e): | ||
148 | continue | ||
149 | |||
150 | if os.path.dirname(e).endswith('/lib') and (os.path.basename(e).startswith('libc-') or os.path.basename(e).startswith('libc.so')): | ||
151 | # Special case, don't wrap this... | ||
152 | continue | ||
153 | |||
154 | if os.path.dirname(e).endswith('/lib') and os.path.basename(e).startswith('libpthread-'): | ||
155 | # Special case, don't wrap this... | ||
156 | continue | ||
157 | |||
158 | perms = os.stat(e)[stat.ST_MODE] | ||
159 | if os.access(e, os.R_OK): | ||
160 | perms = None | ||
161 | else: | ||
162 | os.chmod(e, perms|stat.S_IRWXU) | ||
163 | |||
164 | try: | ||
165 | f = open(e, "r+b") | ||
166 | except IOError: | ||
167 | exctype, ioex = sys.exc_info()[:2] | ||
168 | if ioex.errno == errno.ETXTBSY: | ||
169 | print("Could not open %s. File used by another process.\nPlease "\ | ||
170 | "make sure you exit all processes that might use any SDK "\ | ||
171 | "binaries." % e) | ||
172 | else: | ||
173 | print("Could not open %s: %s(%d)" % (e, ioex.strerror, ioex.errno)) | ||
174 | sys.exit(-1) | ||
175 | |||
176 | # Save old size and do a size check at the end. Just a safety measure. | ||
177 | old_size = os.path.getsize(e) | ||
178 | if old_size >= 64: | ||
179 | arch = get_arch() | ||
180 | if arch: | ||
181 | parse_elf_header(f) | ||
182 | |||
183 | if is_elf_executable(f): | ||
184 | dirpath = os.path.dirname(e) | ||
185 | destfile = os.path.join(dirpath, file + '.real') | ||
186 | |||
187 | wrapper = os.path.join(dirpath, 'execwrapper.sh') | ||
188 | |||
189 | if not os.path.exists(wrapper): | ||
190 | #print('write %s' % wrapper) | ||
191 | with open(wrapper, "w+") as wrapperf: | ||
192 | ldso = os.path.basename(interp) | ||
193 | libbasepath = os.path.dirname(interp) # should be /lib | ||
194 | libdirname = os.path.basename(libbasepath) # lib or lib32 or lib64 or .... | ||
195 | basepath = os.path.dirname(libbasepath) # should be / | ||
196 | |||
197 | libpath = os.path.join(basepath, 'usr', libdirname) | ||
198 | |||
199 | # Generate relative names to the path of the execwrapper | ||
200 | libbasepath = os.path.relpath(libbasepath, dirpath) | ||
201 | libpath = os.path.relpath(libpath, dirpath) | ||
202 | |||
203 | print('') | ||
204 | print('wrapper: %s' % wrapper) | ||
205 | print('ldso = %s' % ldso) | ||
206 | print('lib = %s' % libdirname) | ||
207 | print('libpath = %s' % libbasepath) | ||
208 | print('usrlibpath = %s' % libpath) | ||
209 | print('') | ||
210 | |||
211 | wrapperf.write('#!/bin/bash\n') | ||
212 | wrapperf.write('# Written by Mark Hatle <mhatle@xilinx.com>\n') | ||
213 | wrapperf.write('# Copyright (C) 2019-2020, Xilinx, Inc. All rights reserved\n') | ||
214 | wrapperf.write('# Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved\n') | ||
215 | wrapperf.write('#\n') | ||
216 | wrapperf.write('# SPDX-License-Identifier: GPL-2.0-only\n') | ||
217 | wrapperf.write('LDSO=%s\n' % ldso) | ||
218 | wrapperf.write('LIBBASEPATH=%s\n' % libbasepath) | ||
219 | wrapperf.write('LIBPATH=%s\n' % libpath) | ||
220 | wrapperf.write('executable=$(basename $0)\n') | ||
221 | wrapperf.write('wrapper=$0\n') | ||
222 | wrapperf.write('BASEPATH=$(dirname ${wrapper})\n') | ||
223 | wrapperf.write('if [ ! -x $0 ]; then\n') | ||
224 | wrapperf.write(' wrapper=$(which $0)\n') | ||
225 | wrapperf.write('fi\n') | ||
226 | wrapperf.write('if [ -h $0 ]; then\n') | ||
227 | wrapperf.write(' executable=$(basename "$(readlink $0)" )\n') | ||
228 | wrapperf.write(' BASEPATH=$(dirname "$(realpath $0)")\n') | ||
229 | wrapperf.write('fi\n') | ||
230 | wrapperf.write('LIBBASEPATH=$(realpath ${BASEPATH}/${LIBBASEPATH})\n') | ||
231 | wrapperf.write('LIBPATH=$(realpath ${BASEPATH}/${LIBPATH})\n') | ||
232 | wrapperf.write('export COLLECT_GCC=${COLLECT_GCC%%.real}\n') | ||
233 | wrapperf.write('exec ${LIBBASEPATH}/${LDSO} --library-path ${LIBPATH}:${LIBBASEPATH} ${BASEPATH}/${executable}.real $@\n') | ||
234 | #print('chmod %s 0775' % wrapper) | ||
235 | os.chmod(wrapper, 0o775) | ||
236 | |||
237 | print('%s -> %s' % (e, destfile)) | ||
238 | #print('mv %s %s' % (e, destfile)) | ||
239 | os.rename(e, destfile) | ||
240 | #print('ln %s %s' % (wrapper, e)) | ||
241 | os.link(wrapper, e) | ||
242 | |||
243 | """ change permissions back """ | ||
244 | if perms: | ||
245 | os.chmod(e, perms) | ||
246 | |||
247 | f.close() | ||