Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 22, 2026, 08:04 UTC
- Message-ID
- <ajjspU7lJ01GgrBw@pks.im>
- In-Reply-To
- <xmqqv7bei2tf.fsf@gitster.g>
On Fri, Jun 19, 2026 at 03:27:08PM -0700, Junio C Hamano wrote:
Show 30 quoted lines
> "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes: > > From: Harald Nordgren <haraldnordgren@gmail.com> > > > > 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. > > > > Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> > > --- > > 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?
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