Compare commits

...

9 Commits

Author SHA1 Message Date
b6c69f862e
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-10 16:35:27 +03:00
e8b14126a4
Add BuildRequires for perl-*
Build fails at 96% because perl-File-Copy is not installed. It seems we don't
have BuildRequires: for perl packaegs that are being used at compile time by
a number of scripts.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-05 07:34:30 +03:00
dd54e11f2e
Set THREADS_PREFER_PTHREAD_FLAG to YES
We have to link to -pthread instead -lpthread to get libatomic linked
on riscv64.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-04 15:43:23 +03:00
5386a59033
Fix riscv64 patch
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-04 07:22:45 +03:00
e6bafb71a7
Remove LDFLAGS for riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-03 09:37:38 +03:00
180a31fdad
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2020-04-03 09:36:44 +03:00
cb4e1e4271
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-07-31 10:38:59 +03:00
d8c376dafb
Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2019-01-16 09:57:03 +01:00
fec684f07b
Add support for RISC-V (riscv64)
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-06-22 09:54:35 +02:00
2 changed files with 132 additions and 3 deletions

View File

@ -16,7 +16,7 @@
Name: qt5-%{qt_module}
Version: 5.212.0
Release: 0.43.%{?prerel}%{?dist}
Release: 0.43.%{?prerel}.0.riscv64%{?dist}
Summary: Qt5 - QtWebKit components
License: LGPLv2 and BSD
@ -27,6 +27,9 @@ Source0: https://github.com/qtwebkit/qtwebkit/releases/download/%{qt_modu
Patch2: qtwebkit-5.212.0_cmake_cmp0071.patch
Patch3: qtwebkit-missing-semicolons.patch
# Enable RISC-V (riscv64)
Patch10: qtwebkit-5.212.0-alpha3-add-riscv.patch
BuildRequires: bison
BuildRequires: cmake
BuildRequires: flex
@ -131,7 +134,7 @@ test -f Source/WebCore/Resources/textAreaResizeCorner.png
# Decrease debuginfo even on ix86 because of:
# https://bugs.webkit.org/show_bug.cgi?id=140176
%ifarch s390 s390x %{arm} %{ix86} ppc %{power64} %{mips}
%ifarch s390 s390x %{arm} %{ix86} ppc %{power64} %{mips} riscv64
# Decrease debuginfo verbosity to reduce memory consumption even more
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
@ -144,6 +147,7 @@ test -f Source/WebCore/Resources/textAreaResizeCorner.png
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:-%optflags} -fpermissive" ; export CXXFLAGS ;
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;}
# We cannot use default cmake macro here as it overwrites some settings queried
# by qtwebkit cmake from qmake
cmake -DPORT=Qt \
@ -152,12 +156,15 @@ cmake -DPORT=Qt \
-DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
%ifarch s390 s390x ppc %{power64}
%ifarch s390 s390x ppc %{power64} riscv64
-DENABLE_JIT=OFF \
%endif
%ifarch s390 s390x ppc %{power64}
-DUSE_SYSTEM_MALLOC=ON \
%endif
%ifarch riscv64
-DTHREADS_PREFER_PTHREAD_FLAG:BOOL=YES \
%endif
%if 0%{?docs}
-DGENERATE_DOCUMENTATION=ON \
%endif
@ -236,6 +243,9 @@ test -z "$(pkg-config --cflags Qt5WebKit | grep Qt5WebKit)"
%changelog
* Fri Apr 10 2020 David Abdurachmanov <david.abdurachmanov@sifive.com> - 5.212.0-0.43.alpha3.0.riscv64
- add support for RISC-V (riscv64)
* Sun Apr 05 2020 Rex Dieter <rdieter@fedoraproject.org> - 5.212.0-0.43.alpha3
- rebuild (qt5)

View File

