Skip to contentSkip to conversation

Use long endian options for ppc64

PATCH In review Miroslav Rezanina 4 participants 5 messages Jan 31, 2022 – Feb 9, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Use long endian options for ppc64

GCC options pairs -mlittle/-mlittle-endian and -mbig/-mbig-endian are equivalent on ppc64 architecture. However, Clang supports only long version of the options.

Use longer form in configure to properly support both GCC and Clang compiler. In addition, fix this issue in tcg test configure.

---
This is v2 of configure: Use -mlittle-endian instead of -mlittle for ppc64.

v2:
- handle both -mlittle and -mbig usage
- fix tests/tcg/configure.sh

---
 configure              | 4 ++--
 tests/tcg/configure.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
configure +2 -2
index e6cfc0e4be..066fa29b70 100755
@@ -655,10 +655,10 @@ case "$cpu" in
   ppc)
     CPU_CFLAGS="-m32" ;;
   ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
   ppc64le)
     cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
 
   s390)
     CPU_CFLAGS="-m31" ;;
tests/tcg/configure.sh +2 -2
index 309335a2bd..21959e1fde 100755
@@ -64,9 +64,9 @@ fi
 : ${cross_cc_ppc="powerpc-linux-gnu-gcc"}
 : ${cross_cc_cflags_ppc="-m32"}
 : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"}
-: ${cross_cc_cflags_ppc64="-m64 -mbig"}
+: ${cross_cc_cflags_ppc64="-m64 -mbig-endian"}
 : ${cross_cc_ppc64le="$cross_cc_ppc64"}
-: ${cross_cc_cflags_ppc64le="-m64 -mlittle"}
+: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"}
 : ${cross_cc_riscv64="riscv64-linux-gnu-gcc"}
 : ${cross_cc_s390x="s390x-linux-gnu-gcc"}
 : ${cross_cc_sh4="sh4-linux-gnu-gcc"}
Signature · 1 line
2.34.1
Reviewed-by Philippe Mathieu-Daudé on v2 1/1
#1 lore raw
Quoted 12 lines · Miroslav Rezanina

GCC options pairs -mlittle/-mlittle-endian and -mbig/-mbig-endian are equivalent on ppc64 architecture. However, Clang supports only long version of the options.

Use longer form in configure to properly support both GCC and Clang compiler. In addition, fix this issue in tcg test configure.

---
This is v2 of configure: Use -mlittle-endian instead of -mlittle for ppc64.

Quoted 7 lines

v2:
- handle both -mlittle and -mbig usage
- fix tests/tcg/configure.sh

---
  configure              | 4 ++--
  tests/tcg/configure.sh | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by on v2 1/1
#2 lore raw
In reply to Miroslav Rezanina
Quoted 10 lines · On Mon, 31 Jan 2022 10:17:14 +0100 Miroslav Rezanina <[email protected]>…

GCC options pairs -mlittle/-mlittle-endian and -mbig/-mbig-endian are equivalent on ppc64 architecture. However, Clang supports only long version of the options.

Use longer form in configure to properly support both GCC and Clang compiler. In addition, fix this issue in tcg test configure.

---

Quoted 43 lines

This is v2 of configure: Use -mlittle-endian instead of -mlittle for ppc64.

v2:
- handle both -mlittle and -mbig usage
- fix tests/tcg/configure.sh

---
 configure              | 4 ++--
 tests/tcg/configure.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
configure +2 -2
index e6cfc0e4be..066fa29b70 100755
@@ -655,10 +655,10 @@ case "$cpu" in
   ppc)
     CPU_CFLAGS="-m32" ;;
   ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
   ppc64le)
     cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
 
   s390)
     CPU_CFLAGS="-m31" ;;
tests/tcg/configure.sh +2 -2
index 309335a2bd..21959e1fde 100755
@@ -64,9 +64,9 @@ fi
 : ${cross_cc_ppc="powerpc-linux-gnu-gcc"}
 : ${cross_cc_cflags_ppc="-m32"}
 : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"}
-: ${cross_cc_cflags_ppc64="-m64 -mbig"}
+: ${cross_cc_cflags_ppc64="-m64 -mbig-endian"}
 : ${cross_cc_ppc64le="$cross_cc_ppc64"}
-: ${cross_cc_cflags_ppc64le="-m64 -mlittle"}
+: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"}
 : ${cross_cc_riscv64="riscv64-linux-gnu-gcc"}
 : ${cross_cc_s390x="s390x-linux-gnu-gcc"}
 : ${cross_cc_sh4="sh4-linux-gnu-gcc"}
#3 lore raw
Quoted 7 lines · On Tue, 8 Feb 2022 14:47:19 +0100 Greg Kurz <[email protected]> wrote:
Quoted 4 lines · On Mon, 31 Jan 2022 10:17:14 +0100 Miroslav Rezanina <[email protected]>…

GCC options pairs -mlittle/-mlittle-endian and -mbig/-mbig-endian are equivalent on ppc64 architecture. However, Clang supports only long version of the options.

Quoted 9 lines
Quoted 6 lines

Use longer form in configure to properly support both GCC and Clang compiler. In addition, fix this issue in tcg test configure.

---

Cc'ing QEMU PPC folks since they're likely the primary users of ppc64 hosts.

Quoted 44 lines
Quoted 43 lines

This is v2 of configure: Use -mlittle-endian instead of -mlittle for ppc64.

v2:
- handle both -mlittle and -mbig usage
- fix tests/tcg/configure.sh

---
 configure              | 4 ++--
 tests/tcg/configure.sh | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
configure +2 -2
index e6cfc0e4be..066fa29b70 100755
@@ -655,10 +655,10 @@ case "$cpu" in
   ppc)
     CPU_CFLAGS="-m32" ;;
   ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
   ppc64le)
     cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
 
   s390)
     CPU_CFLAGS="-m31" ;;
tests/tcg/configure.sh +2 -2
index 309335a2bd..21959e1fde 100755
@@ -64,9 +64,9 @@ fi
 : ${cross_cc_ppc="powerpc-linux-gnu-gcc"}
 : ${cross_cc_cflags_ppc="-m32"}
 : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"}
-: ${cross_cc_cflags_ppc64="-m64 -mbig"}
+: ${cross_cc_cflags_ppc64="-m64 -mbig-endian"}
 : ${cross_cc_ppc64le="$cross_cc_ppc64"}
-: ${cross_cc_cflags_ppc64le="-m64 -mlittle"}
+: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"}
 : ${cross_cc_riscv64="riscv64-linux-gnu-gcc"}
 : ${cross_cc_s390x="s390x-linux-gnu-gcc"}
 : ${cross_cc_sh4="sh4-linux-gnu-gcc"}
#4 lore raw
In reply to Miroslav Rezanina
Quoted 54 lines · Miroslav Rezanina

GCC options pairs -mlittle/-mlittle-endian and -mbig/-mbig-endian are equivalent on ppc64 architecture. However, Clang supports only long version of the options.

Use longer form in configure to properly support both GCC and Clang compiler. In addition, fix this issue in tcg test configure.

---
This is v2 of configure: Use -mlittle-endian instead of -mlittle for ppc64.

v2:
- handle both -mlittle and -mbig usage
- fix tests/tcg/configure.sh

---
  configure              | 4 ++--
  tests/tcg/configure.sh | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
configure +2 -2
index e6cfc0e4be..066fa29b70 100755
@@ -655,10 +655,10 @@ case "$cpu" in
    ppc)
      CPU_CFLAGS="-m32" ;;
    ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
    ppc64le)
      cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
 
    s390)
      CPU_CFLAGS="-m31" ;;
tests/tcg/configure.sh +2 -3
index 309335a2bd..21959e1fde 100755
@@ -64,9 +64,9 @@ fi
  : ${cross_cc_ppc="powerpc-linux-gnu-gcc"}
  : ${cross_cc_cflags_ppc="-m32"}
  : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"}
-: ${cross_cc_cflags_ppc64="-m64 -mbig"}
+: ${cross_cc_cflags_ppc64="-m64 -mbig-endian"}
  : ${cross_cc_ppc64le="$cross_cc_ppc64"}
-: ${cross_cc_cflags_ppc64le="-m64 -mlittle"}
+: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"}
  : ${cross_cc_riscv64="riscv64-linux-gnu-gcc"}
  : ${cross_cc_s390x="s390x-linux-gnu-gcc"}
  : ${cross_cc_sh4="sh4-linux-gnu-gcc"}
--
Quoted 3 lines

2.34.1

The patch is fine, but some PPC tests are not compiling with Clang. I've sent an RFC about these issues: https://lists.gnu.org/archive/html/qemu-ppc/2022-02/msg00116.html

Thanks,
Matheus K. Ferst
Instituto de Pesquisas ELDORADO <http://www.eldorado.org.br/>
Analista de Software
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>