kumquat-buildroot/package/git/0002-git-compat-util-undefine-system-names-before-redecla.patch
Bagas Sanjaya a6105112e8 package/git: bump to version 2.39.0
The git package in Buildroot is quite lagging behind (v2.31.4, released
on July 12, 2022 while the baseline v2.31.0 was released on March 15,
2021). Bump the package to v2.39.0 (released December 12, 2022).

While at it, also replace patch fixing uclibc no threads build with two
patches cherry-picked from upstream next branch, which fixes the same
issue by fixing the handling of flockfile(), funlockfile(), and
getc_unlocked() declarations. These patches missed the release but
planned for next maintenance release (v2.39.1).

The reason for replacing the patch is when original fix patch was
upstreamed [1], Jeff King noted that the build failure root cause
was flockfile() is defined regardless of whether uclibc is configured with
threads support or not [2].

Release notes for v2.39.0 is available on release announcement on Git
mailing list at [3].

[1]: https://lore.kernel.org/git/20221125092339.29433-1-bagasdotme@gmail.com/
[2]: https://lore.kernel.org/git/Y4RAr04vS%2FTOM5uh@coredump.intra.peff.net/
[3]: https://lore.kernel.org/git/xmqqlencspnl.fsf@gitster.g/

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-12-18 13:37:42 +01:00

56 lines
2.0 KiB
Diff

From 6d406390b870fdb2cd9d18b12ebfabc12f5096df Mon Sep 17 00:00:00 2001
From: Jeff King <peff@peff.net>
Date: Fri, 2 Dec 2022 06:05:38 -0500
Subject: [PATCH] git-compat-util: undefine system names before redeclaring
them
When we define a macro to point a system function (e.g., flockfile) to
our custom wrapper, we should make sure that the system did not already
define it as a macro. This is rarely a problem, but can cause
compilation failures if both of these are true:
- we decide to define our own wrapper even though the system provides
the function; we know this happens at least with uclibc, which may
declare flockfile, etc, without _POSIX_THREAD_SAFE_FUNCTIONS
- the system version is declared as a macro; we know this happens at
least with uclibc's version of getc_unlocked()
So just handling getc_unlocked() would be sufficient to deal with the
real-world case we've seen. But since it's easy to do, we may as well be
defensive about the other macro wrappers added in the previous patch.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
[Bagas: cherry-picked from e1a95b78d8a26762ea04332de8b7c3878da51522 on next branch]
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
git-compat-util.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/git-compat-util.h b/git-compat-util.h
index e3456bdd0d..211861da0f 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -346,6 +346,7 @@ static inline int git_setitimer(int which,
struct itimerval *newvalue) {
return 0; /* pretend success */
}
+#undef setitimer
#define setitimer(which,value,ovalue) git_setitimer(which,value,ovalue)
#endif
@@ -1480,6 +1481,9 @@ static inline void git_funlockfile(FILE *fh)
{
; /* nothing */
}
+#undef flockfile
+#undef funlockfile
+#undef getc_unlocked
#define flockfile(fh) git_flockfile(fh)
#define funlockfile(fh) git_funlockfile(fh)
#define getc_unlocked(fh) getc(fh)
--
An old man doll... just what I always wanted! - Clara