libatomic_ops: Add patch for RISC-V support.

This commit is contained in:
Shea Levy 2018-02-18 00:52:55 -05:00
parent 158cf6449c
commit a61fdebc25
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27
2 changed files with 44 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, autoconf, automake, libtool }:
{ stdenv, fetchurl, autoconf, automake, libtool, hostPlatform }:
stdenv.mkDerivation rec {
name = "libatomic_ops-${version}";
@ -12,6 +12,9 @@ stdenv.mkDerivation rec {
sha256 ="1rif2hjscq5mh639nsnjhb90c01gnmy1sbmj6x6hsn1xmpnj95r1";
};
# https://github.com/ivmai/libatomic_ops/pull/32
patches = if hostPlatform.isRiscV then [ ./riscv.patch ] else null;
nativeBuildInputs = stdenv.lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
preConfigure = stdenv.lib.optionalString stdenv.isCygwin ''

View file

@ -0,0 +1,40 @@
diff -Naur libatomic_ops-7.6.2-orig/src/atomic_ops/sysdeps/gcc/riscv.h libatomic_ops-7.6.2/src/atomic_ops/sysdeps/gcc/riscv.h
--- libatomic_ops-7.6.2-orig/src/atomic_ops/sysdeps/gcc/riscv.h 1969-12-31 19:00:00.000000000 -0500
+++ libatomic_ops-7.6.2/src/atomic_ops/sysdeps/gcc/riscv.h 2018-02-18 00:48:53.581721375 -0500
@@ -0,0 +1 @@
+#include "generic.h"
diff -Naur libatomic_ops-7.6.2-orig/src/atomic_ops.h libatomic_ops-7.6.2/src/atomic_ops.h
--- libatomic_ops-7.6.2-orig/src/atomic_ops.h 2017-12-24 03:31:12.000000000 -0500
+++ libatomic_ops-7.6.2/src/atomic_ops.h 2018-02-18 00:48:53.580721359 -0500
@@ -352,6 +352,9 @@
# if defined(__tile__)
# include "atomic_ops/sysdeps/gcc/tile.h"
# endif
+# if defined(__riscv)
+# include "atomic_ops/sysdeps/gcc/riscv.h"
+# endif
#endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
#if (defined(__IBMC__) || defined(__IBMCPP__)) && !defined(__GNUC__) \
diff -Naur libatomic_ops-7.6.2-orig/src/Makefile.am libatomic_ops-7.6.2/src/Makefile.am
--- libatomic_ops-7.6.2-orig/src/Makefile.am 2017-12-24 03:31:12.000000000 -0500
+++ libatomic_ops-7.6.2/src/Makefile.am 2018-02-18 00:48:53.579721342 -0500
@@ -92,6 +92,7 @@
atomic_ops/sysdeps/gcc/mips.h \
atomic_ops/sysdeps/gcc/nios2.h \
atomic_ops/sysdeps/gcc/powerpc.h \
+ atomic_ops/sysdeps/gcc/riscv.h \
atomic_ops/sysdeps/gcc/s390.h \
atomic_ops/sysdeps/gcc/sh.h \
atomic_ops/sysdeps/gcc/sparc.h \
diff -Naur libatomic_ops-7.6.2-orig/src/Makefile.in libatomic_ops-7.6.2/src/Makefile.in
--- libatomic_ops-7.6.2-orig/src/Makefile.in 2017-12-24 03:32:23.000000000 -0500
+++ libatomic_ops-7.6.2/src/Makefile.in 2018-02-18 00:49:14.005062121 -0500
@@ -446,6 +446,7 @@
atomic_ops/sysdeps/gcc/mips.h \
atomic_ops/sysdeps/gcc/nios2.h \
atomic_ops/sysdeps/gcc/powerpc.h \
+ atomic_ops/sysdeps/gcc/riscv.h \
atomic_ops/sysdeps/gcc/s390.h \
atomic_ops/sysdeps/gcc/sh.h \
atomic_ops/sysdeps/gcc/sparc.h \