This allows to pick host compiler automatically on fedora, as those
binaries are installed with 'gcc' package.

This covers all host arch supported to this day:
https://fedoraproject.org/wiki/Architectures
- x86_64
- aarch64
- ppc64le
- riscv64
- s390x
Note: QEMU and Fedora don't support 32-bit hosts anymore.

Signed-off-by: Pierrick Bouvier <[email protected]>
---
 tests/tcg/aarch64/meson.build        | 2 ++
 tests/tcg/aarch64/system/meson.build | 1 +
 tests/tcg/aarch64_be/meson.build     | 1 +
 tests/tcg/ppc64le/meson.build        | 1 +
 tests/tcg/riscv64/meson.build        | 2 ++
 tests/tcg/riscv64/system/meson.build | 1 +
 tests/tcg/s390x/meson.build          | 2 ++
 tests/tcg/s390x/system/meson.build   | 1 +
 tests/tcg/x86_64/meson.build         | 2 ++
 tests/tcg/x86_64/system/meson.build  | 1 +
 10 files changed, 14 insertions(+)

diff --git a/tests/tcg/aarch64/meson.build b/tests/tcg/aarch64/meson.build
index cc2c59fb4b6..1cec335df04 100644
--- a/tests/tcg/aarch64/meson.build
+++ b/tests/tcg/aarch64/meson.build
@@ -1,4 +1,5 @@
 cc = 'aarch64-linux-gnu-gcc'
+cc_alt = ['aarch64-redhat-linux-gcc']
 cc_dockerfile = 'debian-all-test-cross'
 
 cc_feat_cflags = {
@@ -196,6 +197,7 @@ if 'qemu-aarch64' in emulators
   tcg_tests += {
     'aarch64-linux-user': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 'aarch64',
diff --git a/tests/tcg/aarch64/system/meson.build 
b/tests/tcg/aarch64/system/meson.build
index 6ba35a9f722..fb3b33861ea 100644
--- a/tests/tcg/aarch64/system/meson.build
+++ b/tests/tcg/aarch64/system/meson.build
@@ -96,6 +96,7 @@ if 'qemu-system-aarch64' in emulators
   tcg_tests += {
     'aarch64-softmmu': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 'aarch64/system',
diff --git a/tests/tcg/aarch64_be/meson.build b/tests/tcg/aarch64_be/meson.build
index e45a49ec2da..509408de8e7 100644
--- a/tests/tcg/aarch64_be/meson.build
+++ b/tests/tcg/aarch64_be/meson.build
@@ -10,6 +10,7 @@ if 'qemu-aarch64_be' in emulators
   tcg_tests += {
     'aarch64_be-linux-user': {
       'cc': 'aarch64-linux-gnu-gcc',
+      'cc_alt': ['aarch64-redhat-linux-gcc'],
       'cc_dockerfile': 'debian-all-test-cross',
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 'aarch64_be',
diff --git a/tests/tcg/ppc64le/meson.build b/tests/tcg/ppc64le/meson.build
index a0f3e62e4d3..9f386287e7a 100644
--- a/tests/tcg/ppc64le/meson.build
+++ b/tests/tcg/ppc64le/meson.build
@@ -2,6 +2,7 @@ if 'qemu-ppc64le' in emulators
   tcg_tests += {
     'ppc64le-linux-user': {
       'cc': 'powerpc64le-linux-gnu-gcc',
+      'cc_alt': ['ppc64le-redhat-linux-gcc'],
       'cc_dockerfile': 'debian-all-test-cross',
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 'ppc64le',
diff --git a/tests/tcg/riscv64/meson.build b/tests/tcg/riscv64/meson.build
index 5ee20a1e98d..91c840b0058 100644
--- a/tests/tcg/riscv64/meson.build
+++ b/tests/tcg/riscv64/meson.build
@@ -1,4 +1,5 @@
 cc = 'riscv64-linux-gnu-gcc'
+cc_alt = ['riscv64-redhat-linux-gnu-gcc']
 cc_dockerfile = 'debian-all-test-cross'
 
 subdir('system')
@@ -26,6 +27,7 @@ if 'qemu-riscv64' in emulators
   tcg_tests += {
     'riscv64-linux-user': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'folder': 'riscv64',
       'gdb_arch': 'riscv64',
diff --git a/tests/tcg/riscv64/system/meson.build 
b/tests/tcg/riscv64/system/meson.build
index 87c3f9f11ce..c87e3eee1ad 100644
--- a/tests/tcg/riscv64/system/meson.build
+++ b/tests/tcg/riscv64/system/meson.build
@@ -65,6 +65,7 @@ if 'qemu-system-riscv64' in emulators
   tcg_tests += {
     'riscv64-softmmu': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'folder': 'riscv64',
       'gdb_arch': 'riscv64',
diff --git a/tests/tcg/s390x/meson.build b/tests/tcg/s390x/meson.build
index 1f9aa57fc73..f2328d9e5cf 100644
--- a/tests/tcg/s390x/meson.build
+++ b/tests/tcg/s390x/meson.build
@@ -1,4 +1,5 @@
 cc = 's390x-linux-gnu-gcc'
+cc_alt = ['s390x-redhat-linux-gcc']
 cc_dockerfile = 'debian-all-test-cross'
 
 cc_feat_cflags = {
@@ -140,6 +141,7 @@ if 'qemu-s390x' in emulators
   tcg_tests += {
     's390x-linux-user': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 's390x',
diff --git a/tests/tcg/s390x/system/meson.build 
b/tests/tcg/s390x/system/meson.build
index ef19c4831fd..359d124cc78 100644
--- a/tests/tcg/s390x/system/meson.build
+++ b/tests/tcg/s390x/system/meson.build
@@ -82,6 +82,7 @@ if 'qemu-system-s390x' in emulators
   tcg_tests += {
     's390x-softmmu': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'cc_feat_cflags': cc_feat_cflags,
       'folder': 's390x',
diff --git a/tests/tcg/x86_64/meson.build b/tests/tcg/x86_64/meson.build
index cfeef1d969c..968fe27cfc5 100644
--- a/tests/tcg/x86_64/meson.build
+++ b/tests/tcg/x86_64/meson.build
@@ -1,4 +1,5 @@
 cc = 'x86_64-linux-gnu-gcc'
+cc_alt = ['x86_64-redhat-linux-gcc']
 cc_dockerfile = 'debian-amd64-cross'
 
 subdir('system')
@@ -72,6 +73,7 @@ if 'qemu-x86_64' in emulators
   tcg_tests += {
     'x86_64-linux-user': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'folder': 'x86_64',
       'gdb_arch': 'x86_64',
diff --git a/tests/tcg/x86_64/system/meson.build 
b/tests/tcg/x86_64/system/meson.build
index 43e7d7afa85..08b770d43ae 100644
--- a/tests/tcg/x86_64/system/meson.build
+++ b/tests/tcg/x86_64/system/meson.build
@@ -52,6 +52,7 @@ if 'qemu-system-x86_64' in emulators
   tcg_tests += {
     'x86_64-softmmu': {
       'cc': cc,
+      'cc_alt': cc_alt,
       'cc_dockerfile': cc_dockerfile,
       'folder': 'x86_64/system',
       'gdb_arch': 'x86_64',
-- 
2.43.0


Reply via email to