From jcmvbkbc at gmail.com Wed Apr 24 11:36:23 2024 From: jcmvbkbc at gmail.com (Max Filippov) Date: Wed, 24 Apr 2024 04:36:23 -0700 Subject: [PATCH] fix out-of-tree build with UCLIBC_HAS_CONTEXT_FUNCS Message-ID: <20240424113623.2382975-1-jcmvbkbc@gmail.com> When building libc out-of-tree *context functions cannot find generated header ucontext_i.h: libc/sysdeps/linux/xtensa/setcontext.S:19:10: fatal error: ucontext_i.h: No such file or directory Fix that by adding include path to the build directory with that file to the compiler flags. Signed-off-by: Max Filippov --- Rules.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/Rules.mak b/Rules.mak index f2e5791e3d89..27c80f924505 100644 --- a/Rules.mak +++ b/Rules.mak @@ -606,6 +606,7 @@ CFLAGS := $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \ -nostdinc -I$(top_builddir)include \ -I$(top_srcdir)include -include libc-symbols.h \ -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) \ + -I$(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH) \ -I$(top_srcdir)libc/sysdeps/linux \ -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) \ -I$(top_srcdir)ldso/include -I. -- 2.39.2 From jcmvbkbc at gmail.com Wed Apr 24 11:36:55 2024 From: jcmvbkbc at gmail.com (Max Filippov) Date: Wed, 24 Apr 2024 04:36:55 -0700 Subject: [PATCH] Makerules: fix out-of-tree build error "Argument list too long" Message-ID: <20240424113655.2382993-1-jcmvbkbc@gmail.com> Make rule that announces and makes static libc archive can generate command line that is too long when a full path O= option is used. That breaks the build with the following message: make: /bin/sh: Argument list too long Use make $(file) construct to generate file list file and use that file as $(AR) argument instead. Signed-off-by: Max Filippov --- Makerules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makerules b/Makerules index fe8a7916e657..96f2a71ec49a 100644 --- a/Makerules +++ b/Makerules @@ -276,7 +276,7 @@ cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS) cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(sort $(foreach d,$(^:$(top_srcdir)=),$(collect_multi_flags))) cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^ cmd_t_strip = $(STRIPTOOL) $(STRIP_FLAGS) $@ -cmd_ar = $(AR) $(ARFLAGS) $@ $(call objects_with_syms,,$^) +cmd_ar = $(AR) $(ARFLAGS) $@ @$@.list define do_ln @$(disp_ln) @@ -317,6 +317,7 @@ hcompile.u= @$(disp_hcompile.u); $(cmd_hcompile.u) hcompile.o= @$(disp_hcompile.o); $(cmd_hcompile.o) define do_ar + @$(file >$@.list,$(call objects_with_syms,,$^)) @$(disp_ar) ; $(cmd_ar) @$(do_t_strip) endef -- 2.39.2