@ -0,0 +1,119 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 156c468..1f3ae03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,6 +88,8 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390")
set(WTF_CPU_S390 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
set(WTF_CPU_S390X 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
+ set(WTF_CPU_RISCV64 1)
else ()
message(FATAL_ERROR "Unknown CPU '${LOWERCASE_CMAKE_SYSTEM_PROCESSOR}'")
endif ()
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 937b3ed..d5fb779 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -1288,6 +1288,7 @@ elseif (WTF_CPU_MIPS)
elseif (WTF_CPU_SH4)
elseif (WTF_CPU_X86)
elseif (WTF_CPU_X86_64)
+elseif (WTF_CPU_RISCV64)
if (MSVC AND ENABLE_JIT)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
diff --git a/Source/ThirdParty/brotli/dec/port.h b/Source/ThirdParty/brotli/dec/port.h
index 6b3d735..d1c8c14 100644
--- a/Source/ThirdParty/brotli/dec/port.h
+++ b/Source/ThirdParty/brotli/dec/port.h
@@ -56,10 +56,15 @@
#define BROTLI_TARGET_POWERPC64
#endif
+#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+#define BROTLI_TARGET_RISCV64
+#endif
+
#ifdef BROTLI_BUILD_PORTABLE
#define BROTLI_ALIGNED_READ (!!1)
#elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \
- defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8)
+ defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8) || \
+ defined(BROTLI_TARGET_RISCV64)
/* Allow unaligned read only for white-listed CPUs. */
#define BROTLI_ALIGNED_READ (!!0)
#else
@@ -96,7 +101,7 @@ static BROTLI_INLINE void BrotliDump(const char* f, int l, const char* fn) {
#elif defined(BROTLI_BUILD_32_BIT)
#define BROTLI_64_BITS 0
#elif defined(BROTLI_TARGET_X64) || defined(BROTLI_TARGET_ARMV8) || \
- defined(BROTLI_TARGET_POWERPC64)
+ defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64)
#define BROTLI_64_BITS 1
#else
#define BROTLI_64_BITS 0
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 5717f3e..7aefa1b 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -176,6 +176,11 @@
#define WTF_CPU_X86_SSE2 1
#endif
+/* CPU(RISCV64) - RISCV64 */
+#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+#define WTF_CPU_RISCV64 1
+#endif
+
/* CPU(ARM64) - Apple */
#if (defined(__arm64__) && defined(__APPLE__)) || defined(__aarch64__)
#define WTF_CPU_ARM64 1
@@ -707,7 +712,8 @@
|| CPU(S390X) \
|| CPU(MIPS64) \
|| CPU(PPC64) \
- || CPU(PPC64LE)
+ || CPU(PPC64LE) \
+ || CPU(RISCV64)
#define USE_JSVALUE64 1
#else
#define USE_JSVALUE32_64 1
diff --git a/Source/WTF/wtf/dtoa/utils.h b/Source/WTF/wtf/dtoa/utils.h
index 889642c..176d590 100644
--- a/Source/WTF/wtf/dtoa/utils.h
+++ b/Source/WTF/wtf/dtoa/utils.h
@@ -49,7 +49,7 @@
defined(__ARMEL__) || \
defined(_MIPS_ARCH_MIPS32R2)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
-#elif CPU(MIPS) || CPU(MIPS64) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA)
+#elif CPU(MIPS) || CPU(MIPS64) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA) || CPU(RISCV64)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(_M_IX86) || defined(__i386__)
#if defined(_WIN32)
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index 84b18c7..b64d9d1 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -1264,6 +1264,11 @@ sub isARM()
return ($Config{archname} =~ /^arm[v\-]/) || ($Config{archname} =~ /^aarch64[v\-]/);
}
+sub isRISCV()
+{
+ return ($Config{archname} =~ /^riscv(|32|64)\-/);
+}
+
sub isX86_64()
{
return (architecture() eq "x86_64") || 0;
@@ -2064,7 +2069,7 @@ sub generateBuildSystemFromCMakeProject
# Compiler options to keep floating point values consistent
# between 32-bit and 64-bit architectures.
determineArchitecture();
- if ($architecture ne "x86_64" && !isARM() && !isCrossCompilation() && !isAnyWindows()) {
+ if ($architecture ne "x86_64" && !isARM() && !isRISCV && !isCrossCompilation() && !isAnyWindows()) {
$ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse " . ($ENV{'CXXFLAGS'} || "");
}