From 558d67ec0df4bcdf495376629639ebaffd8b1fe6 Mon Sep 17 00:00:00 2001 From: jferreir Date: Wed, 9 Oct 2024 12:12:46 +0200 Subject: [PATCH] initial support to build tricore gcc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for Tricore architecture. TriCore architecture is optimized for real-time embedded systems. More information can be found at AURIX™ TC3xx Architecture vol 1 https://www.infineon.com/dgdl/Infineon-AURIX_TC3xx_Architecture_vol1-UserManual-v01_00-EN.pdf?fileId=5546d46276fb756a01771bc4c2e33bdd Signed-off-by: jferreir --- config/arch/tricore.in | 10 ++++++++ samples/tricore-none-eabi/crosstool.config | 29 ++++++++++++++++++++++ samples/tricore-none-eabi/reported.by | 3 +++ scripts/build/arch/tricore.sh | 9 +++++++ scripts/config.sub | 1 + 5 files changed, 52 insertions(+) create mode 100644 config/arch/tricore.in create mode 100644 samples/tricore-none-eabi/crosstool.config create mode 100644 samples/tricore-none-eabi/reported.by create mode 100644 scripts/build/arch/tricore.sh diff --git a/config/arch/tricore.in b/config/arch/tricore.in new file mode 100644 index 00000000..cff8ca63 --- /dev/null +++ b/config/arch/tricore.in @@ -0,0 +1,10 @@ +# tricore specific configuration file + +## no-package +## depends on EXPERIMENTAL +## +## select ARCH_SUPPORTS_32 +## select ARCH_SUPPORTS_BOTH_ENDIAN +## select ARCH_DEFAULT_LE +## select ARCH_SUPPORTS_FLAT_FORMAT + diff --git a/samples/tricore-none-eabi/crosstool.config b/samples/tricore-none-eabi/crosstool.config new file mode 100644 index 00000000..7b9e2787 --- /dev/null +++ b/samples/tricore-none-eabi/crosstool.config @@ -0,0 +1,29 @@ +CT_CONFIG_VERSION="4" +CT_EXPERIMENTAL=y +CT_ARCH_TRICORE=y +CT_TARGET_CFLAGS="-ftls-model=local-exec" +CT_TARGET_VENDOR="none" +CT_BINUTILS_SRC_DEVEL=y +CT_BINUTILS_DEVEL_URL="https://github.com/EEESlab/tricore-binutils-gdb.git" +CT_BINUTILS_DEVEL_REVISION="01caba3cd2fdc00c881703063beadb080f6d4801" +CT_BINUTILS_V_2_40=y +CT_BINUTILS_EXTRA_CONFIG_ARRAY="--disable-warn-rwx-segments" +CT_NEWLIB_SRC_DEVEL=y +CT_NEWLIB_DEVEL_URL="https://github.com/EEESlab/tricore-newlib-cygwin.git" +CT_NEWLIB_DEVEL_REVISION="240a8f676ea923c703824e996fbe88ac4a302e17" +CT_NEWLIB_V_4_3=y +CT_LIBC_NEWLIB_IO_C99FMT=y +CT_LIBC_NEWLIB_IO_LL=y +CT_LIBC_NEWLIB_IO_FLOAT=y +CT_LIBC_NEWLIB_IO_POS_ARGS=y +CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y +CT_LIBC_NEWLIB_REENT_SMALL=y +CT_LIBC_NEWLIB_RETARGETABLE_LOCKING=y +# CT_LIBC_NEWLIB_WIDE_ORIENT is not set +CT_LIBC_NEWLIB_NANO_MALLOC=y +CT_LIBC_NEWLIB_EXTRA_CONFIG_ARRAY="--enable-newlib-iconv --enable-newlib-reent-binary-compat" +CT_GCC_SRC_DEVEL=y +CT_GCC_DEVEL_URL="https://github.com/EEESlab/tricore-gcc.git" +CT_GCC_DEVEL_REVISION="a383090685ca58596857bbe314dd4d16828e41e5" +CT_GCC_V_13=y +CT_CC_LANG_CXX=y diff --git a/samples/tricore-none-eabi/reported.by b/samples/tricore-none-eabi/reported.by new file mode 100644 index 00000000..773d44ab --- /dev/null +++ b/samples/tricore-none-eabi/reported.by @@ -0,0 +1,3 @@ +reporter_name="Jesus Ferreira" +reporter_url="" +reporter_comment="tricore-unknown-eabi" diff --git a/scripts/build/arch/tricore.sh b/scripts/build/arch/tricore.sh new file mode 100644 index 00000000..1051b56f --- /dev/null +++ b/scripts/build/arch/tricore.sh @@ -0,0 +1,9 @@ +# Compute tricore-specific values + +CT_DoArchTupleValues() +{ + # The architecture part of the tuple: + CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX}" + CT_ARCH_ENDIAN_CFLAG="" + CT_ARCH_ENDIAN_LDFLAG="" +} diff --git a/scripts/config.sub b/scripts/config.sub index 2c6a07ab..3a5a6bb8 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -1250,6 +1250,7 @@ case $cpu-$vendor in | tahoe \ | thumbv7* \ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tricore \ | tron \ | ubicom32 \ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \