[Buildroot] [git commit branch/2021.02.x] package/zip: fix musl static build

Peter Korsgaard peter at korsgaard.com
Mon Sep 13 17:28:32 UTC 2021


commit: https://git.buildroot.net/buildroot/commit/?id=f5041927886351328f2fd46bfabb6d660c1ebcf4
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2021.02.x

Fix the following static build failure on musl which is raised because
the "Check for directory libraries" in configure wrongly adds -DNO_DIR
when no directory library is needed:

/tmp/instance-0/output-1/host/bin/arm-buildroot-linux-musleabihf-gcc -c -D_FILE_OFFSET_BITS=64 -O2 -g0 -static -I. -DUNIX -DUIDGID_NOT_16BIT -DBZIP2_SUPPORT -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DNO_MKTIME -DNO_DIR -DHAVE_DIRENT_H -DHAVE_TERMIOS_H unix/unix.c
unix/unix.c:70:14: error: conflicting types for 'DIR'
   70 | typedef FILE DIR;
      |              ^~~

Fixes:
 - http://autobuild.buildroot.org/results/83a6e0c8c4ad026cb0261246e3b1a80d754454bd

Patch not sent upstream since upstream is dead.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
(cherry picked from commit ea0a4c610d8fa6dac3b4a6eadbc0ce5c18223845)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/zip/0008-fix-musl-static-build.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/zip/0008-fix-musl-static-build.patch b/package/zip/0008-fix-musl-static-build.patch
new file mode 100644
index 0000000000..a7a31eba9e
--- /dev/null
+++ b/package/zip/0008-fix-musl-static-build.patch
@@ -0,0 +1,20 @@
+fix musl static build
+
+Don't define NO_DIR if no directory library is needed
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
+
+diff -Nura zip30.orig/unix/configure zip30/unix/configure
+--- zip30.orig/unix/configure	2021-08-31 21:29:55.219967136 +0200
++++ zip30/unix/configure	2021-08-31 21:50:48.239280513 +0200
+@@ -569,8 +569,8 @@
+   done
+   if [ ${OPT} ]; then
+     LFLAGS2="${LFLAGS2} ${OPT}"
+-  else
+-    CFLAGS="${CFLAGS} -DNO_DIR"
++  #else
++  #  CFLAGS="${CFLAGS} -DNO_DIR"
+   fi
+ fi
+ 


More information about the buildroot mailing list