git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] config.mak.uname: avoid macOS dup-library warning

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Jun 22, 2026, 15:49 UTC
Message-ID
<CALnO6CCcBdmPniu3wOtktygZ4TFdz3Bp+CXNqJ9nx4_qw=to+A@mail.gmail.com>
In-Reply-To
<CALnO6CAgNdkg0PnN9Zy=zLurLUSb2hUXYAGe_qB0oceZNy_=gg@mail.gmail.com>
On Sat, Jun 20, 2026 at 4:58 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
Show 45 quoted lines
>
> On Fri, Jun 19, 2026 at 6:27 PM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > "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?
> >
> > Thanks.
>
> On one (old) machine I have available:
>
>     $ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
>     [trimmed]
>     version: 14.2.0.0.1.1668646533
>
> On 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)
> 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.1761104275
sans 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 from
0x8000 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)
-- 
D. Ben Knoble
Previous: D. Ben KnobleNext: Patrick Steinhardt
Message 13 of 18 in “Makefile: drop duplicate %.a from link recipes”
  1. Makefile: drop duplicate %.a from link recipesHarald Nordgren via GitGitGadget, May 31, 2026
  2. Junio C HamanoJun 4, 2026
  3. Harald NordgrenJun 4, 2026
  4. Harald NordgrenJun 4, 2026
  5. Makefile: dedup archives in $(LIBS) so link recipes don't repeat themHarald Nordgren via GitGitGadget, Jun 4, 2026
  6. Harald NordgrenJun 10, 2026
  7. Harald NordgrenJun 19, 2026
  8. Junio C HamanoJun 19, 2026
  9. Harald NordgrenJun 19, 2026
  10. config.mak.uname: avoid macOS dup-library warningHarald Nordgren via GitGitGadget, Jun 19, 2026
  11. Junio C HamanoJun 19, 2026
  12. D. Ben KnobleJun 20, 2026
  13. D. Ben KnobleJun 22, 2026
  14. Patrick SteinhardtJun 22, 2026
  15. Junio C HamanoJun 22, 2026
  16. Paolo BonziniJun 22, 2026
  17. Patrick SteinhardtJun 22, 2026
  18. Paolo BonziniJun 22, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.