Enable riscv64

Untested.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2023-03-22 16:24:17 +02:00
parent 257d17f491
commit b151e02215
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 18 additions and 1 deletions

View File

@ -2,13 +2,14 @@
Name: Random123
Version: 1.14.0
Release: 5%{?dist}
Release: 5.0.riscv64%{?dist}
Summary: Library of random number generators
License: BSD
URL: https://github.com/DEShawResearch/random123/
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-add-missing-headers.patch
Patch9: enable-riscv.patch
# gccfeatures.h mentions what arches are supported
# these aren't on the list
@ -80,6 +81,9 @@ popd
%doc examples
%changelog
* Wed Mar 22 2023 David Abdurachmanov <davidlt@rivosinc.com> - 1.14.0-5.0.riscv64
- Enable riscv64
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.14.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

13
enable-riscv.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/include/Random123/features/gccfeatures.h b/include/Random123/features/gccfeatures.h
index 51c46aa..00e27b4 100644
--- a/include/Random123/features/gccfeatures.h
+++ b/include/Random123/features/gccfeatures.h
@@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define R123_GNUC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-#if !defined(__x86_64__) && !defined(__i386__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__aarch64__) && !defined(__s390x__)
+#if !defined(__x86_64__) && !defined(__i386__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__aarch64__) && !defined(__s390x__) && !defined(__riscv)
# error "This code has only been tested on x86, powerpc and a few arm platforms."
#include <including_a_nonexistent_file_will_stop_some_compilers_from_continuing_with_a_hopeless_task>
{ /* maybe an unbalanced brace will terminate the compilation */