From bd35a5fa6e685d97ca92fed6c521f4d3d0a7fa25 Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 20 Nov 2023 11:00:27 +0800 Subject: [PATCH 1/3] build: Add paths.h to the build to fit busybox Signed-off-by: shy --- Makefile.uk.musl.stdio | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.uk.musl.stdio b/Makefile.uk.musl.stdio index b8cb2d5..ce006c6 100644 --- a/Makefile.uk.musl.stdio +++ b/Makefile.uk.musl.stdio @@ -30,6 +30,7 @@ LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/sys/uio.h LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/unistd.h LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/wchar.h LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/wctype.h +LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/paths.h LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/asprintf.c -- Gitee From 0ced8c8e14ffdbc5fa4c19cb379afb456789a321 Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 26 Dec 2023 15:51:15 +0800 Subject: [PATCH 2/3] build: Add ar.h to the build to fit busybox customcmd elfloader Signed-off-by: shy --- Makefile.uk.musl.stdio | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.uk.musl.stdio b/Makefile.uk.musl.stdio index ce006c6..5d4be43 100644 --- a/Makefile.uk.musl.stdio +++ b/Makefile.uk.musl.stdio @@ -31,6 +31,7 @@ LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/unistd.h LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/wchar.h LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/wctype.h LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/paths.h +LIBMUSL_STDIO_HDRS-y += $(LIBMUSL)/include/ar.h LIBMUSL_STDIO_SRCS-y += $(LIBMUSL)/src/stdio/asprintf.c -- Gitee From e63c1e7ac7689683a30409a8dca5f4ce10b72bbc Mon Sep 17 00:00:00 2001 From: wangguokun Date: Fri, 19 Jul 2024 12:05:34 +0800 Subject: [PATCH 3/3] lib/musl: remove unconditional download of source code during build process Signed-off-by: wangguokun --- Makefile.rules | 2 ++ Makefile.uk | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile.rules b/Makefile.rules index c3b36d5..24fd5e8 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -8,6 +8,7 @@ # @param $(3) # The source files for this sub-library. # +ifeq ($(CONFIG_LIBMUSL), y) define _libmusl_import_lib $(LIBMUSL_BUILD)/include/$(1): $(call verbose_cmd,MKDIR,libmusl: $(subst $(LIBMUSL_BUILD),,$(1)): $(notdir $$@), mkdir -p $$@) @@ -33,3 +34,4 @@ CXXINCLUDES-$(CONFIG_LIBMUSL) += -I$(LIBMUSL_BUILD)/include/$(1)/include # Append the sub library directory to the include path $(LIBMUSL_BUILD)/.prepared: $(subst $(LIBMUSL),$(LIBMUSL_BUILD)/include/$(1),$(2)) endef +endif diff --git a/Makefile.uk b/Makefile.uk index 0d6e0e0..0c863bf 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -54,6 +54,7 @@ endif ################################################################################ # Library registration ################################################################################ + $(eval $(call addlib_s,libmusl,$(CONFIG_LIBMUSL))) # Additionally, build glue code. This is put into a separate library so that we @@ -67,16 +68,20 @@ $(eval $(call addlib_s,libmuslglue,$(CONFIG_LIBMUSL))) LIBMUSL_VERSION=1.2.3 LIBMUSL_URL=https://gitee.com/tenonos-mirror/fork-musl.git LIBMUSL_PATCHDIR=$(LIBMUSL_BASE)/patches +ifeq ($(CONFIG_LIBMUSL),y) $(eval $(call clone,libmusl,$(LIBMUSL_URL),v$(LIBMUSL_VERSION))) $(eval $(call patch,libmusl,$(LIBMUSL_PATCHDIR),.)) - +endif ################################################################################ # Helpers ################################################################################ LIBMUSL=$(LIBMUSL_ORIGIN)/ # Additional macros for musl sub-libraries + +ifeq ($(CONFIG_LIBMUSL),y) include $(LIBMUSL_BASE)/Makefile.rules +endif ################################################################################ # Library includes @@ -104,6 +109,7 @@ CXXINCLUDES-$(CONFIG_LIBMUSL) += $(LIBMUSL_GLOBAL_INCLUDES-y) # Musl-specific Targets ################################################################################ # generate alltypes.h through musl sed script +ifeq ($(CONFIG_LIBMUSL),y) $(LIBMUSL)/arch/$(MUSL_ARCH)/bits/alltypes.h: $(LIBMUSL_BUILD)/.patched $(call verbose_cmd,CONFIGURE,libmusl: $(notdir $@),\ sed -f $(LIBMUSL)/tools/mkalltypes.sed \ @@ -121,6 +127,8 @@ UK_PREPARE += $(LIBMUSL)/arch/$(MUSL_ARCH)/bits/alltypes.h UK_PREPARE += $(LIBMUSL)/src/internal/version.h UK_PREPARE += $(LIBMUSL_BUILD)/.prepared +endif + LIBMUSL_CLEAN += $(LIBMUSL)/arch/$(MUSL_ARCH)/bits/alltypes.h LIBMUSL_CLEAN += $(LIBMUSL)/src/internal/version.h @@ -189,7 +197,9 @@ LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/features.h LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/assert.h LIBMUSL_CORE_HDRS-y += $(LIBMUSL)/include/sysexits.h +ifeq ($(CONFIG_LIBMUSL),y) $(eval $(call _libmusl_import_lib,core,$(LIBMUSL_CORE_HDRS-y),$(LIBMUSL_CORE_SRCS-y))) +endif ################################################################################ # musl code -- one external Makefile per sub-lib -- Gitee