From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>,
git@vger.kernel.org,
Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: Re: [PATCH] git-compat-util.h: Fix build without threads
Date: Mon, 28 Nov 2022 00:04:17 -0500 [thread overview]
Message-ID: <Y4RBUa5ILEszSpOu@coredump.intra.peff.net> (raw)
In-Reply-To: <221126.86lenymw7p.gmgdl@evledraar.gmail.com>
On Sat, Nov 26, 2022 at 12:47:27AM +0100, Ævar Arnfjörð Bjarmason wrote:
> On Fri, Nov 25 2022, Bagas Sanjaya wrote:
>
> > From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> >
> > Git build with toolchains without threads support is broken (as reported
> > by Buildroot autobuilder [1]) since version 2.29.0, which traces back to
>
> > --- a/git-compat-util.h
> > +++ b/git-compat-util.h
> > @@ -1470,7 +1470,8 @@ int open_nofollow(const char *path, int flags);
> > # define SHELL_PATH "/bin/sh"
> > #endif
> >
> > -#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
> > +
> > +#if !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(NO_FLOCKFILE)
>
> Per f43cce23add (git-compat-util: add fallbacks for unlocked stdio,
> 2015-04-16) wouldn't it make more sense to do something like:
>
> #ifdef NO_FLOCKFILE
> #undef _POSIX_THREAD_SAFE_FUNCTIONS
> #endif
That doesn't work, because the NO_FLOCKFILE is actually overriding the
_lack_ of _POSIX_THREAD_SAFE_FUNCTIONS. So it's kind of confusingly
named. In this patch, NO_FLOCKFILE means "do not define a noop wrapper
flockfile()", which can only work if the system really does define it.
I do think this patch is doing the wrong thing, though. See my other
reply.
-Peff
next prev parent reply other threads:[~2022-11-28 5:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 9:23 [PATCH] git-compat-util.h: Fix build without threads Bagas Sanjaya
2022-11-25 23:47 ` Ævar Arnfjörð Bjarmason
2022-11-28 5:04 ` Jeff King [this message]
2022-11-29 3:30 ` Bagas Sanjaya
2022-11-29 3:46 ` Bagas Sanjaya
2022-11-28 5:01 ` Jeff King
2022-11-30 21:15 ` [PATCH] git-compat-util: avoid redefining system function names Jeff King
2022-12-02 10:05 ` Bagas Sanjaya
2022-12-02 11:05 ` Jeff King
2022-12-03 8:02 ` Bagas Sanjaya
2022-12-07 8:33 ` Bagas Sanjaya
2022-12-07 13:00 ` Jeff King
2022-12-02 11:31 ` Ævar Arnfjörð Bjarmason
2022-12-02 22:50 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4RBUa5ILEszSpOu@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=avarab@gmail.com \
--cc=bagasdotme@gmail.com \
--cc=fontaine.fabrice@gmail.com \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).