Skip to contentSkip to conversation

buildsys: Fix Solaris build

PATCH In review Philippe Mathieu-Daudé 4 participants 9 messages Nov 17, 2025 – Nov 18, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover buildsys: Fix Solaris build

Unfortunately Solaris OS is not tested in our CI, so it bit-rotted. Fortunately the fixes are easy.

Philippe Mathieu-Daudé (3):
qga/commands: Include proper Solaris header for getloadavg() migration/rdma: Check ntohll() availability with meson target/arm/tcg: Undefine Solaris FSCALE definition as a kludge

 meson.build                    | 4 ++++
 migration/rdma.c               | 4 +---
 qga/commands-posix.c           | 3 +++
 target/arm/tcg/translate-sve.c | 3 +++
 4 files changed, 11 insertions(+), 3 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/3 qga/commands: Include proper Solaris header for getloadavg()

Solaris declares getloadavg() in <sys/loadavg.h>:

getloadavg(3C) Standard C Library Functions getloadavg(3C)

NAME
getloadavg - get system load averages

SYNOPSIS
#include <sys/loadavg.h>

int getloadavg(double loadavg[], int nelem);

[...]

Oracle Solaris 11.4 23 Jul 2020 getloadavg(3C)

Include it in order to avoid:

../qga/commands-posix.c: In function 'qmp_guest_get_load':
../qga/commands-posix.c:1408:9: error: implicit declaration of function 'getloadavg' [-Wimplicit-function-declaration]

   1408 |     if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) {
      |         ^~~~~~~~~~

../qga/commands-posix.c:1408:9: warning: nested extern declaration of 'getloadavg' [-Wnested-externs]

../configure relevant output:

C compiler for the host machine: gcc (gcc 14.2.0 "gcc (GCC) 14.2.0") C linker for the host machine: gcc ld.solaris 5.11-1.3315

---
 qga/commands-posix.c | 3 +++
 1 file changed, 3 insertions(+)
qga/commands-posix.c +3 -0
index c7059857e44..66f3e6f6733 100644
@@ -43,6 +43,9 @@
 #include <net/ethernet.h>
 #endif
 #ifdef CONFIG_SOLARIS
+#ifdef CONFIG_GETLOADAVG
+#include <sys/loadavg.h>
+#endif
 #include <sys/sockio.h>
 #endif
 #endif
Signature · 1 line
2.51.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH-for-10.2 1/3] qga/commands: Include proper Solaris header for getloadavg()

Quoted 54 lines · Philippe Mathieu-Daudé

Solaris declares getloadavg() in <sys/loadavg.h>:

getloadavg(3C) Standard C Library Functions getloadavg(3C)

NAME
getloadavg - get system load averages

SYNOPSIS
#include <sys/loadavg.h>

int getloadavg(double loadavg[], int nelem);

[...]

Oracle Solaris 11.4 23 Jul 2020 getloadavg(3C)

Include it in order to avoid:

../qga/commands-posix.c: In function 'qmp_guest_get_load':
../qga/commands-posix.c:1408:9: error: implicit declaration of function
'getloadavg' [-Wimplicit-function-declaration]

   1408 |     if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) {
      |         ^~~~~~~~~~

../qga/commands-posix.c:1408:9: warning: nested extern declaration of
'getloadavg' [-Wnested-externs]

../configure relevant output:

C compiler for the host machine: gcc (gcc 14.2.0 "gcc (GCC) 14.2.0") C linker for the host machine: gcc ld.solaris 5.11-1.3315

---
 qga/commands-posix.c | 3 +++
 1 file changed, 3 insertions(+)
qga/commands-posix.c +3 -1
index c7059857e44..66f3e6f6733 100644
@@ -43,6 +43,9 @@
 #include <net/ethernet.h>
 #endif
 #ifdef CONFIG_SOLARIS
+#ifdef CONFIG_GETLOADAVG
+#include <sys/loadavg.h>
+#endif
 #include <sys/sockio.h>
 #endif
 #endif
--

2.51.0

Acked-by on v1 1/3
#3 lore raw

Re: [PATCH-for-10.2 1/3] qga/commands: Include proper Solaris header for getloadavg()

In reply to Philippe Mathieu-Daudé
Quoted 26 lines · Philippe Mathieu-Daudé

Solaris declares getloadavg() in <sys/loadavg.h>:

getloadavg(3C) Standard C Library Functions getloadavg(3C)

NAME
getloadavg - get system load averages

SYNOPSIS
#include <sys/loadavg.h>

int getloadavg(double loadavg[], int nelem);

[...]

Oracle Solaris 11.4 23 Jul 2020 getloadavg(3C)

Include it in order to avoid:

../qga/commands-posix.c: In function 'qmp_guest_get_load':
../qga/commands-posix.c:1408:9: error: implicit declaration of function 'getloadavg' [-Wimplicit-function-declaration]

    1408 |     if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) {
       |         ^~~~~~~~~~

../qga/commands-posix.c:1408:9: warning: nested extern declaration of 'getloadavg' [-Wnested-externs]

../configure relevant output:

Quoted 7 lines

C compiler for the host machine: gcc (gcc 14.2.0 "gcc (GCC) 14.2.0") C linker for the host machine: gcc ld.solaris 5.11-1.3315

---
  qga/commands-posix.c | 3 +++
  1 file changed, 3 insertions(+)

r~

Quoted 15 lines
qga/commands-posix.c +3 -0
index c7059857e44..66f3e6f6733 100644
@@ -43,6 +43,9 @@
  #include <net/ethernet.h>
  #endif
  #ifdef CONFIG_SOLARIS
+#ifdef CONFIG_GETLOADAVG
+#include <sys/loadavg.h>
+#endif
  #include <sys/sockio.h>
  #endif
  #endif
#4 lore raw

PATCH 2/3 migration/rdma: Check ntohll() availability with meson

In reply to Philippe Mathieu-Daudé

Commit 44ce1b5d2fc ("migration/rdma: define htonll/ntohll only if not predefined") tried to only include htonll/ntohll replacements when their symbol is *defined*, but this doesn't work, as they aren't:

../migration/rdma.c:242:17: error: static declaration of 'htonll' follows non-static declaration

    242 | static uint64_t htonll(uint64_t v)
        |                 ^~~~~~
  In file included from /usr/include/netinet/in.h:73,
                   from /usr/include/sys/socket.h:32,
                   from /home/f4bug/qemu/include/system/os-posix.h:30,
                   from /home/f4bug/qemu/include/qemu/osdep.h:176,
                   from ../migration/rdma.c:17:
  /usr/include/sys/byteorder.h:75:18: note: previous declaration of 'htonll' with type 'uint64_t(uint64_t)' {aka 'long unsigned int(long unsigned int)'}
     75 | extern  uint64_t htonll(uint64_t);
        |                  ^~~~~~
  ../migration/rdma.c:252:17: error: static declaration of 'ntohll' follows non-static declaration
    252 | static uint64_t ntohll(uint64_t v)
        |                 ^~~~~~
  /usr/include/sys/byteorder.h:76:18: note: previous declaration of 'ntohll' with type 'uint64_t(uint64_t)' {aka 'long unsigned int(long unsigned int)'}
     76 | extern  uint64_t ntohll(uint64_t);
        |                  ^~~~~~

Better to check the symbol availability with meson.

---
 meson.build      | 1 +
 migration/rdma.c | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)
meson.build +1 -0
index df4460035c3..72edd6097a4 100644
@@ -2663,6 +2663,7 @@ config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs'))
 config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range'))
 config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
 config_host_data.set('CONFIG_GETLOADAVG', cc.has_function('getloadavg'))
+config_host_data.set('CONFIG_ARPA_INET_64', cc.has_function('htonll'))
 config_host_data.set('HAVE_COPY_FILE_RANGE', cc.has_function('copy_file_range'))
 config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
 config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
migration/rdma.c +1 -3
index 2d839fce6c4..337b4158899 100644
@@ -238,7 +238,7 @@ static const char *control_desc(unsigned int rdma_control)
     return strs[rdma_control];
 }
 
-#if !defined(htonll)
+#if !defined(CONFIG_ARPA_INET_64)
 static uint64_t htonll(uint64_t v)
 {
     union { uint32_t lv[2]; uint64_t llv; } u;
@@ -246,9 +246,7 @@ static uint64_t htonll(uint64_t v)
     u.lv[1] = htonl(v & 0xFFFFFFFFULL);
     return u.llv;
 }
-#endif
 
