Hi,

This patch should fix builds on PPC with multilib enabled.

Multilibs should not have been split up as two logically different CPU,
so at configure time, powerpc64 was being detected, but none of the
32-bit support files were being compiled in.

Segher, is this OK?

Immediately to hand, I only have a powerpc64 cross compiler to test that
both switchcontext.S and callwithstack.S compiler with -m32 and -m64.

Regards
Iain.

---
libphobos/ChangeLog:

        * configure: Regenerated.
        * libdruntime/Makefile.am (DRUNTIME_SOURCES_CONFIGURED): Add both
        switchcontext.S and callwithstack.S if DRUNTIME_CPU_POWERPC.
        (DRUNTIME_CPU_POWERPC): Add config/powerpc64/callwithstack.S.
        * libdruntime/Makefile.in: Regenerated.
        * libdruntime/config/powerpc/switchcontext.S: Add __PPC__ guards.
        * libdruntime/config/powerpc64/callwithstack.S: Add __PPC64__ guards.
        * m4/druntime/cpu.m4 (DRUNTIME_CPU_SOURCES): Define DRUNTIME_CPU_POWER
        for all powerpc biarchs.  Remove DRUNTIME_CPU_POWER64 conditional.
---
 libphobos/configure                           | 23 +-----
 libphobos/libdruntime/Makefile.am             |  6 +-
 libphobos/libdruntime/Makefile.in             | 77 +++++++++----------
 .../config/powerpc/switchcontext.S            |  4 +
 .../config/powerpc64/callwithstack.S          |  4 +
 libphobos/m4/druntime/cpu.m4                  |  7 +-
 6 files changed, 52 insertions(+), 69 deletions(-)

diff --git a/libphobos/configure b/libphobos/configure
index 98d8dc255c1..e461c7442b2 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -692,8 +692,6 @@ DRUNTIME_CPU_SYSTEMZ_FALSE
 DRUNTIME_CPU_SYSTEMZ_TRUE
 DRUNTIME_CPU_X86_FALSE
 DRUNTIME_CPU_X86_TRUE
-DRUNTIME_CPU_POWERPC64_FALSE
-DRUNTIME_CPU_POWERPC64_TRUE
 DRUNTIME_CPU_POWERPC_FALSE
 DRUNTIME_CPU_POWERPC_TRUE
 DRUNTIME_CPU_MIPS_FALSE
@@ -11649,7 +11647,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11652 "configure"
+#line 11650 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11755,7 +11753,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11758 "configure"
+#line 11756 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13991,12 +13989,9 @@ fi
                ;;
       mips*)   druntime_target_cpu_parsed="mips"
                ;;
-      powerpc|powerpcle)
+      powerpc*)
                druntime_target_cpu_parsed="powerpc"
                ;;
-      powerpc64|powerpc64le)
-               druntime_target_cpu_parsed="powerpc64"
-               ;;
       i[34567]86|x86_64)
                druntime_target_cpu_parsed="x86"
                ;;
@@ -14039,14 +14034,6 @@ else
   DRUNTIME_CPU_POWERPC_FALSE=
 fi
 
-   if test "$druntime_target_cpu_parsed" = "powerpc64"; then
-  DRUNTIME_CPU_POWERPC64_TRUE=
-  DRUNTIME_CPU_POWERPC64_FALSE='#'
-else
-  DRUNTIME_CPU_POWERPC64_TRUE='#'
-  DRUNTIME_CPU_POWERPC64_FALSE=
-fi
-
    if test "$druntime_target_cpu_parsed" = "x86"; then
   DRUNTIME_CPU_X86_TRUE=
   DRUNTIME_CPU_X86_FALSE='#'
@@ -15605,10 +15592,6 @@ if test -z "${DRUNTIME_CPU_POWERPC_TRUE}" && test -z 
"${DRUNTIME_CPU_POWERPC_FAL
   as_fn_error $? "conditional \"DRUNTIME_CPU_POWERPC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${DRUNTIME_CPU_POWERPC64_TRUE}" && test -z 
"${DRUNTIME_CPU_POWERPC64_FALSE}"; then
-  as_fn_error $? "conditional \"DRUNTIME_CPU_POWERPC64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${DRUNTIME_CPU_X86_TRUE}" && test -z "${DRUNTIME_CPU_X86_FALSE}"; 
then
   as_fn_error $? "conditional \"DRUNTIME_CPU_X86\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libphobos/libdruntime/Makefile.am 
