Makefile: drop duplicate %.a from link recipes
PATCH 1/1 Makefile: drop duplicate %.a from link recipes
From: Harald Nordgren <[email protected]>
Three link recipes list archive files twice on the link line: once via $(filter %.a,$^) and again through $(LIBS), which expands to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warns about the duplicates:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Drop the redundant filter from the test-helper, fuzz-program, and unit-test recipes so they match the pattern used by other link recipes in the file.
---
Makefile: drop duplicate %.a from test-helper link rule
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2314%2FHaraldNordgren%2Fmakefile-test-helper-dedup-libs-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2314/HaraldNordgren/makefile-test-helper-dedup-libs-v1
Pull-Request: https://github.com/git/git/pull/2314
Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
@@ -3392,7 +3392,7 @@ perf: all t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) check-sha1:: t/helper/test-tool$X t/helper/test-sha1.sh
@@ -4015,13 +4015,13 @@ fuzz-all: $(FUZZ_PROGRAMS) $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS $(QUIET_LINK)$(FUZZ_CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \ -Wl,--allow-multiple-definition \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE) + $(filter %.o,$^) $(LIBS) $(LIB_FUZZING_ENGINE) $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_OBJS) \ $(GITLIBS) GIT-LDFLAGS $(call mkdir_p_parent_template) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(filter %.o,$^) $(LIBS) GIT-TEST-SUITES: FORCE @FLAGS='$(CLAR_TEST_SUITES)'; \
base-commit: 1666c1265231b0bc5f613fbbf3f0a9896cdef76e
Signature · 1 line
gitgitgadget
Makefile perf: all · line 3395
Quoted 3 lines · Harald Nordgren via GitGitGadget
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
Makefile +1
-1- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
I think the reason why the pattern to use only the .o files among the prerequisites and then use only the .a files among the same prerequisites (both filters $^) is used here is to make sure that the linker sees object files first before library archives, so that by the time its left-to-right scan sees the first library archive, all the missing symbols in the object files are known. The above change depends on LIBS being a strict superset of all the library archive files ($GITLIBS in the current code, but that can be updated in the future) listed as prerequisites for the rule, but there is nothing to guarantee that, so it looks brittle.
Exact same comment applies to the other two rules touched by this patch.
Quoted 18 lines · Junio C Hamano
Makefile perf: all · line 3395
Quoted 3 lines · Harald Nordgren via GitGitGadget
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
Makefile +1
-1- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)I think the reason why the pattern to use only the .o files among the prerequisites and then use only the .a files among the same prerequisites (both filters $^) is used here is to make sure that the linker sees object files first before library archives, so that by the time its left-to-right scan sees the first library archive, all the missing symbols in the object files are known. The above change depends on LIBS being a strict superset of all the library archive files ($GITLIBS in the current code, but that can be updated in the future) listed as prerequisites for the rule, but there is nothing to guarantee that, so it looks brittle.
Quoted 1 line
Exact same comment applies to the other two rules touched by this patch.
Hmm, there are other constructs like this that rely on $(LIBS) being a superset of the archives, so the three rules changed here align with the trend rather than introduce a new trend.
Not saying we shouldn't find a way to handle the overall brittleness.
Harald
Maybe we can do this to get around the brittleness for all ~10 places:
``` -LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS) +LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) BASIC_CFLAGS += $(COMPAT_CFLAGS) LIB_OBJS += $(COMPAT_OBJS) @@ -3392,7 +3395,7 @@ perf: all t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) check-sha1:: t/helper/test-tool$X t/helper/test-sha1.sh @@ -4015,13 +4018,13 @@ fuzz-all: $(FUZZ_PROGRAMS) $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS $(QUIET_LINK)$(FUZZ_CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \ -Wl,--allow-multiple-definition \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE) + $(filter %.o,$^) $(LIBS) $(LIB_FUZZING_ENGINE) $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_OBJS) \ $(GITLIBS) GIT-LDFLAGS $(call mkdir_p_parent_template) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(filter %.o,$^) $(LIBS) GIT-TEST-SUITES: FORCE @FLAGS='$(CLAR_TEST_SUITES)'; \ ```
Harald
Quoted 30 lines · Harald Nordgren
Quoted 18 lines · Junio C Hamano
Makefile perf: all · line 3395
Quoted 3 lines · Harald Nordgren via GitGitGadget
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
Makefile +1
-1- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)I think the reason why the pattern to use only the .o files among the prerequisites and then use only the .a files among the same prerequisites (both filters $^) is used here is to make sure that the linker sees object files first before library archives, so that by the time its left-to-right scan sees the first library archive, all the missing symbols in the object files are known. The above change depends on LIBS being a strict superset of all the library archive files ($GITLIBS in the current code, but that can be updated in the future) listed as prerequisites for the rule, but there is nothing to guarantee that, so it looks brittle.
Quoted 1 line
Exact same comment applies to the other two rules touched by this patch.
Hmm, there are other constructs like this that rely on $(LIBS) being a superset of the archives, so the three rules changed here align with the trend rather than introduce a new trend.
Not saying we shouldn't find a way to handle the overall brittleness.
Harald
PATCH v2 1/1 Makefile: dedup archives in $(LIBS) so link recipes don't repeat them
In reply to Harald Nordgren via GitGitGadgetFrom: Harald Nordgren <[email protected]>
A handful of link recipes listed archive files twice: once explicitly via $(filter %.a,$^) and again implicitly through $(LIBS), which expanded to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warned about the duplicates:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Redefine $(LIBS) to list archive prerequisites from $^ first, then the rest of the library list with those archives filtered out so each appears only once.
---
Makefile: drop duplicate %.a from test-helper link rule
Redefine $(LIBS) to list archive prerequisites from $^ first, then the rest of the library list to avoid brittleness in the future.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2314%2FHaraldNordgren%2Fmakefile-test-helper-dedup-libs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2314/HaraldNordgren/makefile-test-helper-dedup-libs-v2
Pull-Request: https://github.com/git/git/pull/2314
Range-diff vs v1:
1: f6166450b0 ! 1: 0ef442ea05 Makefile: drop duplicate %.a from link recipes
@@ Metadata
Author: Harald Nordgren <[email protected]>
## Commit message ##
- Makefile: drop duplicate %.a from link recipes
+ Makefile: dedup archives in $(LIBS) so link recipes don't repeat them
- Three link recipes list archive files twice on the link line: once
- via $(filter %.a,$^) and again through $(LIBS), which expands to
- $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warns
- about the duplicates:
+ A handful of link recipes listed archive files twice: once explicitly
+ via $(filter %.a,$^) and again implicitly through $(LIBS), which
+ expanded to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the
+ linker warned about the duplicates:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
- Drop the redundant filter from the test-helper, fuzz-program, and
- unit-test recipes so they match the pattern used by other link
- recipes in the file.
+ Redefine $(LIBS) to list archive prerequisites from $^ first, then
+ the rest of the library list with those archives filtered out so each
+ appears only once.
## Makefile ##
+@@ Makefile: endif
+ #
+ # where we use it as a dependency. Since we also pull object files
+ # from the dependency list, that would make each entry appear twice.
+-LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
++# Archives from $^ come first, then the rest with those archives
++# filtered out so each appears only once.
++LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) +
+ BASIC_CFLAGS += $(COMPAT_CFLAGS)
+ LIB_OBJS += $(COMPAT_OBJS)
@@ Makefile: perf: all
t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o
Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +6 -4
@@ -2503,7 +2503,9 @@ endif # # where we use it as a dependency. Since we also pull object files # from the dependency list, that would make each entry appear twice. -LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS) +# Archives from $^ come first, then the rest with those archives +# filtered out so each appears only once. +LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) BASIC_CFLAGS += $(COMPAT_CFLAGS) LIB_OBJS += $(COMPAT_OBJS)
@@ -3392,7 +3394,7 @@ perf: all t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) check-sha1:: t/helper/test-tool$X t/helper/test-sha1.sh
@@ -4015,13 +4017,13 @@ fuzz-all: $(FUZZ_PROGRAMS) $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS $(QUIET_LINK)$(FUZZ_CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \ -Wl,--allow-multiple-definition \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE) + $(filter %.o,$^) $(LIBS) $(LIB_FUZZING_ENGINE) $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_OBJS) \ $(GITLIBS) GIT-LDFLAGS $(call mkdir_p_parent_template) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(filter %.o,$^) $(LIBS) GIT-TEST-SUITES: FORCE @FLAGS='$(CLAR_TEST_SUITES)'; \
base-commit: 9ac3f193c05c2237e2b14ebaa1149e9fc8a1abe0
Signature · 1 line
gitgitgadget
Re: [PATCH v2] Makefile: dedup archives in $(LIBS) so link recipes don't repeat them
Hi Johannes!
Maybe this could be interesting for you to look at too.
Harald
Quoted 119 lines · Harald Nordgren via GitGitGadget
From: Harald Nordgren <[email protected]>
A handful of link recipes listed archive files twice: once explicitly via $(filter %.a,$^) and again implicitly through $(LIBS), which expanded to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warned about the duplicates:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Redefine $(LIBS) to list archive prerequisites from $^ first, then the rest of the library list with those archives filtered out so each appears only once.
Signed-off-by Harald Nordgren <[email protected]>---
Makefile: drop duplicate %.a from test-helper link ruleRedefine $(LIBS) to list archive prerequisites from $^ first, then the rest of the library list to avoid brittleness in the future.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2314%2FHaraldNordgren%2Fmakefile-test-helper-dedup-libs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2314/HaraldNordgren/makefile-test-helper-dedup-libs-v2
Pull-Request: https://github.com/git/git/pull/2314Range-diff vs v1:
1:
f6166450b0! 1:0ef442ea05Makefile: drop duplicate %.a from link recipes
@@ Metadata
Author: Harald Nordgren <[email protected]>## Commit message ##
-Makefile: drop duplicate %.a from link recipes
+Makefile: dedup archives in $(LIBS) so link recipes don't repeat them- Three link recipes list archive files twice on the link line: once
- via $(filter %.a,$^) and again through $(LIBS), which expands to
- $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warns
- about the duplicates:
+ A handful of link recipes listed archive files twice: once explicitly
+ via $(filter %.a,$^) and again implicitly through $(LIBS), which
+ expanded to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the
+ linker warned about the duplicates:ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
- Drop the redundant filter from the test-helper, fuzz-program, and
- unit-test recipes so they match the pattern used by other link
- recipes in the file.
+ Redefine $(LIBS) to list archive prerequisites from $^ first, then
+ the rest of the library list with those archives filtered out so each
+ appears only once.Signed-off-by Harald Nordgren <[email protected]>##
Makefile##
+@@Makefile: endif
+ #
+ # where we use it as a dependency. Since we also pull object files
+ # from the dependency list, that would make each entry appear twice.
+-LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
++# Archives from $^ come first, then the rest with those archives
++# filtered out so each appears only once.
++LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) +
+BASIC_CFLAGS+= $(COMPAT_CFLAGS)
+LIB_OBJS+= $(COMPAT_OBJS)
@@Makefile: perf: all
t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.oMakefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)Makefile +6
-4@@ -2503,7 +2503,9 @@ endif # # where we use it as a dependency. Since we also pull object files # from the dependency list, that would make each entry appear twice. -LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS) +# Archives from $^ come first, then the rest with those archives +# filtered out so each appears only once. +LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) BASIC_CFLAGS += $(COMPAT_CFLAGS) LIB_OBJS += $(COMPAT_OBJS)@@ -3392,7 +3394,7 @@ perf: all t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) check-sha1:: t/helper/test-tool$X t/helper/test-sha1.sh@@ -4015,13 +4017,13 @@ fuzz-all: $(FUZZ_PROGRAMS) $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS $(QUIET_LINK)$(FUZZ_CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \ -Wl,--allow-multiple-definition \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE) + $(filter %.o,$^) $(LIBS) $(LIB_FUZZING_ENGINE) $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_OBJS) \ $(GITLIBS) GIT-LDFLAGS $(call mkdir_p_parent_template) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(filter %.o,$^) $(LIBS) GIT-TEST-SUITES: FORCE @FLAGS='$(CLAR_TEST_SUITES)'; \base-commit:
9ac3f193c05c2237e2b14ebaa1149e9fc8a1abe0--
gitgitgadget
Re: [PATCH v2] Makefile: dedup archives in $(LIBS) so link recipes don't repeat them
In reply to Harald Nordgren via GitGitGadgetHi!
I think this would be quite nice to fix for all the macOS developers (I don't know how many we have who are active on this list), but when running repeated tests it does take up some space on the terminal:
```` ❯ git rebase --keep-base -x 'make -s && cd t && prove -j8 t345?-history*.sh && echo' Executing: make -s && cd t && prove -j8 t345?-history*.sh && echo GIT_VERSION=2.55.0.rc1.20.g1e31474ef6 ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' t3450-history.sh ......... ok t3453-history-fixup.sh ... ok t3451-history-reword.sh .. ok t3452-history-split.sh ... ok All tests successful. Files=4, Tests=69, 7 wallclock secs ( 0.02 usr 0.01 sys + 4.14 cusr 5.39 csys = 9.56 CPU) Result: PASS Executing: make -s && cd t && prove -j8 t345?-history*.sh && echo GIT_VERSION=2.55.0.rc1.21.g498da64046 ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' t3450-history.sh ......... ok t3453-history-fixup.sh ... ok t3451-history-reword.sh .. ok t3452-history-split.sh ... ok All tests successful. Files=4, Tests=69, 7 wallclock secs ( 0.02 usr 0.01 sys + 4.16 cusr 5.41 csys = 9.60 CPU) Result: PASS Executing: make -s && cd t && prove -j8 t345?-history*.sh && echo GIT_VERSION=2.55.0.rc1.22.g0050368e96 ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' t3450-history.sh ......... ok t3455-history-squash.sh .. ok t3453-history-fixup.sh ... ok t3451-history-reword.sh .. ok t3452-history-split.sh ... ok All tests successful. Files=5, Tests=86, 7 wallclock secs ( 0.03 usr 0.01 sys + 4.89 cusr 6.36 csys = 11.29 CPU) Result: PASS Executing: make -s && cd t && prove -j8 t345?-history*.sh && echo GIT_VERSION=2.55.0.rc1.23.gb86b93bda1 ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a' t3450-history.sh ......... ok t3455-history-squash.sh .. ok t3453-history-fixup.sh ... ok t3451-history-reword.sh .. ok t3452-history-split.sh ... ok All tests successful. Files=5, Tests=88, 7 wallclock secs ( 0.03 usr 0.01 sys + 5.01 cusr 6.54 csys = 11.59 CPU) Result: PASS Successfully rebased and updated refs/heads/rebase-fixup-fold. ```
Harald
Quoted 119 lines · Harald Nordgren via GitGitGadget
From: Harald Nordgren <[email protected]>
A handful of link recipes listed archive files twice: once explicitly via $(filter %.a,$^) and again implicitly through $(LIBS), which expanded to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warned about the duplicates:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Redefine $(LIBS) to list archive prerequisites from $^ first, then the rest of the library list with those archives filtered out so each appears only once.
Signed-off-by Harald Nordgren <[email protected]>---
Makefile: drop duplicate %.a from test-helper link ruleRedefine $(LIBS) to list archive prerequisites from $^ first, then the rest of the library list to avoid brittleness in the future.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2314%2FHaraldNordgren%2Fmakefile-test-helper-dedup-libs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2314/HaraldNordgren/makefile-test-helper-dedup-libs-v2
Pull-Request: https://github.com/git/git/pull/2314Range-diff vs v1:
1:
f6166450b0! 1:0ef442ea05Makefile: drop duplicate %.a from link recipes
@@ Metadata
Author: Harald Nordgren <[email protected]>## Commit message ##
-Makefile: drop duplicate %.a from link recipes
+Makefile: dedup archives in $(LIBS) so link recipes don't repeat them- Three link recipes list archive files twice on the link line: once
- via $(filter %.a,$^) and again through $(LIBS), which expands to
- $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the linker warns
- about the duplicates:
+ A handful of link recipes listed archive files twice: once explicitly
+ via $(filter %.a,$^) and again implicitly through $(LIBS), which
+ expanded to $(filter-out %.o,$(GITLIBS)) $(EXTLIBS). On macOS the
+ linker warned about the duplicates:ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
- Drop the redundant filter from the test-helper, fuzz-program, and
- unit-test recipes so they match the pattern used by other link
- recipes in the file.
+ Redefine $(LIBS) to list archive prerequisites from $^ first, then
+ the rest of the library list with those archives filtered out so each
+ appears only once.Signed-off-by Harald Nordgren <[email protected]>##
Makefile##
+@@Makefile: endif
+ #
+ # where we use it as a dependency. Since we also pull object files
+ # from the dependency list, that would make each entry appear twice.
+-LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
++# Archives from $^ come first, then the rest with those archives
++# filtered out so each appears only once.
++LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) +
+BASIC_CFLAGS+= $(COMPAT_CFLAGS)
+LIB_OBJS+= $(COMPAT_OBJS)
@@Makefile: perf: all
t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.oMakefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)Makefile +6
-4@@ -2503,7 +2503,9 @@ endif # # where we use it as a dependency. Since we also pull object files # from the dependency list, that would make each entry appear twice. -LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS) +# Archives from $^ come first, then the rest with those archives +# filtered out so each appears only once. +LIBS = $(filter %.a,$^) $(filter-out $(filter %.a,$^),$(filter-out %.o,$(GITLIBS)) $(EXTLIBS)) BASIC_CFLAGS += $(COMPAT_CFLAGS) LIB_OBJS += $(COMPAT_OBJS)@@ -3392,7 +3394,7 @@ perf: all t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) check-sha1:: t/helper/test-tool$X t/helper/test-sha1.sh@@ -4015,13 +4017,13 @@ fuzz-all: $(FUZZ_PROGRAMS) $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS $(QUIET_LINK)$(FUZZ_CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \ -Wl,--allow-multiple-definition \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE) + $(filter %.o,$^) $(LIBS) $(LIB_FUZZING_ENGINE) $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_OBJS) \ $(GITLIBS) GIT-LDFLAGS $(call mkdir_p_parent_template) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(filter %.o,$^) $(LIBS) GIT-TEST-SUITES: FORCE @FLAGS='$(CLAR_TEST_SUITES)'; \base-commit:
9ac3f193c05c2237e2b14ebaa1149e9fc8a1abe0--
gitgitgadget
Re: [PATCH v2] Makefile: dedup archives in $(LIBS) so link recipes don't repeat them
Quoted 8 lines · Harald Nordgren
I think this would be quite nice to fix for all the macOS developers (I don't know how many we have who are active on this list), but when running repeated tests it does take up some space on the terminal:
````
❯ git rebase --keep-base -x 'make -s && cd t && prove -j8 t345?-history*.sh && echo'
Quoted 6 lines
Executing: make -s && cd t && prove -j8 t345?-history*.sh && echo GIT_VERSION=2.55.0.rc1.20.g1e31474ef6
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
While I am very sympathetic that it may be annoying, I have to wonder if that is ultimately the linker's job to accept the same library listed twice on the same command line, deside when it can ignore the second one, and *silently* ignore it.
Imagine this situation.
- There are two library archives, libA.a has a.o in it and libB.a has b.o in it, respectively.
- The object file a.o defines a symbol that b.o needs, and b.o defines a symbol a.o needs (i.e., mutually dependent). libA.a and libB.a have other symbols in them. There are valid reasons why we do not want to combine them into a single libAB.a.
- Now our program X uses both libraries and we build and try to link it this way:
$(CC) -c x.c # this builds x.o $(CC) -o programX x.o libA.a libB.a # unfortunately does not work as-is
which fails because x.o uses symbol from libA.a that is not in a.o (so a.o is not linked), and then x.o also uses something in b.o that is picked up from libB.a. But b.o in turn needs a.o that we already skipped. One way to make it work is to tweak the final link phase to read like this:
$(CC) -o programX x.o libA.a libB.a libA.a
If your linker complains because we list libA.a twice, it would be annoying.
I guess if we can assume GNU ld (e.g., gcc/clang), we can use
$(CC) -o programX x.o -Wl,--start-group libA.a libB.a -Wl,end-group
to tell the linker that they need to be processed for circular dependencies, but listing them twice is more portable and harmless (i.e., if all the symbols are resolved by the time the linker sees the second libA.a, then it would not pick up anything extra from there) way to achieve the same thing.
So from future-proofing and portability perspective (which is another way to say maintainability we care about), I would very much prefer to see this solved at the linker level, allowing the build procedure to list the same library twice on the command line.
It seems that on the Internet various folks, including masonbuild and CMake, have heard complaints from users enough and fixed the linker by using -no_warn_duplicate_libraries option. Their approach translates to something like the following in our build environment.
config.mak.uname | 4 ++++ 1 file changed, 4 insertions(+)
config.mak.uname +4 -0
@@ -149,6 +149,10 @@ ifeq ($(uname_S),Darwin) ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1) OPEN_RETURNS_EINTR = UnfortunatelyYes endif + + # NEEDSWORK: do this only for XCode 15 or later + BASIC_LDFLAGS += -Wl,-no_warn_duplicate_libraries + NO_MEMMEM = YesPlease USE_ST_TIMESPEC = YesPlease HAVE_DEV_TTY = YesPlease
Re: [PATCH v2] Makefile: dedup archives in $(LIBS) so link recipes don't repeat them
Thanks for a good lesson about linkers!
Good idea to fix it through the same LD_MAJOR_VERSION as we did for the __DATA,__common alignment, makes it a lot cleaner.
Harald
PATCH v3 1/1 config.mak.uname: avoid macOS dup-library warning
In reply to Harald Nordgren via GitGitGadgetFrom: Harald Nordgren <[email protected]>
Building on macOS with Xcode 15 or newer emits:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Some link recipes list the same archive twice, which is harmless. Quiet the warning instead.
Pass -Wl,-no_warn_duplicate_libraries on Xcode 15 and newer, whose linkers added both the warning and the suppression flag (ld64-907 and dyld-1009). Earlier linkers reject the flag, so gate on the linker version. Broaden the existing -fno-common version probe to also match the "ld64-NNN" and "dyld-NNN" forms Xcode 15 reports.
---
Makefile: drop duplicate %.a from test-helper link rule
Fix warning of duplicate libraries on macOS.
Changes in v3:
* Suppress the warning at the linker rather than dedup the archive list
* Pass -Wl,-no_warn_duplicate_libraries in config.mak.uname, gated on the linker version (reuses the probe added for -fno-common), and broaden the regex to match all three PROJECT:{ld64,dyld,ld}-NNN forms
* Floor of 907 and the version forms (ld64-907, dyld-1009.5) per meson:
https://github.com/mesonbuild/meson/blob/master/mesonbuild/linkers/linkers.py
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2314%2FHaraldNordgren%2Fmakefile-test-helper-dedup-libs-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2314/HaraldNordgren/makefile-test-helper-dedup-libs-v3
Pull-Request: https://github.com/git/git/pull/2314
Range-diff vs v2:
1: 0ef442ea05 < -: ---------- Makefile: dedup archives in $(LIBS) so link recipes don't repeat them -: ---------- > 1: 5bf560c5ad config.mak.uname: avoid macOS dup-library warning
config.mak.uname | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
config.mak.uname +9 -2
@@ -173,8 +173,15 @@ ifeq ($(uname_S),Darwin) NEEDS_GOOD_LIBICONV = UnfortunatelyYes endif - # Silence Xcode 16.3+ linker warning about __DATA,__common alignment. - LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:ld-\([0-9]*\).*/\1/p') + # ld reports "PROJECT:{ld,ld64,dyld}-NNN", match any of the three. + LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:[^ ]*-\([0-9][0-9]*\).*/\1/p') + + # Silence the Xcode 15+ warning about archives listed more than once. + ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 907 && echo 1),1) + BASIC_LDFLAGS += -Wl,-no_warn_duplicate_libraries + endif + + # Silence the Xcode 16.3+ warning about __DATA,__common alignment. ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 1167 && echo 1),1) BASIC_CFLAGS += -fno-common endif
base-commit: 95e20213faefeb95df29277c58ac1980ab68f701
Signature · 1 line
gitgitgadget
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 10 lines · Harald Nordgren via GitGitGadget
From: Harald Nordgren <[email protected]>
Building on macOS with Xcode 15 or newer emits:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Some link recipes list the same archive twice, which is harmless. Quiet the warning instead.
Quoted 8 lines
Pass -Wl,-no_warn_duplicate_libraries on Xcode 15 and newer, whose linkers added both the warning and the suppression flag (ld64-907 and dyld-1009). Earlier linkers reject the flag, so gate on the linker version. Broaden the existing -fno-common version probe to also match the "ld64-NNN" and "dyld-NNN" forms Xcode 15 reports.
Signed-off-by Harald Nordgren <[email protected]>---
Yeah, this looks like what I expected.
A few things to note.
* Can folks with different versions of Xcode (or is 15 sufficiently old that practically nobody is expected to have anything older?) test this patch?
* We only patch Makefile here; can folks who use meson report how well your build goes?
Thanks.
Quoted 27 lines
config.mak.uname | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)config.mak.uname +9
-2@@ -173,8 +173,15 @@ ifeq ($(uname_S),Darwin) NEEDS_GOOD_LIBICONV = UnfortunatelyYes endif - # Silence Xcode 16.3+ linker warning about __DATA,__common alignment. - LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:ld-\([0-9]*\).*/\1/p') + # ld reports "PROJECT:{ld,ld64,dyld}-NNN", match any of the three. + LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:[^ ]*-\([0-9][0-9]*\).*/\1/p') + + # Silence the Xcode 15+ warning about archives listed more than once. + ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 907 && echo 1),1) + BASIC_LDFLAGS += -Wl,-no_warn_duplicate_libraries + endif + + # Silence the Xcode 16.3+ warning about __DATA,__common alignment. ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 1167 && echo 1),1) BASIC_CFLAGS += -fno-common endifbase-commit:
95e20213faefeb95df29277c58ac1980ab68f701
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 26 lines · Junio C Hamano
Quoted 10 lines · Harald Nordgren via GitGitGadget
From: Harald Nordgren <[email protected]>
Building on macOS with Xcode 15 or newer emits:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Some link recipes list the same archive twice, which is harmless. Quiet the warning instead.
Quoted 8 lines
Pass -Wl,-no_warn_duplicate_libraries on Xcode 15 and newer, whose linkers added both the warning and the suppression flag (ld64-907 and dyld-1009). Earlier linkers reject the flag, so gate on the linker version. Broaden the existing -fno-common version probe to also match the "ld64-NNN" and "dyld-NNN" forms Xcode 15 reports.
Signed-off-by Harald Nordgren <[email protected]>---
Yeah, this looks like what I expected.
A few things to note.
Quoted 8 lines
* Can folks with different versions of Xcode (or is 15 sufficiently old that practically nobody is expected to have anything older?) test this patch?
* We only patch
Makefilehere; can folks who use meson report how well your build goes?Thanks.
On one (old) machine I have available:
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
[trimmed]
version: 14.2.0.0.1.1668646533On said machine, I don't get the duplicate warnings on a Meson build. No issues with the patch when running make.
I think I have seen this on my other machine, which is much newer. When I get around to trying it there, I'll report back as well.
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 37 lines · D. Ben Knoble
Quoted 26 lines · Junio C Hamano
Quoted 10 lines · Harald Nordgren via GitGitGadget
From: Harald Nordgren <[email protected]>
Building on macOS with Xcode 15 or newer emits:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Some link recipes list the same archive twice, which is harmless. Quiet the warning instead.
Quoted 8 lines
Pass -Wl,-no_warn_duplicate_libraries on Xcode 15 and newer, whose linkers added both the warning and the suppression flag (ld64-907 and dyld-1009). Earlier linkers reject the flag, so gate on the linker version. Broaden the existing -fno-common version probe to also match the "ld64-NNN" and "dyld-NNN" forms Xcode 15 reports.
Signed-off-by Harald Nordgren <[email protected]>---
Yeah, this looks like what I expected.
A few things to note.
Quoted 8 lines
* Can folks with different versions of Xcode (or is 15 sufficiently old that practically nobody is expected to have anything older?) test this patch?
* We only patch
Makefilehere; can folks who use meson report how well your build goes?Thanks.
Quoted 8 lines
On one (old) machine I have available:
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables [trimmed] version: 14.2.0.0.1.1668646533On said machine, I don't get the duplicate warnings on a Meson build. No issues with the patch when running make.
That old machine has "ld -v":
@(#)PROGRAM:ld PROJECT:ld64-711
BUILD 21:57:11 Nov 17 2021
[trimmed]
LTO support using: LLVM version 13.0.0, (clang-1300.0.29.30)
(static support for 27, runtime is 27)
TAPI support using: Apple TAPI version 13.0.0 (tapi-1300.0.6.5)Quoted 2 lines
I think I have seen this on my other machine, which is much newer. When I get around to trying it there, I'll report back as well.
Here's those results:
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
[trimmed]
version: 26.1.0.0.1.1761104275sans patch:
- Meson: duplicate warning
- Make: duplicate warning
w/ patch:
- Meson: (unchanged, obviously)
- Make: no duplicate warning
Under Meson + Ninja the warning I get is (status line may not be helpful given parallelism)
[705/708] Linking target t/helper/test-tool
ld: warning: ignoring duplicate libraries: '-lexpat', '-liconv',
'-lresolv', '-lz'
That's in addition to a dozen or so
ld: warning: reducing alignment of section __DATA,__common from0x8000 to 0x4000 because it exceeds segment maximum alignment
Under Make I get (surrounding info may not be helpful given parallelism)
LINK git
ld: warning: ignoring duplicate libraries: 'libgit.a',
'target/release/libgitcore.a'
MKDIR -p t/unit-tests/bin
LINK git-sh-i18n--envsubst
LINK t/helper/test-tool
LINK git-remote-http
ld: warning: ignoring duplicate libraries: 'libgit.a',
'target/release/libgitcore.a'
(No alignment warnings this time.)
Linker version (ld -v) on this machine:
@(#)PROGRAM:ld PROJECT:ld-1230.1
BUILD 16:18:08 Oct 17 2025
[trimmed]
LTO support using: LLVM version 17.0.0 (static support for 29,
runtime is 29)
TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.3.8)Signature · 1 line
D. Ben Knoble
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
In reply to Junio C HamanoQuoted 22 lines · Junio C Hamano
Quoted 10 lines · Harald Nordgren via GitGitGadget
From: Harald Nordgren <[email protected]>
Building on macOS with Xcode 15 or newer emits:
ld: warning: ignoring duplicate libraries: 'libgit.a', 'target/release/libgitcore.a'
Some link recipes list the same archive twice, which is harmless. Quiet the warning instead.
Quoted 8 lines
Pass -Wl,-no_warn_duplicate_libraries on Xcode 15 and newer, whose linkers added both the warning and the suppression flag (ld64-907 and dyld-1009). Earlier linkers reject the flag, so gate on the linker version. Broaden the existing -fno-common version probe to also match the "ld64-NNN" and "dyld-NNN" forms Xcode 15 reports.
Signed-off-by Harald Nordgren <[email protected]>---
Yeah, this looks like what I expected.
Quoted 8 lines
A few things to note.
* Can folks with different versions of Xcode (or is 15 sufficiently old that practically nobody is expected to have anything older?) test this patch?
* We only patch
Makefilehere; can folks who use meson report how well your build goes?
When using Meson we also see a warning. This got partially fixed in Meson itself though via [1], where it started to disable the warning when compiling with "--fatal-warnings" so that it doesn't cause builds to break. So starting with that commit it really only is a harmless (albeit annoying) warning.
Arguably, it might make sense to unconditionally disable this warning, as it doesn't seem to add anything of value. I've Cc'd Paolo, one of the Meson maintainers.
Thanks!
Patrick
[1]: https://github.com/mesonbuild/meson/commit/17d1cc60ed8246b8e7f0786421bf1cdf5cb19254
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 21 lines · Patrick Steinhardt
Quoted 10 lines
Yeah, this looks like what I expected.
A few things to note.
* Can folks with different versions of Xcode (or is 15 sufficiently old that practically nobody is expected to have anything older?) test this patch?
* We only patch
Makefilehere; can folks who use meson report how well your build goes?When using Meson we also see a warning. This got partially fixed in Meson itself though via [1], where it started to disable the warning when compiling with "--fatal-warnings" so that it doesn't cause builds to break. So starting with that commit it really only is a harmless (albeit annoying) warning.
Arguably, it might make sense to unconditionally disable this warning, as it doesn't seem to add anything of value. I've Cc'd Paolo, one of the Meson maintainers.
Quoted 5 lines
Thanks!
Patrick
[1]: https://github.com/mesonbuild/meson/commit/17d1cc60ed8246b8e7f0786421bf1cdf5cb19254
I took my inspiration for -Wl,-no-whatever from Paolo's other attempt, referenced in
https://github.com/mesonbuild/meson/issues/15553
which is
https://github.com/mesonbuild/meson/commit/7c901d7a8af214e31788eb6d1a1edd5b75124e66
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 10 lines · Junio C Hamano
Quoted 1 line
[1]:https://github.com/mesonbuild/meson/ commit/17d1cc60ed8246b8e7f0786421bf1cdf5cb19254
I took my inspiration for -Wl,-no-whatever from Paolo's other attempt, referenced in
https://github.com/mesonbuild/meson/issues/15553which is
https://github.com/mesonbuild/meson/
commit/7c901d7a8af214e31788eb6d1a1edd5b75124e66
Yeah, it makes sense for Meson to disable it unconditionally. I wouldn't bother adding a check in meson.build though, since as Patrick mentioned it's mostly a nuisance.
Paolo
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 8 lines · Paolo Bonzini
Quoted 7 lines · Junio C Hamano
Quoted 2 lines
[1]:https://github.com/mesonbuild/meson/
commit/17d1cc60ed8246b8e7f0786421bf1cdf5cb19254I took my inspiration for -Wl,-no-whatever from Paolo's other attempt, referenced in
https://github.com/mesonbuild/meson/issues/15553
Quoted 8 lines
Quoted 4 lines
which is
https://github.com/mesonbuild/meson/
commit/7c901d7a8af214e31788eb6d1a1edd5b75124e66Yeah, it makes sense for Meson to disable it unconditionally. I wouldn't bother adding a check in meson.build though, since as Patrick mentioned it's mostly a nuisance.
Is this something you want to implement in Meson yourself? Otherwise I'm happy to create a pull request.
Patrick
Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
Quoted 14 lines · Patrick Steinhardt
Quoted 13 lines · Paolo Bonzini
Quoted 11 lines · Junio C Hamano
Quoted 2 lines
[1]:https://github.com/mesonbuild/meson/
commit/17d1cc60ed8246b8e7f0786421bf1cdf5cb19254I took my inspiration for -Wl,-no-whatever from Paolo's other attempt, referenced in
https://github.com/mesonbuild/meson/issues/15553which is
https://github.com/mesonbuild/meson/
commit/7c901d7a8af214e31788eb6d1a1edd5b75124e66
Quoted 6 lines
Quoted 3 lines
Yeah, it makes sense for Meson to disable it unconditionally. I wouldn't bother adding a check in meson.build though, since as Patrick mentioned it's mostly a nuisance.
Is this something you want to implement in Meson yourself? Otherwise I'm happy to create a pull request.
Sure, please go ahead!
Paolo