From 2493e718159bdee3a589234196ce177d37b1e649 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 24 Apr 2019 22:46:59 +0000 Subject: 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 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 --- libphobos/m4/druntime/cpu.m4 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'libphobos/m4') 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. -- cgit v1.1