From e2a83811c9e12c548ea86025a065e7ca258ff91e Mon Sep 17 00:00:00 2001
From: Ryo Shimizu <ryo@nerv.org>
Date: Tue, 14 Mar 2023 06:54:03 +0900
Subject: [PATCH 01/13] XXX: temporary patch for netbsd from pkgsrc

---
 meson.build                    | 2 +-
 target/arm/tcg/translate-sve.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 7ae0d109ab..33028de33e 100644
--- a/meson.build
+++ b/meson.build
@@ -1567,7 +1567,7 @@ if have_system and get_option('curses').allowed()
     endif
   endif
   if get_option('iconv').allowed()
-    foreach link_args : [ ['-liconv'], [] ]
+    foreach link_args : [ [], ['-liconv'] ]
       # Programs will be linked with glib and this will bring in libiconv on FreeBSD.
       # We need to use libiconv if available because mixing libiconv's headers with
       # the system libc does not work.
diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c
index 76e4a6c52c..0a362b2250 100644
--- a/target/arm/tcg/translate-sve.c
+++ b/target/arm/tcg/translate-sve.c
@@ -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 FSCALE
+#undef FSCALE
+#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)
-- 
2.54.0 (Apple Git-157)

