From c507fd6b8d8ab4902a512c211e1e428ba626b7a2 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Mon, 6 Apr 2026 13:54:34 +0800 Subject: [PATCH] Fix brotli build on loong64 --- src/third_party/brotli/common/platform.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/third_party/brotli/common/platform.h b/src/third_party/brotli/common/platform.h index b59f9b8091..d989afb077 100644 --- a/src/third_party/brotli/common/platform.h +++ b/src/third_party/brotli/common/platform.h @@ -665,13 +665,18 @@ BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) { #undef BROTLI_TEST #endif -#if BROTLI_GNUC_HAS_ATTRIBUTE(model, 3, 0, 3) +#if defined(__ia64__) || defined(_M_IA64) +#define BROTLI_TARGET_IA64 +#endif + +#if !defined(BROTLI_MODEL) && BROTLI_GNUC_HAS_ATTRIBUTE(model, 3, 0, 3) && \ + !defined(BROTLI_TARGET_IA64) && !defined(BROTLI_TARGET_LOONGARCH64) #define BROTLI_MODEL(M) __attribute__((model(M))) #else #define BROTLI_MODEL(M) /* M */ #endif -#if BROTLI_GNUC_HAS_ATTRIBUTE(cold, 4, 3, 0) +#if !defined(BROTLI_COLD) && BROTLI_GNUC_HAS_ATTRIBUTE(cold, 4, 3, 0) #define BROTLI_COLD __attribute__((cold)) #else #define BROTLI_COLD /* cold */