[Buildroot] [PATCH 1/1] package/zstd: pass _GNU_SOURCE in CFLAGS

Fabrice Fontaine fontaine.fabrice at gmail.com
Sun Jun 12 20:09:04 UTC 2022


Fix the following build failure:

util.c: In function 'UTIL_utime':
util.c:173:27: error: 'stat_t' {aka 'const struct stat'} has no member named 'st_mtim'; did you mean 'st_mtime'?
  173 |     timebuf[1] = statbuf->st_mtim;
      |                           ^~~~~~~
      |                           st_mtime

Fixes:
 - http://autobuild.buildroot.org/results/dd944a3bd4ac0c94b2bec8ac209100daaf43903d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 package/zstd/zstd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
index e8f6315222..75eb6ecc07 100644
--- a/package/zstd/zstd.mk
+++ b/package/zstd/zstd.mk
@@ -36,7 +36,7 @@ ZSTD_OPTS += HAVE_LZ4=0
 endif
 
 # zstd will append -O3 after $(CFLAGS), use MOREFLAGS to override again
-ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION)"
+ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION) -D_GNU_SOURCE"
 
 ZSTD_BUILD_LIBS_BASENAMES = libzstd.pc
 ifeq ($(BR2_STATIC_LIBS),y)
-- 
2.35.1




More information about the buildroot mailing list