summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commonlib/lz4_wrapper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commonlib/lz4_wrapper.c b/src/commonlib/lz4_wrapper.c
index 772f7918f4..93fa7e8e1d 100644
--- a/src/commonlib/lz4_wrapper.c
+++ b/src/commonlib/lz4_wrapper.c
@@ -63,6 +63,11 @@ static void LZ4_copy8(void *dst, const void *src)
: [src]"r"(src), [dst]"r"(dst)
: "memory" );
#endif
+#elif defined(__riscv__)
+ /* RISC-V implementations may trap on any unaligned access. */
+ int i;
+ for (i = 0; i < 8; i++)
+ ((uint8_t *)dst)[i] = ((uint8_t *)src)[i];
#else
*(uint64_t *)dst = *(const uint64_t *)src;
#endif