From f12d80983f52c64dc67997e1111d78372755b5a6 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Wed, 23 Jan 2019 00:01:17 +0100 Subject: [PATCH] Enable D front-end and modify libphobos asserts The patch was suggestion from Iain Buclaw (D maintainer from GCC). Signed-off-by: David Abdurachmanov --- gcc.spec | 6 ++++-- libphobos-asserts.patch | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 libphobos-asserts.patch diff --git a/gcc.spec b/gcc.spec index b76990b..3fe2a0e 100644 --- a/gcc.spec +++ b/gcc.spec @@ -33,7 +33,7 @@ %else %global build_go 0 %endif -%ifarch %{ix86} x86_64 %{arm} %{mips} +%ifarch %{ix86} x86_64 %{arm} %{mips} riscv64 %global build_d 1 %else %global build_d 0 @@ -101,7 +101,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}.0.riscv64%{?dist} +Release: %{gcc_release}.davidlt.0%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -266,6 +266,7 @@ Patch17: gcc9-pr88905.patch Patch18: gcc9-pr88906.patch Patch30: libphobos-enable-riscv.patch +Patch31: libphobos-asserts.patch Patch1000: nvptx-tools-no-ptxas.patch Patch1001: nvptx-tools-build.patch @@ -853,6 +854,7 @@ to NVidia PTX capable devices if available. %patch18 -p0 -b .pr88906~ %patch30 -p1 -b .libphobos-riscv~ +%patch31 -p1 -b .libphobos-asserts~ cd nvptx-tools-%{nvptx_tools_gitrev} %patch1000 -p1 -b .nvptx-tools-no-ptxas~ diff --git a/libphobos-asserts.patch b/libphobos-asserts.patch new file mode 100644 index 0000000..e8fc9e0 --- /dev/null +++ b/libphobos-asserts.patch @@ -0,0 +1,31 @@ +diff --git a/libphobos/libdruntime/core/atomic.d b/libphobos/libdruntime/core/atomic.d +index 0b39cddb6..5a6c4b854 100644 +--- a/libphobos/libdruntime/core/atomic.d ++++ b/libphobos/libdruntime/core/atomic.d +@@ -1353,7 +1353,7 @@ else version (GNU) + + private bool casImpl(T,V1,V2)( shared(T)* here, V1 ifThis, V2 writeThis ) pure nothrow @nogc @trusted + { +- static assert(GNU_Have_Atomics, "cas() not supported on this architecture"); ++ static assert(GNU_Have_Atomics || GNU_Have_LibAtomic, "cas() not supported on this architecture"); + bool res = void; + + static if (T.sizeof == byte.sizeof) +@@ -1406,7 +1406,7 @@ else version (GNU) + { + static assert(ms != MemoryOrder.rel, "Invalid MemoryOrder for atomicLoad"); + static assert(__traits(isPOD, T), "argument to atomicLoad() must be POD"); +- static assert(GNU_Have_Atomics, "atomicLoad() not supported on this architecture"); ++ static assert(GNU_Have_Atomics || GNU_Have_LibAtomic, "atomicLoad() not supported on this architecture"); + + static if (T.sizeof == ubyte.sizeof) + { +@@ -1444,7 +1444,7 @@ else version (GNU) + { + static assert(ms != MemoryOrder.acq, "Invalid MemoryOrder for atomicStore"); + static assert(__traits(isPOD, T), "argument to atomicLoad() must be POD"); +- static assert(GNU_Have_Atomics, "atomicStore() not supported on this architecture"); ++ static assert(GNU_Have_Atomics || GNU_Have_LibAtomic, "atomicStore() not supported on this architecture"); + + static if (T.sizeof == ubyte.sizeof) + {