From: Iain Buclaw Date: Tue, 28 Apr 2020 19:42:41 +0000 (+0200) Subject: libphobos: Fix multilib powerpc64 builds X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b53086ab6a6d0e89d407398c3a126535989f0c1;p=gcc.git libphobos: Fix multilib powerpc64 builds 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. libphobos/ChangeLog: PR d/94825 * configure: Regenerate. * libdruntime/Makefile.am (DRUNTIME_SOURCES_CONFIGURED): Add both switchcontext.S and callwithstack.S if DRUNTIME_CPU_POWERPC. * libdruntime/Makefile.in: Regenerate. * libdruntime/config/powerpc/switchcontext.S: Add !__PPC64__ 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. --- diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index cc5275112ba..a4e209d8615 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,15 @@ +2020-04-28 Iain Buclaw + + PR d/94825 + * configure: Regenerate. + * libdruntime/Makefile.am (DRUNTIME_SOURCES_CONFIGURED): Add both + switchcontext.S and callwithstack.S if DRUNTIME_CPU_POWERPC. + * libdruntime/Makefile.in: Regenerate. + * libdruntime/config/powerpc/switchcontext.S: Add !__PPC64__ 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. + 2020-04-27 Iain Buclaw * libdruntime/Makefile.am (DRUNTIME_DSOURCES_LINUX): Remove 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..e1dc24c660b 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/callwithstack.S \ + config/powerpc/switchcontext.S endif if DRUNTIME_CPU_X86 if DRUNTIME_OS_MINGW diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 53402842cb4..694de3e0b43 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/callwithstack.S \ +@DRUNTIME_CPU_POWERPC_TRUE@ config/powerpc/switchcontext.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-callwithstack.lo \ +@DRUNTIME_CPU_POWERPC_TRUE@ config/powerpc/libgdruntime_la-switchcontext.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-callwithstack.lo \ +@DRUNTIME_CPU_POWERPC_TRUE@ config/powerpc/libgdruntime_convenience_la-switchcontext.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 @@ -1749,13 +1748,10 @@ config/mips/libgdruntime_la-switchcontext.lo: \ config/powerpc/$(am__dirstamp): @$(MKDIR_P) config/powerpc @: > config/powerpc/$(am__dirstamp) +config/powerpc/libgdruntime_la-callwithstack.lo: \ + config/powerpc/$(am__dirstamp) config/powerpc/libgdruntime_la-switchcontext.lo: \ config/powerpc/$(am__dirstamp) -config/powerpc64/$(am__dirstamp): - @$(MKDIR_P) config/powerpc64 - @: > config/powerpc64/$(am__dirstamp) -config/powerpc64/libgdruntime_la-callwithstack.lo: \ - config/powerpc64/$(am__dirstamp) config/mingw/$(am__dirstamp): @$(MKDIR_P) config/mingw @: > config/mingw/$(am__dirstamp) @@ -1789,10 +1785,10 @@ config/arm/libgdruntime_convenience_la-switchcontext.lo: \ config/arm/$(am__dirstamp) config/mips/libgdruntime_convenience_la-switchcontext.lo: \ config/mips/$(am__dirstamp) +config/powerpc/libgdruntime_convenience_la-callwithstack.lo: \ + config/powerpc/$(am__dirstamp) config/powerpc/libgdruntime_convenience_la-switchcontext.lo: \ config/powerpc/$(am__dirstamp) -config/powerpc64/libgdruntime_convenience_la-callwithstack.lo: \ - config/powerpc64/$(am__dirstamp) config/mingw/libgdruntime_convenience_la-switchcontext.lo: \ config/mingw/$(am__dirstamp) config/x86/libgdruntime_convenience_la-switchcontext.lo: \ @@ -1817,8 +1813,6 @@ mostlyclean-compile: -rm -f config/mips/*.lo -rm -f config/powerpc/*.$(OBJEXT) -rm -f config/powerpc/*.lo - -rm -f config/powerpc64/*.$(OBJEXT) - -rm -f config/powerpc64/*.lo -rm -f config/s390/*.$(OBJEXT) -rm -f config/s390/*.lo -rm -f config/systemz/*.$(OBJEXT) @@ -1927,12 +1921,12 @@ config/arm/libgdruntime_la-switchcontext.lo: config/arm/switchcontext.S config/mips/libgdruntime_la-switchcontext.lo: config/mips/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mips/libgdruntime_la-switchcontext.lo `test -f 'config/mips/switchcontext.S' || echo '$(srcdir)/'`config/mips/switchcontext.S +config/powerpc/libgdruntime_la-callwithstack.lo: config/powerpc/callwithstack.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc/libgdruntime_la-callwithstack.lo `test -f 'config/powerpc/callwithstack.S' || echo '$(srcdir)/'`config/powerpc/callwithstack.S + config/powerpc/libgdruntime_la-switchcontext.lo: config/powerpc/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc/libgdruntime_la-switchcontext.lo `test -f 'config/powerpc/switchcontext.S' || echo '$(srcdir)/'`config/powerpc/switchcontext.S -config/powerpc64/libgdruntime_la-callwithstack.lo: config/powerpc64/callwithstack.S - $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc64/libgdruntime_la-callwithstack.lo `test -f 'config/powerpc64/callwithstack.S' || echo '$(srcdir)/'`config/powerpc64/callwithstack.S - config/mingw/libgdruntime_la-switchcontext.lo: config/mingw/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mingw/libgdruntime_la-switchcontext.lo `test -f 'config/mingw/switchcontext.S' || echo '$(srcdir)/'`config/mingw/switchcontext.S @@ -1954,12 +1948,12 @@ config/arm/libgdruntime_convenience_la-switchcontext.lo: config/arm/switchcontex config/mips/libgdruntime_convenience_la-switchcontext.lo: config/mips/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mips/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/mips/switchcontext.S' || echo '$(srcdir)/'`config/mips/switchcontext.S +config/powerpc/libgdruntime_convenience_la-callwithstack.lo: config/powerpc/callwithstack.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc/libgdruntime_convenience_la-callwithstack.lo `test -f 'config/powerpc/callwithstack.S' || echo '$(srcdir)/'`config/powerpc/callwithstack.S + config/powerpc/libgdruntime_convenience_la-switchcontext.lo: config/powerpc/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/powerpc/switchcontext.S' || echo '$(srcdir)/'`config/powerpc/switchcontext.S -config/powerpc64/libgdruntime_convenience_la-callwithstack.lo: config/powerpc64/callwithstack.S - $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/powerpc64/libgdruntime_convenience_la-callwithstack.lo `test -f 'config/powerpc64/callwithstack.S' || echo '$(srcdir)/'`config/powerpc64/callwithstack.S - config/mingw/libgdruntime_convenience_la-switchcontext.lo: config/mingw/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mingw/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/mingw/switchcontext.S' || echo '$(srcdir)/'`config/mingw/switchcontext.S @@ -1997,7 +1991,6 @@ clean-libtool: -rm -rf config/mingw/.libs config/mingw/_libs -rm -rf config/mips/.libs config/mips/_libs -rm -rf config/powerpc/.libs config/powerpc/_libs - -rm -rf config/powerpc64/.libs config/powerpc64/_libs -rm -rf config/s390/.libs config/s390/_libs -rm -rf config/systemz/.libs config/systemz/_libs -rm -rf config/x86/.libs config/x86/_libs @@ -2152,7 +2145,6 @@ distclean-generic: -rm -f config/mingw/$(am__dirstamp) -rm -f config/mips/$(am__dirstamp) -rm -f config/powerpc/$(am__dirstamp) - -rm -f config/powerpc64/$(am__dirstamp) -rm -f config/s390/$(am__dirstamp) -rm -f config/systemz/$(am__dirstamp) -rm -f config/x86/$(am__dirstamp) diff --git a/libphobos/libdruntime/config/powerpc/callwithstack.S b/libphobos/libdruntime/config/powerpc/callwithstack.S new file mode 100644 index 00000000000..0752c5d0322 --- /dev/null +++ b/libphobos/libdruntime/config/powerpc/callwithstack.S @@ -0,0 +1,172 @@ +/* PowerPC64 support code for fibers and multithreading. + Copyright (C) 2019-2020 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +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 +#define LR_OFS 16 +#define TOC_OFS 24 +#define GPR_OFS 32 +#define STACK_SZ (LINKAGE_SZ + 26*8) +#define OFS_R3_R10 GPR_OFS +#define OFS_R14_R31 (GPR_OFS+8*8) +#else +#define LINKAGE_SZ 48 +#define LR_OFS 16 +#define TOC_OFS 40 +#define GPR_OFS 112 +#define STACK_SZ (LINKAGE_SZ + 8*8 + 18*8) +#define OFS_R3_R10 (STACK_SZ+LINKAGE_SZ) +#define OFS_R14_R31 GPR_OFS +#endif + + .text +#if defined( USE_ABI_2 ) + .abiversion 2 +#endif + .globl _D4core6thread18callWithStackShellFNbMDFNbPvZvZv + .align 2 + .type _D4core6thread18callWithStackShellFNbMDFNbPvZvZv,@function +#if defined( USE_ABI_2 ) + .section .text._D4core6thread18callWithStackShellFNbMDFNbPvZvZv,"a",@progbits +#else + .section .opd,"aw",@progbits +#endif +_D4core6thread18callWithStackShellFNbMDFNbPvZvZv: +#if !defined( USE_ABI_2 ) + .align 3 + .quad .L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv + .quad .TOC.@tocbase + .quad 0 +#endif + .text +/* + * Called with: + * r3: pointer context + * r4: pointer to function + */ +.L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv: + .cfi_startproc + stdu 1, -STACK_SZ(1) + mflr 0 + std 0, LR_OFS(1) + .cfi_def_cfa_offset 256 + .cfi_offset lr, 16 + + /* Save r14-r31 in general register save area */ + std 14, (OFS_R14_R31 + 0 * 8)(1) + std 15, (OFS_R14_R31 + 1 * 8)(1) + std 16, (OFS_R14_R31 + 2 * 8)(1) + std 17, (OFS_R14_R31 + 3 * 8)(1) + std 18, (OFS_R14_R31 + 4 * 8)(1) + std 19, (OFS_R14_R31 + 5 * 8)(1) + std 20, (OFS_R14_R31 + 6 * 8)(1) + std 21, (OFS_R14_R31 + 7 * 8)(1) + std 22, (OFS_R14_R31 + 8 * 8)(1) + std 23, (OFS_R14_R31 + 9 * 8)(1) + std 24, (OFS_R14_R31 + 10 * 8)(1) + std 25, (OFS_R14_R31 + 11 * 8)(1) + std 26, (OFS_R14_R31 + 12 * 8)(1) + std 27, (OFS_R14_R31 + 13 * 8)(1) + std 28, (OFS_R14_R31 + 14 * 8)(1) + std 29, (OFS_R14_R31 + 15 * 8)(1) + std 30, (OFS_R14_R31 + 16 * 8)(1) + std 31, (OFS_R14_R31 + 17 * 8)(1) + + /* Save r3-r10 in parameter save area of caller */ + std 3, (OFS_R3_R10 + 0 * 8)(1) + std 4, (OFS_R3_R10 + 1 * 8)(1) + std 5, (OFS_R3_R10 + 2 * 8)(1) + std 6, (OFS_R3_R10 + 3 * 8)(1) + std 7, (OFS_R3_R10 + 4 * 8)(1) + std 8, (OFS_R3_R10 + 5 * 8)(1) + std 9, (OFS_R3_R10 + 6 * 8)(1) + std 10, (OFS_R3_R10 + 7 * 8)(1) + + /* Save r2 in TOC save area */ + std 2, TOC_OFS(1) + + /* Do not save r11, r12 and r13. */ + + /* Call delegate: + * r3: pointer to context + * r4: pointer to stack + */ + mr 5, 4 + mr 4, 1 + ld 6, 0(5) + ld 11, 16(5) + ld 2, 8(5) + mtctr 6 + bctrl + nop + + /* Restore r2 from TOC save area */ + ld 2, TOC_OFS(1) + + /* Restore r3-r10 from local variable space */ + ld 3, (OFS_R3_R10 + 0 * 8)(1) + ld 4, (OFS_R3_R10 + 1 * 8)(1) + ld 5, (OFS_R3_R10 + 2 * 8)(1) + ld 6, (OFS_R3_R10 + 3 * 8)(1) + ld 7, (OFS_R3_R10 + 4 * 8)(1) + ld 8, (OFS_R3_R10 + 5 * 8)(1) + ld 9, (OFS_R3_R10 + 6 * 8)(1) + ld 10, (OFS_R3_R10 + 7 * 8)(1) + + /* Restore r14-r31 from general register save area */ + ld 14, (OFS_R14_R31 + 0 * 8)(1) + ld 15, (OFS_R14_R31 + 1 * 8)(1) + ld 16, (OFS_R14_R31 + 2 * 8)(1) + ld 17, (OFS_R14_R31 + 3 * 8)(1) + ld 18, (OFS_R14_R31 + 4 * 8)(1) + ld 19, (OFS_R14_R31 + 5 * 8)(1) + ld 20, (OFS_R14_R31 + 6 * 8)(1) + ld 21, (OFS_R14_R31 + 7 * 8)(1) + ld 22, (OFS_R14_R31 + 8 * 8)(1) + ld 23, (OFS_R14_R31 + 9 * 8)(1) + ld 24, (OFS_R14_R31 + 10 * 8)(1) + ld 25, (OFS_R14_R31 + 11 * 8)(1) + ld 26, (OFS_R14_R31 + 12 * 8)(1) + ld 27, (OFS_R14_R31 + 13 * 8)(1) + ld 28, (OFS_R14_R31 + 14 * 8)(1) + ld 29, (OFS_R14_R31 + 15 * 8)(1) + ld 30, (OFS_R14_R31 + 16 * 8)(1) + ld 31, (OFS_R14_R31 + 17 * 8)(1) + + ld 0, LR_OFS(1) + mtlr 0 + addi 1, 1, STACK_SZ + blr + .long 0 + .quad 0 +.Lend: + .size _D4core6thread18callWithStackShellFNbMDFNbPvZvZv, .Lend-.L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv + .cfi_endproc + +#endif /* defined(__PPC64__) */ diff --git a/libphobos/libdruntime/config/powerpc/switchcontext.S b/libphobos/libdruntime/config/powerpc/switchcontext.S index 5470f9c4ca3..0a6cc243942 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(__PPC64__) + /** * Performs a context switch. * @@ -148,3 +150,5 @@ CSYM(_fiber_switchContext): blr .cfi_endproc .size CSYM(_fiber_switchContext),.-CSYM(_fiber_switchContext) + +#endif /* !defined(__PPC64__) */ diff --git a/libphobos/libdruntime/config/powerpc64/callwithstack.S b/libphobos/libdruntime/config/powerpc64/callwithstack.S deleted file mode 100644 index 4c5a31945a4..00000000000 --- a/libphobos/libdruntime/config/powerpc64/callwithstack.S +++ /dev/null @@ -1,168 +0,0 @@ -/* PowerPC64 support code for fibers and multithreading. - Copyright (C) 2019-2020 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -Under Section 7 of GPL version 3, you are granted additional -permissions described in the GCC Runtime Library Exception, version -3.1, as published by the Free Software Foundation. - -You should have received a copy of the GNU General Public License and -a copy of the GCC Runtime Library Exception along with this program; -see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -. */ - -#include "../common/threadasm.S" - -#if defined(_CALL_ELF) && _CALL_ELF == 2 -#define USE_ABI_2 -#define LINKAGE_SZ 32 -#define LR_OFS 16 -#define TOC_OFS 24 -#define GPR_OFS 32 -#define STACK_SZ (LINKAGE_SZ + 26*8) -#define OFS_R3_R10 GPR_OFS -#define OFS_R14_R31 (GPR_OFS+8*8) -#else -#define LINKAGE_SZ 48 -#define LR_OFS 16 -#define TOC_OFS 40 -#define GPR_OFS 112 -#define STACK_SZ (LINKAGE_SZ + 8*8 + 18*8) -#define OFS_R3_R10 (STACK_SZ+LINKAGE_SZ) -#define OFS_R14_R31 GPR_OFS -#endif - - .text -#if defined( USE_ABI_2 ) - .abiversion 2 -#endif - .globl _D4core6thread18callWithStackShellFNbMDFNbPvZvZv - .align 2 - .type _D4core6thread18callWithStackShellFNbMDFNbPvZvZv,@function -#if defined( USE_ABI_2 ) - .section .text._D4core6thread18callWithStackShellFNbMDFNbPvZvZv,"a",@progbits -#else - .section .opd,"aw",@progbits -#endif -_D4core6thread18callWithStackShellFNbMDFNbPvZvZv: -#if !defined( USE_ABI_2 ) - .align 3 - .quad .L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv - .quad .TOC.@tocbase - .quad 0 -#endif - .text -/* - * Called with: - * r3: pointer context - * r4: pointer to function - */ -.L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv: - .cfi_startproc - stdu 1, -STACK_SZ(1) - mflr 0 - std 0, LR_OFS(1) - .cfi_def_cfa_offset 256 - .cfi_offset lr, 16 - - /* Save r14-r31 in general register save area */ - std 14, (OFS_R14_R31 + 0 * 8)(1) - std 15, (OFS_R14_R31 + 1 * 8)(1) - std 16, (OFS_R14_R31 + 2 * 8)(1) - std 17, (OFS_R14_R31 + 3 * 8)(1) - std 18, (OFS_R14_R31 + 4 * 8)(1) - std 19, (OFS_R14_R31 + 5 * 8)(1) - std 20, (OFS_R14_R31 + 6 * 8)(1) - std 21, (OFS_R14_R31 + 7 * 8)(1) - std 22, (OFS_R14_R31 + 8 * 8)(1) - std 23, (OFS_R14_R31 + 9 * 8)(1) - std 24, (OFS_R14_R31 + 10 * 8)(1) - std 25, (OFS_R14_R31 + 11 * 8)(1) - std 26, (OFS_R14_R31 + 12 * 8)(1) - std 27, (OFS_R14_R31 + 13 * 8)(1) - std 28, (OFS_R14_R31 + 14 * 8)(1) - std 29, (OFS_R14_R31 + 15 * 8)(1) - std 30, (OFS_R14_R31 + 16 * 8)(1) - std 31, (OFS_R14_R31 + 17 * 8)(1) - - /* Save r3-r10 in parameter save area of caller */ - std 3, (OFS_R3_R10 + 0 * 8)(1) - std 4, (OFS_R3_R10 + 1 * 8)(1) - std 5, (OFS_R3_R10 + 2 * 8)(1) - std 6, (OFS_R3_R10 + 3 * 8)(1) - std 7, (OFS_R3_R10 + 4 * 8)(1) - std 8, (OFS_R3_R10 + 5 * 8)(1) - std 9, (OFS_R3_R10 + 6 * 8)(1) - std 10, (OFS_R3_R10 + 7 * 8)(1) - - /* Save r2 in TOC save area */ - std 2, TOC_OFS(1) - - /* Do not save r11, r12 and r13. */ - - /* Call delegate: - * r3: pointer to context - * r4: pointer to stack - */ - mr 5, 4 - mr 4, 1 - ld 6, 0(5) - ld 11, 16(5) - ld 2, 8(5) - mtctr 6 - bctrl - nop - - /* Restore r2 from TOC save area */ - ld 2, TOC_OFS(1) - - /* Restore r3-r10 from local variable space */ - ld 3, (OFS_R3_R10 + 0 * 8)(1) - ld 4, (OFS_R3_R10 + 1 * 8)(1) - ld 5, (OFS_R3_R10 + 2 * 8)(1) - ld 6, (OFS_R3_R10 + 3 * 8)(1) - ld 7, (OFS_R3_R10 + 4 * 8)(1) - ld 8, (OFS_R3_R10 + 5 * 8)(1) - ld 9, (OFS_R3_R10 + 6 * 8)(1) - ld 10, (OFS_R3_R10 + 7 * 8)(1) - - /* Restore r14-r31 from general register save area */ - ld 14, (OFS_R14_R31 + 0 * 8)(1) - ld 15, (OFS_R14_R31 + 1 * 8)(1) - ld 16, (OFS_R14_R31 + 2 * 8)(1) - ld 17, (OFS_R14_R31 + 3 * 8)(1) - ld 18, (OFS_R14_R31 + 4 * 8)(1) - ld 19, (OFS_R14_R31 + 5 * 8)(1) - ld 20, (OFS_R14_R31 + 6 * 8)(1) - ld 21, (OFS_R14_R31 + 7 * 8)(1) - ld 22, (OFS_R14_R31 + 8 * 8)(1) - ld 23, (OFS_R14_R31 + 9 * 8)(1) - ld 24, (OFS_R14_R31 + 10 * 8)(1) - ld 25, (OFS_R14_R31 + 11 * 8)(1) - ld 26, (OFS_R14_R31 + 12 * 8)(1) - ld 27, (OFS_R14_R31 + 13 * 8)(1) - ld 28, (OFS_R14_R31 + 14 * 8)(1) - ld 29, (OFS_R14_R31 + 15 * 8)(1) - ld 30, (OFS_R14_R31 + 16 * 8)(1) - ld 31, (OFS_R14_R31 + 17 * 8)(1) - - ld 0, LR_OFS(1) - mtlr 0 - addi 1, 1, STACK_SZ - blr - .long 0 - .quad 0 -.Lend: - .size _D4core6thread18callWithStackShellFNbMDFNbPvZvZv, .Lend-.L._D4core6thread18callWithStackShellFNbMDFNbPvZvZv - .cfi_endproc 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],