diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-02-12 15:51:11 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-02-12 15:51:13 +0100 |
commit | 57272f44597783a2eb7b6357befc4aebd5f471e6 (patch) | |
tree | a312b929831493ccd70a6e2024e490f8770acc36 | |
parent | 214ac2a389450626e457cea8781f0119df1ae851 (diff) | |
download | liba2i-57272f44597783a2eb7b6357befc4aebd5f471e6.tar.gz |
share/mk/build/lib-shared.mk: build-lib-shared: Build directly from the sources
Don't use the .o files for building the shared library. Compiler
authors don't recommend relying on intermediate output from their
compilers, and instead recommend doing the full build at once.
Reported-by: Eli Schwartz <eschwartz93@gmail.com>
Link: <https://github.com/llvm/llvm-project/issues/80929>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | share/mk/build/lib-shared.mk | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/share/mk/build/lib-shared.mk b/share/mk/build/lib-shared.mk index 27c89d1..8f1462d 100644 --- a/share/mk/build/lib-shared.mk +++ b/share/mk/build/lib-shared.mk @@ -6,7 +6,6 @@ ifndef MAKEFILE_BUILD_LIB_SHARED_INCLUDED MAKEFILE_BUILD_LIB_SHARED_INCLUDED := 1 -include $(MAKEFILEDIR)/build/obj-as.mk include $(MAKEFILEDIR)/configure/ld.mk include $(MAKEFILEDIR)/configure/pkgconf.mk include $(MAKEFILEDIR)/src.mk @@ -17,13 +16,12 @@ include $(MAKEFILEDIR)/version.mk _LIB_so_v := $(builddir)/$(libname).so.$(DISTVERSION) -$(_LIB_so_v): %.so.$(DISTVERSION): $(_TU_o) $(MK) $(_LIB_pc_u) | $$(@D)/ +$(_LIB_so_v): %.so.$(DISTVERSION): $(TU_h) $(TU_c) $(MK) $(_LIB_pc_u) | $$(@D)/ $(info LD $@) for opt in g 0 1 2 s 3 fast; do \ - $(LD) $(LDFLAGS) -O$$opt -o $*.O$$opt.so.$(DISTVERSION) \ - $(patsubst %.o,%.O$$opt.o,$(_TU_o)) $(LDLIBS); \ + $(LD) $(LDFLAGS) -O$$opt -o $*.O$$opt.so.$(DISTVERSION) $(TU_c) $(LDLIBS); \ done - $(LD) $(LDFLAGS) -o $@ $(_TU_o) $(LDLIBS) + $(LD) $(LDFLAGS) -o $@ $(TU_c) $(LDLIBS) .PHONY: build-lib-shared |