From 190ef24c0edb063ccf2c5dac04eaba08c7050de5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 May 2025 17:25:22 -0700 Subject: [PATCH 1/7] crosstool-ng: Add multilib-space bits These got left out of the gcc 14.2 patch series. Signed-off-by: Keith Packard --- crosstool-ng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crosstool-ng b/crosstool-ng index 53da3623..787dd4c9 160000 --- a/crosstool-ng +++ b/crosstool-ng @@ -1 +1 @@ -Subproject commit 53da3623f05d254d6f34ae2a349734479984fc5c +Subproject commit 787dd4c9fda66eaddcc7dabe93cc48ebfa40090f From efb0afe63f4a1e1e192696a36839a135f6776eb8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 May 2025 17:26:04 -0700 Subject: [PATCH 2/7] gcc: Build libstdc++ without C++ exceptions with multilib -Os When building a multilib-space toolchain, disable C++ exceptions in libstdc++ for the -Os variants. Signed-off-by: Keith Packard --- gcc | 2 +- gcc_arc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc b/gcc index 60300551..12d1ea99 160000 --- a/gcc +++ b/gcc @@ -1 +1 @@ -Subproject commit 6030055143f09163c9e0b9232f3abf7ea95ba4e3 +Subproject commit 12d1ea999241791a800e0cdc4be3a5950fc8a39e diff --git a/gcc_arc b/gcc_arc index f385c5c9..b0d870c3 160000 --- a/gcc_arc +++ b/gcc_arc @@ -1 +1 @@ -Subproject commit f385c5c9a1ff090b896dc604238ea198e12fef46 +Subproject commit b0d870c37e70c4029934702274f29d7dfd730461 From f188ae86d23f3f7c968f9b9b635aee515aeaf3ac Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 May 2025 17:28:59 -0700 Subject: [PATCH 3/7] picolibc: Get ARM asm exception changes Move picolibc forward to include patches that eliminate exception table entries for the arm asm code. Signed-off-by: Keith Packard --- picolibc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picolibc b/picolibc index c7cc2483..560946f2 160000 --- a/picolibc +++ b/picolibc @@ -1 +1 @@ -Subproject commit c7cc2483d591784bb2707f72b0784d92074f5347 +Subproject commit 560946f26db075c296beea5b39d99e6de43c9010 From 62cd55bef62b3497616a86723eb85c331a68d2a2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 May 2025 21:36:54 -0700 Subject: [PATCH 4/7] cmake: Make Zephyr use full libstdc++ with CPP_EXCEPTIONS When we're using C++ exceptions, we need to use the full version of libstdc++ that includes exception support. With multilib-space, that means using the -O2 version instead of the -Os version. Signed-off-by: Keith Packard --- cmake/zephyr/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/zephyr/Kconfig b/cmake/zephyr/Kconfig index 37675d7c..8fa38372 100644 --- a/cmake/zephyr/Kconfig +++ b/cmake/zephyr/Kconfig @@ -22,3 +22,7 @@ config PICOLIBC_DEFAULT depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" help Zephyr SDK >=0.17.1 always uses Picolibc + +choice COMPILER_OPTIMIZATIONS + default SPEED_OPTIMIZATIONS if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" && CPP_EXCEPTIONS +endchoice From 3ee05a28c69ba7203f69b012e98b14a026d26f36 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 May 2025 19:23:14 -0700 Subject: [PATCH 5/7] Enable multilib-space for everyone Add CT_MULTILIB_SPACE=y to the common configuration. Signed-off-by: Keith Packard --- configs/arc-zephyr-elf.config | 1 - configs/arm-zephyr-eabi.config | 1 - configs/common.config | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/configs/arc-zephyr-elf.config b/configs/arc-zephyr-elf.config index ecd61eed..8fd001fa 100644 --- a/configs/arc-zephyr-elf.config +++ b/configs/arc-zephyr-elf.config @@ -4,4 +4,3 @@ CT_ARCH_ARC=y CT_TARGET_VENDOR="zephyr" CT_TARGET_CFLAGS="-mno-sdata -mtp-regno=26 -ftls-model=local-exec" CT_MULTILIB=y -CT_MULTILIB_SPACE=y diff --git a/configs/arm-zephyr-eabi.config b/configs/arm-zephyr-eabi.config index 6da478d9..cc8ccba4 100644 --- a/configs/arm-zephyr-eabi.config +++ b/configs/arm-zephyr-eabi.config @@ -5,6 +5,5 @@ CT_ARCH_ARM_INTERWORKING=y CT_TARGET_VENDOR="zephyr" CT_TARGET_CFLAGS="-ftls-model=local-exec" CT_MULTILIB=y -CT_MULTILIB_SPACE=y CT_CC_GCC_MULTILIB_LIST="rmprofile" CT_LIBC_NEWLIB_NANO_TARGET_CFLAGS="-mthumb-interwork" diff --git a/configs/common.config b/configs/common.config index bccba365..d61df1b8 100644 --- a/configs/common.config +++ b/configs/common.config @@ -21,6 +21,7 @@ CT_GCC_CUSTOM_LOCATION="${GITHUB_WORKSPACE}/gcc" CT_CC_GCC_EXTRA_CONFIG_ARRAY="--with-gnu-ld --with-gnu-as --enable-initfini-array" CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="--with-gnu-ld --with-gnu-as --enable-initfini-array" CT_CC_LANG_CXX=y +CT_MULTILIB_SPACE=y # Picolibc CT_LIBC_PICOLIBC=y From 2c583f0fbce64bfc3780c8dfa2789732a1f281c6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 17 May 2025 13:33:08 -0700 Subject: [PATCH 6/7] Revert "config: common: do not strip libs" This reverts commit 50bac067f507ecdcada56854eaff09ad043690d9. --- configs/common.config | 2 -- 1 file changed, 2 deletions(-) diff --git a/configs/common.config b/configs/common.config index d61df1b8..5ce42746 100644 --- a/configs/common.config +++ b/configs/common.config @@ -1,7 +1,5 @@ # Common crosstool-ng configurations for all toolchain variants -CT_STRIP_TARGET_TOOLCHAIN_LIBRARIES=n - # Ncurses CT_NCURSES_HOST_FALLBACKS="linux,xterm,xterm-color,xterm-256color,vt100,screen,screen-256color,tmux,tmux-256color" From c4006023c67b98d880afe0bf31e33d19004e88c3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 23 May 2025 19:29:24 -0700 Subject: [PATCH 7/7] gcc/arc: Clobber CC and LP when shifting without barrel shifter 32-bit arc devices without a barrel shifter end up using a sequence of instructions. These can use the condition codes and/or loop count register, so those need to be marked as 'clobbered'. Signed-off-by: Keith Packard --- gcc | 2 +- gcc_arc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc b/gcc index 12d1ea99..c3463d89 160000 --- a/gcc +++ b/gcc @@ -1 +1 @@ -Subproject commit 12d1ea999241791a800e0cdc4be3a5950fc8a39e +Subproject commit c3463d89bbb1f812bf3e9c775c51245fde4b747b diff --git a/gcc_arc b/gcc_arc index b0d870c3..8a12fbb9 160000 --- a/gcc_arc +++ b/gcc_arc @@ -1 +1 @@ -Subproject commit b0d870c37e70c4029934702274f29d7dfd730461 +Subproject commit 8a12fbb9800d3d38cbc723a4fa3517786b3c5fa8