libsodium: fix building with GCC 15.1
authorLovin Yarn <[email protected]>
Wed, 30 Jul 2025 11:56:13 +0000 (19:56 +0800)
committerJosef Schlehofer <[email protected]>
Wed, 30 Jul 2025 12:32:40 +0000 (14:32 +0200)
Force the default C version to -std=gnu17,

to fix the following build error:

<command-line>: error: unknown type name 'thread_local'; did you mean 'pthread_rwlock_t'?
randombytes/internal/randombytes_internal_random.c:132:8: note: in expansion of macro 'TLS'
  132 | static TLS InternalRandom stream = {
      |        ^~~
randombytes/internal/randombytes_internal_random.c:132:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'stream'
  132 | static TLS InternalRandom stream = {
      |                           ^~~~~~

[1] https://github.com/openwrt/openwrt/pull/16522#issuecomment-3134756935
[2] https://github.com/openwrt/packages/issues/27122

Tested-by: Georgi Valkov <[email protected]>
Signed-off-by: Lovin Yarn <[email protected]>
libs/libsodium/Makefile

index 9c207f89b4e39f71289052a7496de1e00879a54c..568c59ab848272d1e114e4dc70458e629af482c0 100644 (file)
@@ -55,6 +55,8 @@ menu "Configuration"
 endmenu
 endef
 
+TARGET_CFLAGS += -std=gnu17
+
 CONFIGURE_ARGS+= \
        --disable-ssp \
        $(if $(CONFIG_LIBSODIUM_MINIMAL),--enable,--disable)-minimal