]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[riscv] Enable support for weak symbols 4114/head
authorAdenilson Cavalcanti <cavalcantii@chromium.org>
Tue, 6 Aug 2024 23:55:32 +0000 (16:55 -0700)
committerAdenilson Cavalcanti <cavalcantii@chromium.org>
Tue, 6 Aug 2024 23:55:32 +0000 (16:55 -0700)
Both gcc and clang support weak symbols on RISC-V, therefore
let's enable it.

This should fix issue #4069.

lib/common/zstd_trace.h

index da20534ebd8e171d4d9c3782b001bb23675b027f..173d63fb1bc1c0e74c940efcdf69311a81f65dd2 100644 (file)
@@ -21,13 +21,14 @@ extern "C" {
  * For now, enable conservatively:
  * - Only GNUC
  * - Only ELF
- * - Only x86-64, i386 and aarch64
+ * - Only x86-64, i386, aarch64 and risc-v.
  * Also, explicitly disable on platforms known not to work so they aren't
  * forgotten in the future.
  */
 #if !defined(ZSTD_HAVE_WEAK_SYMBOLS) && \
     defined(__GNUC__) && defined(__ELF__) && \
-    (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86) || defined(__aarch64__)) && \
+    (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \
+     defined(_M_IX86) || defined(__aarch64__) || defined(__riscv)) && \
     !defined(__APPLE__) && !defined(_WIN32) && !defined(__MINGW32__) && \
     !defined(__CYGWIN__) && !defined(_AIX)
 #  define ZSTD_HAVE_WEAK_SYMBOLS 1