From a937222006a6cb5b55b511a3244c4593924a0173 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 13 Jan 2026 23:00:25 +0100 Subject: [PATCH] Compatibility with gcc 4.x Reported by @pedro0311 Fixes #1507 --- ChangeLog | 2 +- src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c | 2 +- src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c | 2 +- src/libsodium/crypto_ipcrypt/ipcrypt_soft.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c562d54f..7cfeaa8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ JavaScript, not just WebAssembly. - Performance: SHA3 (Keccak1600) now leverages ARM SHA3 instructions when available on ARM platforms. - Export missing crypto_ipcrypt_nd_keygen() helper function. - - Fixed compilation with GCC on aarch64. + - Fixed compilation with GCC on aarch64 and gcc 4.1 - Libsodium can be directly used as a dependency in a Zig project. * Version 1.0.21 diff --git a/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c b/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c index e86081b3..c072d19b 100644 --- a/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c +++ b/src/libsodium/crypto_ipcrypt/ipcrypt_aesni.c @@ -308,7 +308,7 @@ pfx_set_bit(uint8_t ip16[16], const unsigned int bit_index, const uint8_t bit_va uint8_t mask = (uint8_t) -((bit_value & 1)); # if defined(__GNUC__) || defined(__clang__) - __asm__ __volatile__("" : "+r"(mask)::); + __asm__ __volatile__("" : "+r"(mask) :); # endif ip16[byte_index] = (ip16[byte_index] & ~bit_mask) | (bit_mask & mask); } diff --git a/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c b/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c index bad4ce38..53c65ce9 100644 --- a/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c +++ b/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c @@ -340,7 +340,7 @@ pfx_set_bit(uint8_t ip16[16], const unsigned int bit_index, const uint8_t bit_va uint8_t mask = (uint8_t) -((bit_value & 1)); # if defined(__GNUC__) || defined(__clang__) - __asm__ __volatile__("" : "+r"(mask)::); + __asm__ __volatile__("" : "+r"(mask) :); # endif ip16[byte_index] = (ip16[byte_index] & ~bit_mask) | (bit_mask & mask); } diff --git a/src/libsodium/crypto_ipcrypt/ipcrypt_soft.c b/src/libsodium/crypto_ipcrypt/ipcrypt_soft.c index 8f1fd8a8..3aa67370 100644 --- a/src/libsodium/crypto_ipcrypt/ipcrypt_soft.c +++ b/src/libsodium/crypto_ipcrypt/ipcrypt_soft.c @@ -284,7 +284,7 @@ pfx_set_bit(uint8_t ip16[16], const unsigned int bit_index, const uint8_t bit_va uint8_t mask = (uint8_t) -((bit_value & 1)); #if defined(__GNUC__) || defined(__clang__) - __asm__ __volatile__("" : "+r"(mask)::); + __asm__ __volatile__("" : "+r"(mask) :); #endif ip16[byte_index] = (ip16[byte_index] & ~bit_mask) | (bit_mask & mask); }