-#if !defined(ntohll)
 static uint64_t ntohll(uint64_t v)
 {
     union { uint32_t lv[2]; uint64_t llv; } u;
Signature · 1 line
2.51.0
Acked-by on v1 2/3
#5 lore raw

Re: [PATCH-for-10.2 2/3] migration/rdma: Check ntohll() availability with meson

Quoted 23 lines · Philippe Mathieu-Daudé

Commit 44ce1b5d2fc ("migration/rdma: define htonll/ntohll only if not predefined") tried to only include htonll/ntohll replacements when their symbol is *defined*, but this doesn't work, as they aren't:

../migration/rdma.c:242:17: error: static declaration of 'htonll' follows non-static declaration

    242 | static uint64_t htonll(uint64_t v)
        |                 ^~~~~~
  In file included from /usr/include/netinet/in.h:73,
                   from /usr/include/sys/socket.h:32,
                   from /home/f4bug/qemu/include/system/os-posix.h:30,
                   from /home/f4bug/qemu/include/qemu/osdep.h:176,
                   from ../migration/rdma.c:17:
  /usr/include/sys/byteorder.h:75:18: note: previous declaration of 'htonll' with type 'uint64_t(uint64_t)' {aka 'long unsigned int(long unsigned int)'}
     75 | extern  uint64_t htonll(uint64_t);
        |                  ^~~~~~
  ../migration/rdma.c:252:17: error: static declaration of 'ntohll' follows non-static declaration
    252 | static uint64_t ntohll(uint64_t v)
        |                 ^~~~~~
  /usr/include/sys/byteorder.h:76:18: note: previous declaration of 'ntohll' with type 'uint64_t(uint64_t)' {aka 'long unsigned int(long unsigned int)'}
     76 | extern  uint64_t ntohll(uint64_t);
        |                  ^~~~~~
Quoted 3 lines

Better to check the symbol availability with meson.

Signature · 1 line
Peter Xu
Reviewed-by on v1 2/3
#6 lore raw

Re: [PATCH-for-10.2 2/3] migration/rdma: Check ntohll() availability with meson

In reply to Philippe Mathieu-Daudé
Quoted 36 lines · Philippe Mathieu-Daudé

Commit 44ce1b5d2fc ("migration/rdma: define htonll/ntohll only if not predefined") tried to only include htonll/ntohll replacements when their symbol is *defined*, but this doesn't work, as they aren't:

   ../migration/rdma.c:242:17: error: static declaration of 'htonll' follows non-static declaration
     242 | static uint64_t htonll(uint64_t v)
         |                 ^~~~~~
   In file included from /usr/include/netinet/in.h:73,
                    from /usr/include/sys/socket.h:32,
                    from /home/f4bug/qemu/include/system/os-posix.h:30,
                    from /home/f4bug/qemu/include/qemu/osdep.h:176,
                    from ../migration/rdma.c:17:
   /usr/include/sys/byteorder.h:75:18: note: previous declaration of 'htonll' with type 'uint64_t(uint64_t)' {aka 'long unsigned int(long unsigned int)'}
      75 | extern  uint64_t htonll(uint64_t);
         |                  ^~~~~~
   ../migration/rdma.c:252:17: error: static declaration of 'ntohll' follows non-static declaration
     252 | static uint64_t ntohll(uint64_t v)
         |                 ^~~~~~
   /usr/include/sys/byteorder.h:76:18: note: previous declaration of 'ntohll' with type 'uint64_t(uint64_t)' {aka 'long unsigned int(long unsigned int)'}
      76 | extern  uint64_t ntohll(uint64_t);
         |                  ^~~~~~

Better to check the symbol availability with meson.

---
  meson.build      | 1 +
  migration/rdma.c | 4 +---
  2 files changed, 2 insertions(+), 3 deletions(-)
meson.build +0 -0
index df4460035c3..72edd6097a4 100644

meson.build config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs')) · line 2669

Quoted 7 lines
meson.build +1 -0
@@ -2663,6 +2663,7 @@ config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs'))
  config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range'))
  config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
  config_host_data.set('CONFIG_GETLOADAVG', cc.has_function('getloadavg'))
+config_host_data.set('CONFIG_ARPA_INET_64', cc.has_function('htonll'))
  config_host_data.set('HAVE_COPY_FILE_RANGE', cc.has_function('copy_file_range'))
  config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
  config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)

Should we bother with htonl{,l} at all, when we have <qemu/bswap.h>?

That said, this is the minimal patch for 10.2, so

r~

#7 lore raw

PATCH 3/3 target/arm/tcg: Undefine Solaris FSCALE definition as a kludge

In reply to Philippe Mathieu-Daudé

CONFIG_SOLARIS_FSCALE

Solaris defines FSCALE in <sys/param.h>:

