Compare commits

...

12 Commits

Author SHA1 Message Date
David Abdurachmanov 0ecdc31d83
Add the missing backports for riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-03-30 12:40:05 +03:00
David Abdurachmanov 0a30062c3c
Add support for riscv64
Disable tests for riscv64 (there might be failure, to be tested).
Lower debuginfo verbosify for riscv64.
Incl. a number of upstream changes for detecting riscv64 and detecting
atomic support on riscv64.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-03-30 12:25:45 +03:00
David Abdurachmanov fd73a563f7
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-03-30 11:40:34 +03:00
David Abdurachmanov ca156e7f83
Ignore failures on RISC-V (riscv64)
Failing Tests (10):
    LLVM :: CodeGen/WebAssembly/immediates.ll
    LLVM :: ExecutionEngine/frem.ll
    LLVM :: ExecutionEngine/mov64zext32.ll
    LLVM :: ExecutionEngine/test-interp-vec-arithm_float.ll
    LLVM :: ExecutionEngine/test-interp-vec-arithm_int.ll
    LLVM :: ExecutionEngine/test-interp-vec-logical.ll
    LLVM :: ExecutionEngine/test-interp-vec-setcond-fp.ll
    LLVM :: ExecutionEngine/test-interp-vec-setcond-int.ll
    LLVM :: MC/AsmParser/include.ll
    LLVM :: MC/AsmParser/inline_macro_duplication.ll
  Expected Passes    : 31147
  Expected Failures  : 141
  Unsupported Tests  : 1256
  Unexpected Failures: 10

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-23 09:17:56 -07:00
David Abdurachmanov 56b8f2bd41
Remove BR for z3 and libxml2
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-22 21:32:26 -07:00
David Abdurachmanov 0d179cfb64
Add BR for z3 and libxml2; fix config.guess
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-22 21:00:24 -07:00
David Abdurachmanov 24ec007bf1
Mark package with .0.riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-22 20:09:00 -07:00
David Abdurachmanov 8124b5cac6
9.0.0-rc2 Release
Original commit:

5dee6b644a

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-22 20:08:10 -07:00
David Abdurachmanov 3109a5bb6e
Sync with llvm8.0 spec file
Original commit:

77699b4333

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-22 20:05:52 -07:00
David Abdurachmanov d359c22b89
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-08-22 19:53:57 -07:00
David Abdurachmanov c6efc8ed9c
Move RISCV to experimental targets
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-08-12 09:09:51 +03:00
David Abdurachmanov 50161d2f3c
Add support for RISC-V (riscv64)
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-08-12 08:28:59 +03:00
6 changed files with 201 additions and 4 deletions

View File

@ -0,0 +1,52 @@
From de1c2877a9ff12899ef50e179ade748fba8ab0c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lu=C3=ADs=20Marques?= <luismarques@lowrisc.org>
Date: Fri, 14 Feb 2020 11:49:18 +0000
Subject: [PATCH] llvm/cmake/config.guess: add support for riscv32 and riscv64
Summary: LLVM configuration fails with 'unable to guess system type' on riscv64.
Add support for detecting riscv32 and riscv64 systems.
Patch by Gokturk Yuksek (gokturk)
Reviewers: erichkeane, rengolin, mgorny, aaron.ballman, beanz, luismarques
Reviewed By: luismarques
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68899
---
llvm/cmake/config.guess | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/llvm/cmake/config.guess b/llvm/cmake/config.guess
index ccb30f4e75e8..26d120601e49 100644
--- a/llvm/cmake/config.guess
+++ b/llvm/cmake/config.guess
@@ -973,6 +973,30 @@ EOF
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ # Do not check for __GLIBC__ because uclibc defines it too
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+
+ # There is no features test macro for musl
+ # Follow the GNU's config.guess approach of
+ # checking the output of ldd
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;

View File