b/libphobos/libdruntime/Makefile.am
index e1f47d36f90..1b1c5689e7e 100644
--- a/libphobos/libdruntime/Makefile.am
+++ b/libphobos/libdruntime/Makefile.am
@@ -81,10 +81,8 @@ if DRUNTIME_CPU_MIPS
     DRUNTIME_SOURCES_CONFIGURED += config/mips/switchcontext.S
 endif
 if DRUNTIME_CPU_POWERPC
-    DRUNTIME_SOURCES_CONFIGURED += config/powerpc/switchcontext.S
-endif
-if DRUNTIME_CPU_POWERPC64
-    DRUNTIME_SOURCES_CONFIGURED += config/powerpc64/callwithstack.S
+    DRUNTIME_SOURCES_CONFIGURED += config/powerpc/switchcontext.S \
+                                  config/powerpc64/callwithstack.S
 endif
 if DRUNTIME_CPU_X86
 if DRUNTIME_OS_MINGW
diff --git a/libphobos/libdruntime/Makefile.in 
b/libphobos/libdruntime/Makefile.in
index 53402842cb4..04e58bb9034 100644
--- a/libphobos/libdruntime/Makefile.in
+++ b/libphobos/libdruntime/Makefile.in
@@ -123,12 +123,13 @@ target_triplet = @target@
 @DRUNTIME_CPU_AARCH64_TRUE@am__append_11 = config/aarch64/switchcontext.S
 @DRUNTIME_CPU_ARM_TRUE@am__append_12 = config/arm/switchcontext.S
 @DRUNTIME_CPU_MIPS_TRUE@am__append_13 = config/mips/switchcontext.S
-@DRUNTIME_CPU_POWERPC_TRUE@am__append_14 = config/powerpc/switchcontext.S
-@DRUNTIME_CPU_POWERPC64_TRUE@am__append_15 = config/powerpc64/callwithstack.S
-@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_16 = 
config/mingw/switchcontext.S
-@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_17 = 
config/x86/switchcontext.S
-@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_18 = config/systemz/get_tls_offset.S
-@DRUNTIME_CPU_S390_TRUE@am__append_19 = config/s390/get_tls_offset.S
+@DRUNTIME_CPU_POWERPC_TRUE@am__append_14 = config/powerpc/switchcontext.S \
+@DRUNTIME_CPU_POWERPC_TRUE@                               
config/powerpc64/callwithstack.S
+
+@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_15 = 
config/mingw/switchcontext.S
+@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_16 = 
config/x86/switchcontext.S
+@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_17 = config/systemz/get_tls_offset.S
+@DRUNTIME_CPU_S390_TRUE@am__append_18 = config/s390/get_tls_offset.S
 subdir = libdruntime
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
@@ -440,46 +441,44 @@ am__objects_21 = core/sys/solaris/dlfcn.lo 
core/sys/solaris/elf.lo \
 @DRUNTIME_CPU_AARCH64_TRUE@am__objects_23 = 
config/aarch64/libgdruntime_la-switchcontext.lo
 @DRUNTIME_CPU_ARM_TRUE@am__objects_24 = 
config/arm/libgdruntime_la-switchcontext.lo
 @DRUNTIME_CPU_MIPS_TRUE@am__objects_25 = 
config/mips/libgdruntime_la-switchcontext.lo
-@DRUNTIME_CPU_POWERPC_TRUE@am__objects_26 = 
config/powerpc/libgdruntime_la-switchcontext.lo
-@DRUNTIME_CPU_POWERPC64_TRUE@am__objects_27 = 
config/powerpc64/libgdruntime_la-callwithstack.lo
-@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_28 = 
config/mingw/libgdruntime_la-switchcontext.lo
-@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_29 = 
config/x86/libgdruntime_la-switchcontext.lo
-@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_30 = 
config/systemz/libgdruntime_la-get_tls_offset.lo
-@DRUNTIME_CPU_S390_TRUE@am__objects_31 = 
config/s390/libgdruntime_la-get_tls_offset.lo
-am__objects_32 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \
+@DRUNTIME_CPU_POWERPC_TRUE@am__objects_26 = 
config/powerpc/libgdruntime_la-switchcontext.lo \
+@DRUNTIME_CPU_POWERPC_TRUE@    
config/powerpc64/libgdruntime_la-callwithstack.lo
+@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_27 = 
config/mingw/libgdruntime_la-switchcontext.lo
+@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_28 = 
config/x86/libgdruntime_la-switchcontext.lo
+@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_29 = 
config/systemz/libgdruntime_la-get_tls_offset.lo
+@DRUNTIME_CPU_S390_TRUE@am__objects_30 = 
config/s390/libgdruntime_la-get_tls_offset.lo
+am__objects_31 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \
        $(am__objects_10) $(am__objects_12) $(am__objects_14) \
        $(am__objects_16) $(am__objects_18) $(am__objects_20) \
        $(am__objects_22) $(am__objects_23) $(am__objects_24) \
        $(am__objects_25) $(am__objects_26) $(am__objects_27) \
