dev-util/kbuild: fix building against glibc-2.32+

Closes: https://bugs.gentoo.org/736635
Package-Manager: Portage-3.0.2, Repoman-2.3.23
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
This commit is contained in:
Thomas Deutschmann
2020-08-16 23:17:38 +02:00
parent 414ae246de
commit 66de2d4026
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
http://trac.netlabs.org/kbuild/changeset?format=diff&new=3408&old=3407&new_path=%2Ftrunk&old_path=%2Ftrunk
--- a/src/kash/jobs.c
+++ b/src/kash/jobs.c
@@ -390,4 +390,5 @@
fmtstr(s + col, 16, "Done");
} else {
+ const char *pszSigNm;
#if JOBS
if (WIFSTOPPED(ps->status))
@@ -397,6 +398,7 @@
st = WTERMSIG(ps->status);
st &= 0x7f;
- if (st < NSIG && sys_siglist[st])
- scopyn(sys_siglist[st], s + col, 32);
+ pszSigNm = st < NSIG ? strsignal(st) : NULL;
+ if (pszSigNm)
+ scopyn(pszSigNm, s + col, 32);
else
fmtstr(s + col, 16, "Signal %d", st);
--- a/src/kash/shinstance.h
+++ b/src/kash/shinstance.h
@@ -381,10 +381,6 @@
/*# define SIGBREAK 21 */
/*# define SIGABRT 22 */
-
-# define sys_siglist sys_signame
+const char *strsignal(int iSig);
#endif /* _MSC_VER */
-#ifdef __sun__
-# define sys_siglist _sys_siglist
-#endif
#ifndef HAVE_SYS_SIGNAME
extern char sys_signame[NSIG][16];
--- a/src/kash/sys_signame.c
+++ b/src/kash/sys_signame.c
@@ -12,5 +12,5 @@
void init_sys_signame(void)
{
- unsigned i;
+ unsigned i;
if (sys_signame_initialized)
return;
@@ -120,2 +120,14 @@
sys_signame_initialized = 1;
}
+
+#if defined(_MSC_VER)
+const char *strsignal(int iSig)
+{
+ if (!sys_signame_initialized)
+ init_sys_signame();
+ if (iSig < NSIG)
+ return sys_signame(iSig);
+ return NULL;
+}
+#endif
+

View File

@@ -35,6 +35,7 @@ PATCHES=(
"${FILESDIR}/${PN}-0.1.9998_pre20120806-qa.patch"
"${FILESDIR}/${PN}-0.1.9998_pre20110817-kash-link-pthread.patch"
"${FILESDIR}/${PN}-0.1.9998.3407-gold.patch"
"${FILESDIR}/${PN}-0.1.9998.3407-glibc-2.32+.patch"
)
pkg_setup() {