Skip to contentSkip to conversation

configure: Fix building on a ppc64 host with Clang

PATCH In review Thomas Huth 3 participants 5 messages Mar 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Fix building on a ppc64 host with Clang

Clang only supports the -mlittle-endian and -mbig-endian switches, and not -mlittle / -mbig. Since GCC supports both, let's use the long versions that are supported by both instead.

---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index c56ed53ee3..81618708e4 100755
@@ -630,10 +630,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" ;;
Signature · 1 line
2.27.0
#1 lore raw
Quoted 16 lines · Thomas Huth

Clang only supports the -mlittle-endian and -mbig-endian switches, and not -mlittle / -mbig. Since GCC supports both, let's use the long versions that are supported by both instead.

---
  configure | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
configure +0 -0
index c56ed53ee3..81618708e4 100755
@@ -630,10 +630,10 @@ case "$cpu" in
    ppc)
      CPU_CFLAGS="-m32" ;;

configure case "$cpu" in · line 639

Quoted 10 lines
configure +2 -2
    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" ;;

Mirek sent a similar fix, but it was pending Matheus TCG fixes:

https://lore.kernel.org/qemu-devel/[email protected]/
https://lists.gnu.org/archive/html/qemu-ppc/2022-02/msg00116.html

#2 lore raw
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 20 lines · Thomas Huth

Clang only supports the -mlittle-endian and -mbig-endian switches, and not -mlittle / -mbig. Since GCC supports both, let's use the long versions that are supported by both instead.

---
  configure | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
index c56ed53ee3..81618708e4 100755
@@ -630,10 +630,10 @@ case "$cpu" in
     ppc)
       CPU_CFLAGS="-m32" ;;
     ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
     ppc64le)
Quoted 5 lines

      cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
    s390)
      CPU_CFLAGS="-m31" ;;

Mirek sent a similar fix, but it was pending Matheus TCG fixes:

Quoted 2 lines

https://lore.kernel.org/qemu-devel/[email protected]/
https://lists.gnu.org/archive/html/qemu-ppc/2022-02/msg00116.html

Yes.

I kept it for later because I understood there were still problems with clang. May be I am wrong. Matheus ?

Thanks,

C.

#3 lore raw
Quoted 30 lines · Cédric Le Goater
Quoted 29 lines · Philippe Mathieu-Daudé
Quoted 20 lines · Thomas Huth

Clang only supports the -mlittle-endian and -mbig-endian switches, and not -mlittle / -mbig. Since GCC supports both, let's use the long versions that are supported by both instead.

---
  configure | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
index c56ed53ee3..81618708e4 100755
@@ -630,10 +630,10 @@ case "$cpu" in
     ppc)
       CPU_CFLAGS="-m32" ;;
     ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
     ppc64le)
Quoted 5 lines

      cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
    s390)
      CPU_CFLAGS="-m31" ;;

Mirek sent a similar fix, but it was pending Matheus TCG fixes:

Quoted 7 lines
Quoted 2 lines

https://lore.kernel.org/qemu-devel/[email protected]/
https://lists.gnu.org/archive/html/qemu-ppc/2022-02/msg00116.html

Yes.

I kept it for later because I understood there were still problems with clang. May be I am wrong. Matheus ?

As far as I can see, there are some additional problems with the TCG tests, but the patch to the configure script is already required if the user only want to compile the main QEMU binaries. So I'd recommend to go ahead and queue Miroslav's patch already, the TCG tests can still be fixed on top later.

Thomas

#4 lore raw
Quoted 34 lines · Thomas Huth
Quoted 33 lines · Cédric Le Goater
Quoted 31 lines · Philippe Mathieu-Daudé
Quoted 20 lines · Thomas Huth

Clang only supports the -mlittle-endian and -mbig-endian switches, and not -mlittle / -mbig. Since GCC supports both, let's use the long versions that are supported by both instead.

---
  configure | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
index c56ed53ee3..81618708e4 100755
@@ -630,10 +630,10 @@ case "$cpu" in
     ppc)
       CPU_CFLAGS="-m32" ;;
     ppc64)
-    CPU_CFLAGS="-m64 -mbig" ;;
+    CPU_CFLAGS="-m64 -mbig-endian" ;;
     ppc64le)
Quoted 5 lines

      cpu="ppc64"
-    CPU_CFLAGS="-m64 -mlittle" ;;
+    CPU_CFLAGS="-m64 -mlittle-endian" ;;
    s390)
      CPU_CFLAGS="-m31" ;;

Mirek sent a similar fix, but it was pending Matheus TCG fixes:

https://lore.kernel.org/qemu-devel/[email protected]/
https://lists.gnu.org/archive/html/qemu-ppc/2022-02/msg00116.html

Quoted 6 lines
Quoted 4 lines

Yes.

I kept it for later because I understood there were still problems with clang. May be I am wrong. Matheus ?

As far as I can see, there are some additional problems with the TCG tests, but the patch to the configure script is already required if the user only want to compile the main QEMU binaries. So I'd recommend to go ahead and queue Miroslav's patch already, the TCG tests can still be fixed on top later.

OK. I will add it to the ppc queue.

Thanks,

C.