package/zstd: fix build failure on Microblaze
PATCH 1/1 package/zstd: fix build failure on Microblaze
Building for Microblaze leads to error:
```
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
```Let's define _POSIX_C_SOURCE=199309L to make st_mtim struct member visible again. Let's do this by using the already present MOREFLAGS variable since CFLAGS gets overridden through zstd configuration.
Fixes:
http://autobuild.buildroot.net/results/aba/abaf20f73303bf7dfde7983f32b36d43db897ced/
--- package/zstd/zstd.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
package/zstd/zstd.mk +6 -1
@@ -36,7 +36,12 @@ ZSTD_OPTS += HAVE_LZ4=0 endif # zstd will append -O3 after $(CFLAGS), use MOREFLAGS to override again -ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION)" +ZSTD_MOREFLAGS = $(TARGET_OPTIMIZATION) + +# with glibc 'struct stat's member 'st_mtim' requires _POSIX_C_SOURCE=199309L +ZSTD_MOREFLAGS += -D_POSIX_C_SOURCE=199309L + +ZSTD_OPTS += MOREFLAGS="$(ZSTD_MOREFLAGS)" ZSTD_BUILD_LIBS_BASENAMES = libzstd.pc ifeq ($(BR2_STATIC_LIBS),y)
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Ah, I've found only now Arnout's patch for this:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Please drop it.
Sorry for the noise
Signature · 2 lines
Giulio Benetti Benetti Engineering sas
Quoted 28 lines · Giulio Benetti
Building for Microblaze leads to error:
``` 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 ```Let's define _POSIX_C_SOURCE=199309L to make
st_mtimstruct member visible again. Let's do this by using the already present MOREFLAGS variable since CFLAGS gets overridden through zstd configuration.Fixes:
http://autobuild.buildroot.net/results/aba/abaf20f73303bf7dfde7983f32b36d43db897ced/Signed-off-by Giulio Benetti <[email protected]>--- package/zstd/zstd.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)package/zstd/zstd.mk +0
-0@@ -36,7 +36,12 @@ ZSTD_OPTS += HAVE_LZ4=0 endif # zstd will append -O3 after $(CFLAGS), use MOREFLAGS to override again
package/zstd/zstd.mk ZSTD_OPTS += HAVE_LZ4=0 · line 47
Quoted 10 lines
package/zstd/zstd.mk +6
-1-ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION)" +ZSTD_MOREFLAGS = $(TARGET_OPTIMIZATION) + +# with glibc 'struct stat's member 'st_mtim' requires _POSIX_C_SOURCE=199309L +ZSTD_MOREFLAGS += -D_POSIX_C_SOURCE=199309L + +ZSTD_OPTS += MOREFLAGS="$(ZSTD_MOREFLAGS)" ZSTD_BUILD_LIBS_BASENAMES = libzstd.pc ifeq ($(BR2_STATIC_LIBS),y)
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot