configure: Fix building on a ppc64 host with Clang
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
@@ -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
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.
Signed-off-by Thomas Huth <[email protected]>--- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)configure +0
-0@@ -630,10 +630,10 @@ case "$cpu" in ppc) CPU_CFLAGS="-m32" ;;
configure case "$cpu" in · line 639
Quoted 10 lines
configure +2
-2ppc64) - 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
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.
Signed-off-by Thomas Huth <[email protected]>---
configure | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)configure +1
-1@@ -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.
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.
Signed-off-by Thomas Huth <[email protected]>---
configure | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)configure +1
-1@@ -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.htmlYes.
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
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.
Signed-off-by Thomas Huth <[email protected]>---
configure | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)configure +1
-1@@ -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.