Message ID | 20200322033615.285409-1-rosenp@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [OpenWrt-Devel,RFT] toolchain/musl: update to 1.2.0 | expand |
Rosen Penev wrote at Sat Mar 21 20:36:15 PDT 2020: > Remove GLOB_ONLYDIR patch. Does not seem to be needed. > ... > The GLOB_ONLYDIR macro is only needed for fstools, which should be fixed there. Which of those conflicting statements is true? "GLOB_ONLYDIR does not seem to be needed" or "The GLOB_ONLYDIR macro is only needed for fstools" so this patch would in effect break fstools unless it is modified ??? The first one is in the proposed commit message, while the second is in the comments section. Grepping the source directories of my normal build for wrt3200acm I think that fstools still needs it: perus@ub1910:/Openwrt/wrt3200/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi$ grep -r GLOB_ONLYDIR . ... /fstools-2020-01-21-deb745f8/libfstools/overlay.c: if (!glob(globdir, GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl)) (My own build has also some other packages that seem to to have GLOB_ONLYDIR in their source, but both nano and gnulib in gdb define it by themselves.) I would be cautious in removing the patch with just "Does not seem to be needed" unless the need is really evaluated with all feeds. In any case, great to see a patch for musl 1.2.0 version bump. Would be good to have that in before the next release branching. ps. The commit message has misspelled "woresize.h". Btw, how did you evaluate that wordsize.h is not needed any more?
On Sun, Mar 22, 2020 at 2:25 AM Hannu Nyman <hannu.nyman@welho.com> wrote: > > Rosen Penev wrote at Sat Mar 21 20:36:15 PDT 2020: > > > Remove GLOB_ONLYDIR patch. Does not seem to be needed. > > ... > > The GLOB_ONLYDIR macro is only needed for fstools, which should be fixed > there. > > > Which of those conflicting statements is true? Probably both. I did not test absolutely every package. Some fail to compile, even on the buildbots. That's before this patch btw. I also made the latter comment after compiling most of the packages feed. > > "GLOB_ONLYDIR does not seem to be needed" or > "The GLOB_ONLYDIR macro is only needed for fstools" so this patch would in > effect break fstools unless it is modified ??? > > The first one is in the proposed commit message, while the second is in the > comments section. > > > Grepping the source directories of my normal build for wrt3200acm I think > that fstools still needs it: I will submit a patch for fstools when I can. > > perus@ub1910:/Openwrt/wrt3200/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi$ > grep -r GLOB_ONLYDIR . > ... > /fstools-2020-01-21-deb745f8/libfstools/overlay.c: if (!glob(globdir, > GLOB_NOESCAPE | GLOB_MARK | GLOB_ONLYDIR, NULL, &gl)) > > > (My own build has also some other packages that seem to to have GLOB_ONLYDIR > in their source, but both nano and gnulib in gdb define it by themselves.) And that's exactly the proper behavior. fstools is bugged and must be patched. > > I would be cautious in removing the patch with just "Does not seem to be > needed" unless the need is really evaluated with all feeds. As stated above, packages that don't define this are bugged and must be patched. > > > In any case, great to see a patch for musl 1.2.0 version bump. > Would be good to have that in before the next release branching. > > > ps. The commit message has misspelled "woresize.h". Btw, how did you evaluate > that wordsize.h is not needed any more? I compiled most of the packages feed and base feeds. These includes are hacks to be honest. They shouldn't be here. Unfortunately, too many packages break without them currently. > >
diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index e1354f2635..f7756f6056 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -8,15 +8,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=musl -PKG_VERSION:=1.1.24 +PKG_VERSION:=1.2.0 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=ea9525c8bcf6170df59364c4bcd616de1acf8703 -PKG_MIRROR_HASH:=6975c45b9bfe586ac00dbfcd1b1a13ab110af0528028ab3dee03e23e2c0763e5 PKG_SOURCE_URL:=https://git.musl-libc.org/git/musl -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=f68308e7182300bf7d48fed740785db2d212216c41df1a6ed9a51d8a370f6120 LIBC_SO_VERSION:=$(PKG_VERSION) PATCH_DIR:=$(PATH_PREFIX)/patches diff --git a/toolchain/musl/include/bits/wordsize.h b/toolchain/musl/include/bits/wordsize.h deleted file mode 100644 index 2d4cbe8317..0000000000 --- a/toolchain/musl/include/bits/wordsize.h +++ /dev/null @@ -1 +0,0 @@ -#include <sys/user.h> diff --git a/toolchain/musl/include/features.h b/toolchain/musl/include/features.h index edb8cc72d4..e801e2299a 100644 --- a/toolchain/musl/include/features.h +++ b/toolchain/musl/include/features.h @@ -1,10 +1,14 @@ #ifndef _FEATURES_H #define _FEATURES_H -#ifdef _ALL_SOURCE +#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) #define _GNU_SOURCE 1 #endif +#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) +#define _BSD_SOURCE 1 +#endif + #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) @@ -20,6 +24,8 @@ #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) #define __inline inline +#elif !defined(__GNUC__) +#define __inline #endif #if __STDC_VERSION__ >= 201112L @@ -29,6 +35,8 @@ #define _Noreturn #endif +#define __REDIR(x,y) __typeof__(x) x __asm__(#y) + /* Convenience macros to test the versions of glibc and gcc. Use them like this: #if __GNUC_PREREQ (2,8) diff --git a/toolchain/musl/patches/100-add_glob_onlydir.patch b/toolchain/musl/patches/100-add_glob_onlydir.patch deleted file mode 100644 index a784e770df..0000000000 --- a/toolchain/musl/patches/100-add_glob_onlydir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/glob.h -+++ b/include/glob.h -@@ -34,6 +34,8 @@ void globfree(glob_t *); - #define GLOB_TILDE 0x1000 - #define GLOB_TILDE_CHECK 0x4000 - -+#define GLOB_ONLYDIR 0x100 -+ - #define GLOB_NOSPACE 1 - #define GLOB_ABORTED 2 - #define GLOB_NOMATCH 3 diff --git a/toolchain/musl/patches/200-add_libssp_nonshared.patch b/toolchain/musl/patches/200-add_libssp_nonshared.patch index 05bd2fe54a..9a4de743be 100644 --- a/toolchain/musl/patches/200-add_libssp_nonshared.patch +++ b/toolchain/musl/patches/200-add_libssp_nonshared.patch @@ -16,7 +16,7 @@ Signed-off-by: Steven Barth <steven@midlink.org> ALL_TOOLS = obj/musl-gcc WRAPCC_GCC = gcc -@@ -86,7 +86,7 @@ else +@@ -87,7 +87,7 @@ else all: $(ALL_LIBS) $(ALL_TOOLS) @@ -25,7 +25,7 @@ Signed-off-by: Steven Barth <steven@midlink.org> $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS) -@@ -113,6 +113,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart. +@@ -114,6 +114,8 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart. obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC @@ -34,7 +34,7 @@ Signed-off-by: Steven Barth <steven@midlink.org> OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%)) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3 -@@ -165,6 +167,11 @@ lib/libc.a: $(AOBJS) +@@ -166,6 +168,11 @@ lib/libc.a: $(AOBJS) $(AR) rc $@ $(AOBJS) $(RANLIB) $@ diff --git a/toolchain/musl/patches/300-relative.patch b/toolchain/musl/patches/300-relative.patch index e34e60a09d..50041cac60 100644 --- a/toolchain/musl/patches/300-relative.patch +++ b/toolchain/musl/patches/300-relative.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc +@@ -216,7 +216,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc $(INSTALL) -D -m 644 $< $@ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
Remove PKG_SOURCE and PKG_SOURCE_SUBDIR since the defaults are used. Remove GLOB_ONLYDIR patch. Does not seem to be needed. Remove woresize.h file. It does not seem to be needed. Update features.h file from upstream. Needed for compilation of this version. Signed-off-by: Rosen Penev <rosenp@gmail.com> --- The GLOB_ONLYDIR macro is only needed for fstools, which should be fixed there. I compile tested this with the base and mostly the packages feed. toolchain/musl/common.mk | 8 +++----- toolchain/musl/include/bits/wordsize.h | 1 - toolchain/musl/include/features.h | 10 +++++++++- toolchain/musl/patches/100-add_glob_onlydir.patch | 11 ----------- toolchain/musl/patches/200-add_libssp_nonshared.patch | 6 +++--- toolchain/musl/patches/300-relative.patch | 2 +- 6 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 toolchain/musl/include/bits/wordsize.h delete mode 100644 toolchain/musl/patches/100-add_glob_onlydir.patch