diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0acb7ba..77687d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,6 +90,8 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
     set(WTF_CPU_S390X 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64")
     set(WTF_CPU_LOONGARCH64 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 4d6a72b..ed35b54 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -1289,6 +1289,7 @@ elseif (WTF_CPU_MIPS)
 elseif (WTF_CPU_SH4)
 elseif (WTF_CPU_X86)
 elseif (WTF_CPU_LOONGARCH64)
+elseif (WTF_CPU_RISCV64)
 elseif (WTF_CPU_X86_64)
     if (MSVC AND ENABLE_JIT)
         add_custom_command(
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 76f4262..338fddc 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -180,6 +180,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
@@ -712,6 +717,7 @@
     || CPU(MIPS64) \
     || CPU(PPC64) \
     || CPU(PPC64LE) \
+    || CPU(RISCV64) \
     || CPU(LOONGARCH64)
 #define USE_JSVALUE64 1
 #else
diff --git a/Source/WTF/wtf/dtoa/utils.h b/Source/WTF/wtf/dtoa/utils.h
index a90287d..b136162 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) || CPU(LOONGARCH64)
+#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(LOONGARCH64) || 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 45b6649..6e6acd1 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;
@@ -2069,7 +2074,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'} || "");
     }
 