301 /*

  302  * Scale factor for scaled integers used to count
  303  * %cpu time and load averages.
  304  */

305 #define FSHIFT 8 /* bits to right of fixed binary point */
306 #define FSCALE (1<<FSHIFT)

When emulating the SVE FSCALE instruction, we defines the same name in decodetree format in target/arm/tcg/sve.decode:

1129:FSCALE 01100101 .. 00 1001 100 ... ..... ..... @rdn_pg_rm

This leads to a definition clash:

In file included from ../target/arm/tcg/translate-sve.c:21:
../target/arm/tcg/translate.h:875:17: error: pasting "trans_" and "(" does not give a valid preprocessing token

    875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
        |                 ^~~~~~
  ../target/arm/tcg/translate-sve.c:4205:5: note: in expansion of macro 'TRANS_FEAT'
   4205 |     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
        |     ^~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        | ^~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:12: error: expected declaration specifiers or '...' before numeric constant
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        |            ^~~~~~
  ../target/arm/tcg/translate.h:875:25: note: in definition of macro 'TRANS_FEAT'
    875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
        |                         ^~~~
  ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        | ^~~~~~~~~~
  ../target/arm/tcg/translate.h:875:47: error: pasting "arg_" and "(" does not give a valid preprocessing token
    875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
        |                                               ^~~~
  ../target/arm/tcg/translate-sve.c:4205:5: note: in expansion of macro 'TRANS_FEAT'
   4205 |     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
        |     ^~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        | ^~~~~~~~~~
  In file included from ../target/arm/tcg/translate-sve.c:100:
  libqemu-aarch64-softmmu.a.p/decode-sve.c.inc:1227:13: warning: 'trans_FSCALE' used but never defined
   1227 | static bool trans_FSCALE(DisasContext *ctx, arg_FSCALE *a);
        |             ^~~~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:30: warning: 'sve_fscalbn_zpzz_fns' defined but not used [-Wunused-const-variable=]
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        |                              ^~~~~~~~~~~

../target/arm/tcg/translate-sve.c:4201:42: note: in definition of macro 'DO_ZPZZ_FP'
4201 | static gen_helper_gvec_4_ptr * const name##_zpzz_fns[4] = { \
| ^~~~

As a kludge, check the definition existence with meson, then undefine it locally in target/arm/tcg/translate-sve.c file.

---
 meson.build                    | 3 +++
 target/arm/tcg/translate-sve.c | 3 +++
 2 files changed, 6 insertions(+)
