Add support for cross compilers that can be installed with
homebrew: https://github.com/orgs/Homebrew/packages?tab=packages&q=-gcc
- i686-elf-gcc
- x86_64-elf-gcc
- aarch64-elf-gcc
- m68k-elf-gcc (ignored since we don't have system tests for m68k)
- riscv64-elf-gcc
- arm-none-eabi-gcc

Those toolchain target bare metal, so can be used for softmmu targets
only (macos has no user target anyway).

With this, we can also cleanup our CI for MacOS since it does not
require any --cross-prefix anymore.

Signed-off-by: Pierrick Bouvier <[email protected]>
---
 .gitlab-ci.d/macos.yml               | 7 -------
 tests/tcg/aarch64/system/meson.build | 2 +-
 tests/tcg/arm/system/meson.build     | 1 +
 tests/tcg/i386/system/meson.build    | 1 +
 tests/tcg/riscv64/system/meson.build | 2 +-
 tests/tcg/x86_64/system/meson.build  | 2 +-
 6 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/.gitlab-ci.d/macos.yml b/.gitlab-ci.d/macos.yml
index 40b9b637b3b..c798384392c 100644
--- a/.gitlab-ci.d/macos.yml
+++ b/.gitlab-ci.d/macos.yml
@@ -41,10 +41,6 @@ aarch64-macos-15-build:
     PKG_CONFIG_PATH: 
/opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
     CONFIGURE_ARGS:
         --target-list=aarch64-softmmu,arm-softmmu,i386-softmmu,x86_64-softmmu
-        --cross-prefix-aarch64=aarch64-elf-
-        --cross-prefix-arm=arm-none-eabi-
-        --cross-prefix-i386=i686-elf-
-        --cross-prefix-x86_64=x86_64-elf-
         --disable-plugins
     TEST_TARGETS: check-unit check-tcg
 
@@ -59,8 +55,5 @@ aarch64-macos-26-build:
     PKG_CONFIG_PATH: 
/opt/homebrew/curl/lib/pkgconfig:/opt/homebrew/ncurses/lib/pkgconfig:/opt/homebrew/readline/lib/pkgconfig
     CONFIGURE_ARGS:
         --target-list=aarch64-softmmu,i386-softmmu,x86_64-softmmu
-        --cross-prefix-aarch64=aarch64-elf-
-        --cross-prefix-i386=i686-elf-
-        --cross-prefix-x86_64=x86_64-elf-
         --disable-plugins
     TEST_TARGETS: check-unit check-tcg
diff --git a/tests/tcg/aarch64/system/meson.build 
b/tests/tcg/aarch64/system/meson.build
index fb3b33861ea..f9c4448abaf 100644
--- a/tests/tcg/aarch64/system/meson.build
+++ b/tests/tcg/aarch64/system/meson.build
@@ -96,7 +96,7 @@ if 'qemu-system-aarch64' in emulators
   tcg_tests += {
     'aarch64-softmmu': {
       'cc': cc,
-      'cc_alt': cc_alt,
+      'cc_alt': cc_alt + ['aarch64-elf-gcc'],
       'cc_dockerfile': cc_dockerfile,
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 'aarch64/system',
diff --git a/tests/tcg/arm/system/meson.build b/tests/tcg/arm/system/meson.build
index 93d0cfec24e..89734f95605 100644
--- a/tests/tcg/arm/system/meson.build
+++ b/tests/tcg/arm/system/meson.build
@@ -64,6 +64,7 @@ if 'qemu-system-arm' in emulators
   tcg_tests += {
     'arm-softmmu': {
       'cc': cc,
+      'cc_alt': ['arm-none-eabi-gcc'],
       'cc_dockerfile': cc_dockerfile,
       'folder': 'arm/system',
       'gdb_arch': 'arm',
diff --git a/tests/tcg/i386/system/meson.build 
b/tests/tcg/i386/system/meson.build
index c3a19f43260..91c6e887191 100644
--- a/tests/tcg/i386/system/meson.build
+++ b/tests/tcg/i386/system/meson.build
@@ -42,6 +42,7 @@ if 'qemu-system-i386' in emulators
   tcg_tests += {
     'i386-softmmu': {
       'cc': cc,
+      'cc_alt': ['i686-elf-gcc'],
       'cc_dockerfile': cc_dockerfile,
       'folder': 'i386/system',
       'gdb_arch': 'i386',
diff --git a/tests/tcg/riscv64/system/meson.build 
b/tests/tcg/riscv64/system/meson.build
index c87e3eee1ad..c2d7d098871 100644
--- a/tests/tcg/riscv64/system/meson.build
+++ b/tests/tcg/riscv64/system/meson.build
@@ -65,7 +65,7 @@ if 'qemu-system-riscv64' in emulators
   tcg_tests += {
     'riscv64-softmmu': {
       'cc': cc,
-      'cc_alt': cc_alt,
+      'cc_alt': cc_alt + ['riscv64-elf-gcc'],
       'cc_dockerfile': cc_dockerfile,
       'folder': 'riscv64',
       'gdb_arch': 'riscv64',
diff --git a/tests/tcg/x86_64/system/meson.build 
b/tests/tcg/x86_64/system/meson.build
index 08b770d43ae..7d61257b771 100644
--- a/tests/tcg/x86_64/system/meson.build
+++ b/tests/tcg/x86_64/system/meson.build
@@ -52,7 +52,7 @@ if 'qemu-system-x86_64' in emulators
   tcg_tests += {
     'x86_64-softmmu': {
       'cc': cc,
-      'cc_alt': cc_alt,
+      'cc_alt': cc_alt + ['x86_64-elf-gcc'],
       'cc_dockerfile': cc_dockerfile,
       'folder': 'x86_64/system',
       'gdb_arch': 'x86_64',
-- 
2.43.0


Reply via email to