-       $(am__objects_28) $(am__objects_29) $(am__objects_30) \
-       $(am__objects_31)
-am__objects_33 = gcc/config.lo gcc/libbacktrace.lo
-am__objects_34 = $(am__objects_1) $(am__objects_2) $(am__objects_32) \
-       $(am__objects_33)
-am_libgdruntime_la_OBJECTS = $(am__objects_34)
+       $(am__objects_28) $(am__objects_29) $(am__objects_30)
+am__objects_32 = gcc/config.lo gcc/libbacktrace.lo
+am__objects_33 = $(am__objects_1) $(am__objects_2) $(am__objects_31) \
+       $(am__objects_32)
+am_libgdruntime_la_OBJECTS = $(am__objects_33)
 libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS)
 am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am__objects_35 = core/stdc/libgdruntime_convenience_la-errno_.lo
-@DRUNTIME_CPU_AARCH64_TRUE@am__objects_36 = 
config/aarch64/libgdruntime_convenience_la-switchcontext.lo
-@DRUNTIME_CPU_ARM_TRUE@am__objects_37 = 
config/arm/libgdruntime_convenience_la-switchcontext.lo
-@DRUNTIME_CPU_MIPS_TRUE@am__objects_38 = 
config/mips/libgdruntime_convenience_la-switchcontext.lo
-@DRUNTIME_CPU_POWERPC_TRUE@am__objects_39 = 
config/powerpc/libgdruntime_convenience_la-switchcontext.lo
-@DRUNTIME_CPU_POWERPC64_TRUE@am__objects_40 = 
config/powerpc64/libgdruntime_convenience_la-callwithstack.lo
-@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_41 = 
config/mingw/libgdruntime_convenience_la-switchcontext.lo
-@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_42 = 
config/x86/libgdruntime_convenience_la-switchcontext.lo
-@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_43 = 
config/systemz/libgdruntime_convenience_la-get_tls_offset.lo
-@DRUNTIME_CPU_S390_TRUE@am__objects_44 = 
config/s390/libgdruntime_convenience_la-get_tls_offset.lo
-am__objects_45 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \
+am__objects_34 = core/stdc/libgdruntime_convenience_la-errno_.lo
+@DRUNTIME_CPU_AARCH64_TRUE@am__objects_35 = 
config/aarch64/libgdruntime_convenience_la-switchcontext.lo
+@DRUNTIME_CPU_ARM_TRUE@am__objects_36 = 
config/arm/libgdruntime_convenience_la-switchcontext.lo
+@DRUNTIME_CPU_MIPS_TRUE@am__objects_37 = 
config/mips/libgdruntime_convenience_la-switchcontext.lo
+@DRUNTIME_CPU_POWERPC_TRUE@am__objects_38 = 
config/powerpc/libgdruntime_convenience_la-switchcontext.lo \
+@DRUNTIME_CPU_POWERPC_TRUE@    
config/powerpc64/libgdruntime_convenience_la-callwithstack.lo
+@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_39 = 
config/mingw/libgdruntime_convenience_la-switchcontext.lo
+@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_40 = 
config/x86/libgdruntime_convenience_la-switchcontext.lo
+@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_41 = 
config/systemz/libgdruntime_convenience_la-get_tls_offset.lo
+@DRUNTIME_CPU_S390_TRUE@am__objects_42 = 
config/s390/libgdruntime_convenience_la-get_tls_offset.lo
+am__objects_43 = $(am__objects_4) $(am__objects_6) $(am__objects_8) \
        $(am__objects_10) $(am__objects_12) $(am__objects_14) \
        $(am__objects_16) $(am__objects_18) $(am__objects_20) \
