aboutsummaryrefslogtreecommitdiff
path: root/libphobos/m4
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2019-04-24 22:46:59 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-04-24 22:46:59 +0000
commit2493e718159bdee3a589234196ce177d37b1e649 (patch)
tree1fcbbacd1e37224ecd98458ffb0021f4a4efbf5d /libphobos/m4
parent7c3e085e4405ef4148edf4ea5bedd7930df23c58 (diff)
downloadgcc-2493e718159bdee3a589234196ce177d37b1e649.zip
gcc-2493e718159bdee3a589234196ce177d37b1e649.tar.gz
gcc-2493e718159bdee3a589234196ce177d37b1e649.tar.bz2
libphobos: Fix linker warning and SEGV in core.thread tests.
The monolithic core/threadasm.S source has been removed, and split into multiple parts, one for each intended target CPU/OS. Added .type and .size directives for all asm implementations of fiber_switchContent and callWithStackShell where they were missing. libphobos/ChangeLog: 2019-04-25 Iain Buclaw <ibuclaw@gdcproject.org> PR d/90086 * m4/druntime/cpu.m4 (DRUNTIME_CPU_SOURCES): New macro. * configure.ac: Use it. * configure: Regenerate. * libdruntime/Makefile.am: Add new config sources to DRUNTIME_SOURCES_CONFIGURED. * libdruntime/Makefile.in: Regenerate. * libdruntime/config/aarch64/switchcontext.S: New file. * libdruntime/config/arm/switchcontext.S: New file. * libdruntime/config/common/threadasm.S: New file. * libdruntime/config/mingw/switchcontext.S: New file. * libdruntime/config/mips/switchcontext.S: New file. * libdruntime/config/powerpc/switchcontext.S: New file. * libdruntime/config/powerpc64/callwithstack.S: New file. * libdruntime/config/x86/switchcontext.S: New file. * libdruntime/core/threadasm.S: Remove. From-SVN: r270560
Diffstat (limited to 'libphobos/m4')
-rw-r--r--libphobos/m4/druntime/cpu.m438
1 files changed, 38 insertions, 0 deletions
diff --git a/libphobos/m4/druntime/cpu.m4 b/libphobos/m4/druntime/cpu.m4
index 7f7b138..4795eda 100644
--- a/libphobos/m4/druntime/cpu.m4
+++ b/libphobos/m4/druntime/cpu.m4
@@ -3,6 +3,44 @@
#
+# DRUNTIME_CPU_SOURCES
+# -------------------
+# Detect target CPU and add DRUNTIME_CPU_XXX conditionals.
+AC_DEFUN([DRUNTIME_CPU_SOURCES],
+[
+ druntime_target_cpu_parsed=""
+ case "$target_cpu" in
+ aarch64*)
+ druntime_target_cpu_parsed="aarch64"
+ ;;
+ arm*) druntime_target_cpu_parsed="arm"
+ ;;
+ mips*) druntime_target_cpu_parsed="mips"
+ ;;
+ powerpc) druntime_target_cpu_parsed="powerpc"
+ ;;
+ powerpc64)
+ druntime_target_cpu_parsed="powerpc64"
+ ;;
+ i[34567]86|x86_64)
+ druntime_target_cpu_parsed="x86"
+ ;;
+ esac
+ AM_CONDITIONAL([DRUNTIME_CPU_AARCH64],
+ [test "$druntime_target_cpu_parsed" = "aarch64"])
+ AM_CONDITIONAL([DRUNTIME_CPU_ARM],
+ [test "$druntime_target_cpu_parsed" = "arm"])
+ AM_CONDITIONAL([DRUNTIME_CPU_MIPS],
+ [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"])
+])
+
+
# DRUNTIME_ENABLE_ATOMIC_BUILTINS
# -------------------------
# Check support for atomic builtins up to 64 bit.