[PATCH v2 01/38] tcg/ppc: Define _CALL_AIX for clang on ppc64(be)

Richard Henderson posted 38 patches 2 years, 8 months ago
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Eduardo Habkost <eduardo@habkost.net>, "Alex Bennée" <alex.bennee@linaro.org>
There is a newer version of this series
[PATCH v2 01/38] tcg/ppc: Define _CALL_AIX for clang on ppc64(be)
Posted by Richard Henderson 2 years, 8 months ago
Restructure the ifdef ladder, separating 64-bit from 32-bit,
and ensure _CALL_AIX is set for ELF v1.  Fixes the build for
ppc64 big-endian host with clang.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/ppc/tcg-target.c.inc | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index 507fe6cda8..5c8378f8f6 100644
--- a/tcg/ppc/tcg-target.c.inc
+++ b/tcg/ppc/tcg-target.c.inc
@@ -29,15 +29,24 @@
 /*
  * Standardize on the _CALL_FOO symbols used by GCC:
  * Apple XCode does not define _CALL_DARWIN.
- * Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV (32-bit).
+ * Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV or _CALL_AIX.
  */
-#if !defined(_CALL_SYSV) && \
-    !defined(_CALL_DARWIN) && \
-    !defined(_CALL_AIX) && \
-    !defined(_CALL_ELF)
-# if defined(__APPLE__)
+#if TCG_TARGET_REG_BITS == 64
+# ifdef _CALL_AIX
+    /* ok */
+# elif defined(_CALL_ELF) && _CALL_ELF == 1
+#  define _CALL_AIX
+# elif defined(_CALL_ELF) && _CALL_ELF == 2
+    /* ok */
+# else
+#  error "Unknown ABI"
+# endif
+#else
+# if defined(_CALL_SYSV) || defined(_CALL_DARWIN)
+    /* ok */
+# elif defined(__APPLE__)
 #  define _CALL_DARWIN
-# elif defined(__ELF__) && TCG_TARGET_REG_BITS == 32
+# elif defined(__ELF__)
 #  define _CALL_SYSV
 # else
 #  error "Unknown ABI"
-- 
2.34.1
Re: [PATCH v2 01/38] tcg/ppc: Define _CALL_AIX for clang on ppc64(be)
Posted by Daniel Henrique Barboza 2 years, 8 months ago

On 6/8/23 23:23, Richard Henderson wrote:
> Restructure the ifdef ladder, separating 64-bit from 32-bit,
> and ensure _CALL_AIX is set for ELF v1.  Fixes the build for
> ppc64 big-endian host with clang.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   tcg/ppc/tcg-target.c.inc | 23 ++++++++++++++++-------
>   1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
> index 507fe6cda8..5c8378f8f6 100644
> --- a/tcg/ppc/tcg-target.c.inc
> +++ b/tcg/ppc/tcg-target.c.inc
> @@ -29,15 +29,24 @@
>   /*
>    * Standardize on the _CALL_FOO symbols used by GCC:
>    * Apple XCode does not define _CALL_DARWIN.
> - * Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV (32-bit).
> + * Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV or _CALL_AIX.
>    */
> -#if !defined(_CALL_SYSV) && \
> -    !defined(_CALL_DARWIN) && \
> -    !defined(_CALL_AIX) && \
> -    !defined(_CALL_ELF)
> -# if defined(__APPLE__)
> +#if TCG_TARGET_REG_BITS == 64
> +# ifdef _CALL_AIX
> +    /* ok */
> +# elif defined(_CALL_ELF) && _CALL_ELF == 1
> +#  define _CALL_AIX
> +# elif defined(_CALL_ELF) && _CALL_ELF == 2
> +    /* ok */
> +# else
> +#  error "Unknown ABI"
> +# endif
> +#else
> +# if defined(_CALL_SYSV) || defined(_CALL_DARWIN)
> +    /* ok */
> +# elif defined(__APPLE__)
>   #  define _CALL_DARWIN
> -# elif defined(__ELF__) && TCG_TARGET_REG_BITS == 32
> +# elif defined(__ELF__)
>   #  define _CALL_SYSV
>   # else
>   #  error "Unknown ABI"