git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Josh Steadmon <steadmon@google.com>
Cc: git@vger.kernel.org, James Mills <prologic@shortcircuit.net.au>
Subject: Re: Git v2.46.0 and --allow-multiple-definition linker flag
Date: Sat, 21 Dec 2024 18:47:53 -0800	[thread overview]
Message-ID: <xmqq7c7sbfhi.fsf@gitster.g> (raw)
In-Reply-To: <xmqqbjx4bgae.fsf@gitster.g> (Junio C. Hamano's message of "Sat, 21 Dec 2024 18:30:33 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> James Mills <prologic@shortcircuit.net.au> writes:
>
>> tcc: error: unsupported linker option '--allow-multiple-definition'
>>
>> I bisected the Git releases and traced the introduction of this new
>> flag to v2.46.0
>>
>> I can't find any details of this flag really or when this was
>> introduced in the GNU binutils and so far I haven't asked if the Tiny
>> C devs intend to support this option (yet).
>
> Would
>
>     $ make LINK_FUZZ_PROGRAMS=""
>
> help?
>
> The platform-specific tweak defined in config.mak.uname file assumes
> that you have glibc plus gcc or clang with usual binutils niceties
> once you claim that you are Linux.  It lumps all different variants
> of Linux into a single ball of wax and defines LINK_FUZZ_PROGRAMS
> Makefile macro, which is a bit unfortunate.

Having said that, I am not sure if the commit that introduced the
fuzz-all linkage rules, which is 8b9a42bf (fuzz: fix fuzz test build
rules, 2024-01-19), needed to do so in the first place.  With this
trivial patch at the end of the message applied on top of 8b9a42bf
(or more recent 'master', for that matter), "make fuzz-all" seems to
link things just fine.

Note that "make CC=clang fuzz-all" in the older code used to fail
due to something else from gcc+ (which recent build no longer makes
mandatory), but in today's code with gcc/clang/ld available locally,
the linker flag does not seem to be needed for "make fuzz-all".

Josh, do you offhand know what made us add the option?

Thanks.

diff --git c/Makefile w/Makefile
index c0cbed69d8..5af8935968 100644
--- c/Makefile
+++ w/Makefile
@@ -3848,7 +3848,6 @@ FUZZ_CXXFLAGS ?= $(ALL_CFLAGS)
 
 $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS
 	$(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \
-		-Wl,--allow-multiple-definition \
 		$(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE)
 
 fuzz-all: $(FUZZ_PROGRAMS)

  reply	other threads:[~2024-12-22  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-21 23:23 Git v2.46.0 and --allow-multiple-definition linker flag James Mills
2024-12-22  2:30 ` Junio C Hamano
2024-12-22  2:47   ` Junio C Hamano [this message]
2025-01-13 17:54     ` Josh Steadmon
2025-01-14 11:03       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7c7sbfhi.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=prologic@shortcircuit.net.au \
    --cc=steadmon@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).