-       $(am__objects_22) $(am__objects_36) $(am__objects_37) \
-       $(am__objects_38) $(am__objects_39) $(am__objects_40) \
-       $(am__objects_41) $(am__objects_42) $(am__objects_43) \
-       $(am__objects_44)
-am__objects_46 = $(am__objects_1) $(am__objects_35) $(am__objects_45) \
-       $(am__objects_33)
-am__objects_47 = $(am__objects_46)
-am_libgdruntime_convenience_la_OBJECTS = $(am__objects_47)
+       $(am__objects_22) $(am__objects_35) $(am__objects_36) \
+       $(am__objects_37) $(am__objects_38) $(am__objects_39) \
+       $(am__objects_40) $(am__objects_41) $(am__objects_42)
+am__objects_44 = $(am__objects_1) $(am__objects_34) $(am__objects_43) \
+       $(am__objects_32)
+am__objects_45 = $(am__objects_44)
+am_libgdruntime_convenience_la_OBJECTS = $(am__objects_45)
 libgdruntime_convenience_la_OBJECTS =  \
        $(am_libgdruntime_convenience_la_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
@@ -741,7 +740,7 @@ DRUNTIME_SOURCES_CONFIGURED = $(am__append_1) 
$(am__append_2) \
        $(am__append_9) $(am__append_10) $(am__append_11) \
        $(am__append_12) $(am__append_13) $(am__append_14) \
        $(am__append_15) $(am__append_16) $(am__append_17) \
-       $(am__append_18) $(am__append_19)
+       $(am__append_18)
 
 # Provide __start_minfo, __stop_minfo if linker doesn't.
 @DRUNTIME_OS_MINFO_BRACKETING_FALSE@DRTSTUFF = gcc/drtbegin.o gcc/drtend.o
diff --git a/libphobos/libdruntime/config/powerpc/switchcontext.S 
b/libphobos/libdruntime/config/powerpc/switchcontext.S
index 5470f9c4ca3..82ee542064b 100644
--- a/libphobos/libdruntime/config/powerpc/switchcontext.S
+++ b/libphobos/libdruntime/config/powerpc/switchcontext.S
@@ -24,6 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 
 #include "../common/threadasm.S"
 
+#if defined( __ppc__ ) || defined( __PPC__ ) || defined( __powerpc__ )
+
 /**
  * Performs a context switch.
  *
@@ -148,3 +150,5 @@ CSYM(_fiber_switchContext):
     blr
     .cfi_endproc
     .size CSYM(_fiber_switchContext),.-CSYM(_fiber_switchContext)
+
+#endif /* defined( __ppc__ ) || defined( __PPC__ ) || defined( __powerpc__ ) */
diff --git a/libphobos/libdruntime/config/powerpc64/callwithstack.S 
b/libphobos/libdruntime/config/powerpc64/callwithstack.S
index 4c5a31945a4..a85d9c4549d 100644
--- a/libphobos/libdruntime/config/powerpc64/callwithstack.S
+++ b/libphobos/libdruntime/config/powerpc64/callwithstack.S
@@ -24,6 +24,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 
 #include "../common/threadasm.S"
 
+#if defined( __PPC64__ )
+
 #if defined(_CALL_ELF) && _CALL_ELF == 2
 #define USE_ABI_2
 #define LINKAGE_SZ   32
@@ -166,3 +168,5 @@ _D4core6thread18callWithStackShellFNbMDFNbPvZvZv:
 .Lend:
     .size _D4core6thread18callWithStackShellFNbMDFNbPvZvZv, 
.Lend-.L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv
     .cfi_endproc
+
+#endif /* defined( __PPC64__ ) */
diff --git a/libphobos/m4/druntime/cpu.m4 b/libphobos/m4/druntime/cpu.m4
index 6e88896ca66..db3a92c15fa 100644
--- a/libphobos/m4/druntime/cpu.m4
+++ b/libphobos/m4/druntime/cpu.m4
@@ -17,12 +17,9 @@ AC_DEFUN([DRUNTIME_CPU_SOURCES],
                ;;
       mips*)   druntime_target_cpu_parsed="mips"
                ;;
-      powerpc|powerpcle)
+      powerpc*)
                druntime_target_cpu_parsed="powerpc"
                ;;
-      powerpc64|powerpc64le)
-               druntime_target_cpu_parsed="powerpc64"
-               ;;
       i[[34567]]86|x86_64)
                druntime_target_cpu_parsed="x86"
                ;;
@@ -41,8 +38,6 @@ AC_DEFUN([DRUNTIME_CPU_SOURCES],
                  [test "$druntime_target_cpu_parsed" = "mips"])
   AM_CONDITIONAL([DRUNTIME_CPU_POWERPC],
                  [test "$druntime_target_cpu_parsed" = "powerpc"])
-  AM_CONDITIONAL([DRUNTIME_CPU_POWERPC64],
-                 [test "$druntime_target_cpu_parsed" = "powerpc64"])
   AM_CONDITIONAL([DRUNTIME_CPU_X86],
                  [test "$druntime_target_cpu_parsed" = "x86"])
   AM_CONDITIONAL([DRUNTIME_CPU_SYSTEMZ],
-- 
2.20.1

Reply via email to