@ -0,0 +1,49 @@
From cef85193b2cc1817ca43199a0ae9c6f25723997d Mon Sep 17 00:00:00 2001
From: Gokturk Yuksek <gokturk@binghamton.edu>
Date: Mon, 17 Feb 2020 18:36:18 +0000
Subject: [PATCH] [CMake] CheckAtomic.cmake: catch false positives in RISC-V
The check for 'HAVE_CXX_ATOMICS_WITHOUT_LIB' may create false
positives in RISC-V. This is reproducible when compiling LLVM natively
using GCC on a rv64gc (rv64imafdgc) host. Due to the 'A' (atomic)
extension, g++ replaces calls to libatomic operations on the
std::atomic<int> type with the native hardware instructions. As a
result, the compilation succeeds and the build system thinks it
doesn't need to pass '-latomic'.
Improve the reliability of the 'HAVE_CXX_ATOMICS_WITHOUT_LIB' test in
two steps:
1. Force a pre-increment on x (++x), which should force a call to a
libatomic function;
2. Because step 1 would resolve the increment to 'amoadd.w.aq' under
the 'A' extension, force the same operation on sub-word types, for
which there is no hardware support.
Reviewers: jfb, hintonda, smeenai, mgorny, JDevlieghere, jyknight
Reviewed By: jfb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68964
---
llvm/cmake/modules/CheckAtomic.cmake | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake
index af925f5bf9ec..5d22a131e5cb 100644
--- a/llvm/cmake/modules/CheckAtomic.cmake
+++ b/llvm/cmake/modules/CheckAtomic.cmake
@@ -12,8 +12,12 @@ function(check_working_cxx_atomics varname)
CHECK_CXX_SOURCE_COMPILES("
#include <atomic>
std::atomic<int> x;
+std::atomic<short> y;
+std::atomic<char> z;
int main() {
- return x;
+ ++z;
+ ++y;
+ return ++x;
}
" ${varname})
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

View File

@ -0,0 +1,28 @@
From 09856feb3cc141f4f9c8b9edec28602ac4f21575 Mon Sep 17 00:00:00 2001
From: Gokturk Yuksek <gokturk@binghamton.edu>
Date: Mon, 17 Feb 2020 22:26:59 +0000
Subject: [PATCH] [dsymutil] Explicitly link against libatomic when necessary
In some systems, such as RISC-V, atomic support requires explicit linking
against '-latomic' (see https://github.com/riscv/riscv-gcc/issues/12).
Reviewers: davezarzycki, hhb, beanz, jfb, JDevlieghere
Reviewed By: beanz, JDevlieghere
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69003
---
llvm/tools/dsymutil/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/tools/dsymutil/CMakeLists.txt b/llvm/tools/dsymutil/CMakeLists.txt
index a6543c9ff2ce..dc31b86b2fc9 100644
--- a/llvm/tools/dsymutil/CMakeLists.txt
+++ b/llvm/tools/dsymutil/CMakeLists.txt
@@ -37,3 +37,7 @@ add_llvm_tool(dsymutil
if(APPLE)
target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation")
endif(APPLE)
+
+if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
+ target_link_libraries(dsymutil PRIVATE atomic)
+endif()

View File

@ -0,0 +1,32 @@
From d4a4a32cd94eccbaaa4608b0daac8b820e041214 Mon Sep 17 00:00:00 2001
From: Gokturk Yuksek <gokturk@binghamton.edu>
Date: Tue, 18 Feb 2020 07:52:29 +0000
Subject: [PATCH] [Support] Check for atomics64 when deciding if '-latomic' is
needed
The CheckAtomic module performs two tests to determine if passing
'-latomic' to the linker is required: one for 64-bit atomics, and
another for non-64-bit atomics. Include the missing check for 64-bit
atomics.
Reviewers: beanz, compnerd
Reviewed By: beanz, compnerd
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69444
---
llvm/lib/Support/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 26332d4f539c..41c5258d0b2b 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -26,7 +26,7 @@ elseif( CMAKE_HOST_UNIX )
set(system_libs ${system_libs} ${TERMINFO_LIBS})
endif()
endif()
- if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
+ if( LLVM_ENABLE_THREADS AND (HAVE_LIBATOMIC OR HAVE_CXX_LIBATOMICS64) )
set(system_libs ${system_libs} atomic)
endif()
set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})

View File

@ -0,0 +1,27 @@
From f128f442a3d23674bee19ae18e29f92c9dfe40cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lu=C3=ADs=20Marques?= <luismarques@lowrisc.org>
Date: Mon, 17 Feb 2020 15:21:41 +0000
Subject: [PATCH] [CMake] Fix setting result of libatomic check for MSVC
We were skipping the libatomic requirement check for MSVC, but not setting
the corresponding variable, HAVE_CXX_ATOMICS_WITHOUT_LIB. D69869 seems to
have to failed to build on ARM MSVC because of that, and was reverted. This
should probably fix the issue. The plan is to check the result of the build
bots and then submit a more thoroughly refactored version for review.
---
llvm/cmake/modules/CheckAtomic.cmake | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake
index 29f3bdd57f03..af925f5bf9ec 100644
--- a/llvm/cmake/modules/CheckAtomic.cmake
+++ b/llvm/cmake/modules/CheckAtomic.cmake
@@ -53,6 +53,8 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
endif()
endif()
+elseif(MSVC)
+ set(HAVE_CXX_ATOMICS_WITHOUT_LIB True)
endif()
# Check for 64 bit atomic operations.

View File

@ -40,7 +40,7 @@
Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}.0.riscv64%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@ -61,6 +61,12 @@ Source4: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
Patch0: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch1: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
Patch20: D68899-de1c2877a9ff12899ef50e179ade748fba8ab0c0.patch
Patch21: D69003-09856feb3cc141f4f9c8b9edec28602ac4f21575.patch
Patch22: D69444-d4a4a32cd94eccbaaa4608b0daac8b820e041214.patch
Patch23: f128f442a3d23674bee19ae18e29f92c9dfe40cd.patch
Patch24: D68964-cef85193b2cc1817ca43199a0ae9c6f25723997d.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
@ -170,7 +176,7 @@ pathfix.py -i %{__python3} -pn \
mkdir -p _build
cd _build
%ifarch s390 %{arm} %ix86
%ifarch s390 %{arm} %ix86 riscv64
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
@ -186,7 +192,7 @@ cd _build
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_RPATH=";" \
%ifarch s390 %{arm} %ix86
%ifarch s390 %{arm} %ix86 riscv64
-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
%endif
@ -367,7 +373,7 @@ rm -Rf %{build_install_prefix}/share/opt-viewer
%check
# TODO: Fix test failures on arm
ninja check-all -C _build || \
%ifarch %{arm}
%ifarch %{arm} riscv64
:
%else
false
@ -485,6 +491,9 @@ fi
%endif
%changelog
* Mon Mar 30 2020 David Abdurachmanov <david.abdurachmanov@sifive.com> - 10.0.0-1.0.riscv64
- Add support for riscv64
* Wed Mar 25 2020 sguelton@redhat.com - 10.0.0-1
- 10.0.0 final