meson.build +3 -0
index 72edd6097a4..65dd2bc6873 100644
@@ -2779,6 +2779,9 @@ config_host_data.set('HAVE_TCP_KEEPINTVL',
                      #endif
                      int main(void) { return 0; }''',
                      name: 'Win32 TCP_KEEPINTVL'))
+if host_os == 'sunos'
+  config_host_data.set('CONFIG_SOLARIS_FSCALE', cc.has_header_symbol('sys/param.h', 'FSCALE'))
+endif
 
 # has_member
 config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
target/arm/tcg/translate-sve.c +3 -0
index 07b827fa8e8..b6fd069aa0c 100644
@@ -4246,6 +4246,9 @@ DO_ZPZZ_AH_FP_B16(FMAX_zpzz, aa64_sve, sve_fmax, sve_ah_fmax)
 DO_ZPZZ_FP_B16(FMINNM_zpzz, aa64_sve, sve_fminnum)
 DO_ZPZZ_FP_B16(FMAXNM_zpzz, aa64_sve, sve_fmaxnum)
 DO_ZPZZ_AH_FP(FABD, aa64_sve, sve_fabd, sve_ah_fabd)
+#ifdef CONFIG_SOLARIS_FSCALE
+#undef FSCALE /* Kludge for Solaris which defines FSCALE in <sys/param.h> */
+#endif
 DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
 DO_ZPZZ_FP(FDIV, aa64_sve, sve_fdiv)
 DO_ZPZZ_FP(FMULX, aa64_sve, sve_fmulx)
Signature · 1 line
2.51.0
#8 lore raw

Re: [PATCH-for-10.2 3/3] target/arm/tcg: Undefine Solaris FSCALE definition as a kludge

Quoted 85 lines · Philippe Mathieu-Daudé

CONFIG_SOLARIS_FSCALE

Solaris defines FSCALE in <sys/param.h>:

301 /*

   302  * Scale factor for scaled integers used to count
   303  * %cpu time and load averages.
   304  */

305 #define FSHIFT 8 /* bits to right of fixed binary point */
306 #define FSCALE (1<<FSHIFT)

When emulating the SVE FSCALE instruction, we defines the same name in decodetree format in target/arm/tcg/sve.decode:

   1129:FSCALE          01100101 .. 00 1001 100 ... ..... .....    @rdn_pg_rm

This leads to a definition clash:

   In file included from ../target/arm/tcg/translate-sve.c:21:
   ../target/arm/tcg/translate.h:875:17: error: pasting "trans_" and "(" does not give a valid preprocessing token
     875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
         |                 ^~~~~~
   ../target/arm/tcg/translate-sve.c:4205:5: note: in expansion of macro 'TRANS_FEAT'
    4205 |     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
         |     ^~~~~~~~~~
   ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
    4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
         | ^~~~~~~~~~
   ../target/arm/tcg/translate-sve.c:4249:12: error: expected declaration specifiers or '...' before numeric constant
    4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
         |            ^~~~~~
   ../target/arm/tcg/translate.h:875:25: note: in definition of macro 'TRANS_FEAT'
     875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
         |                         ^~~~
   ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
    4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
         | ^~~~~~~~~~
   ../target/arm/tcg/translate.h:875:47: error: pasting "arg_" and "(" does not give a valid preprocessing token
     875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
         |                                               ^~~~
   ../target/arm/tcg/translate-sve.c:4205:5: note: in expansion of macro 'TRANS_FEAT'
    4205 |     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
         |     ^~~~~~~~~~
   ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
    4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
         | ^~~~~~~~~~
   In file included from ../target/arm/tcg/translate-sve.c:100:
   libqemu-aarch64-softmmu.a.p/decode-sve.c.inc:1227:13: warning: 'trans_FSCALE' used but never defined
    1227 | static bool trans_FSCALE(DisasContext *ctx, arg_FSCALE *a);
         |             ^~~~~~~~~~~~
   ../target/arm/tcg/translate-sve.c:4249:30: warning: 'sve_fscalbn_zpzz_fns' defined but not used [-Wunused-const-variable=]
    4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
         |                              ^~~~~~~~~~~
   ../target/arm/tcg/translate-sve.c:4201:42: note: in definition of macro 'DO_ZPZZ_FP'
    4201 |     static gen_helper_gvec_4_ptr * const name##_zpzz_fns[4] = { \
         |                                          ^~~~

As a kludge, check the definition existence with meson, then undefine it locally in target/arm/tcg/translate-sve.c file.

---
  meson.build                    | 3 +++
  target/arm/tcg/translate-sve.c | 3 +++
  2 files changed, 6 insertions(+)
meson.build +3 -0
index 72edd6097a4..65dd2bc6873 100644
@@ -2779,6 +2779,9 @@ config_host_data.set('HAVE_TCP_KEEPINTVL',
                       #endif
                       int main(void) { return 0; }''',
                       name: 'Win32 TCP_KEEPINTVL'))
+if host_os == 'sunos'
+  config_host_data.set('CONFIG_SOLARIS_FSCALE', cc.has_header_symbol('sys/param.h', 'FSCALE'))
+endif
 
  # has_member
  config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
target/arm/tcg/translate-sve.c +0 -0
index 07b827fa8e8..b6fd069aa0c 100644

target/arm/tcg/translate-sve.c DO_ZPZZ_AH_FP_B16(FMAX_zpzz, aa64_sve, sve_fmax, sve_ah_fmax) · line 4254

Quoted 9 lines
target/arm/tcg/translate-sve.c +3 -0
@@ -4246,6 +4246,9 @@ DO_ZPZZ_AH_FP_B16(FMAX_zpzz, aa64_sve, sve_fmax, sve_ah_fmax)
  DO_ZPZZ_FP_B16(FMINNM_zpzz, aa64_sve, sve_fminnum)
  DO_ZPZZ_FP_B16(FMAXNM_zpzz, aa64_sve, sve_fmaxnum)
  DO_ZPZZ_AH_FP(FABD, aa64_sve, sve_fabd, sve_ah_fabd)
+#ifdef CONFIG_SOLARIS_FSCALE
+#undef FSCALE /* Kludge for Solaris which defines FSCALE in <sys/param.h> */
+#endif
  DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
  DO_ZPZZ_FP(FDIV, aa64_sve, sve_fdiv)
  DO_ZPZZ_FP(FMULX, aa64_sve, sve_fmulx)

You don't need an ifdef for undef, just undef it.

r~