aports/testing/openblas/0001-Use-strsignal-instead-of-sys_siglist.patch
Isaac Dunham f29238505f testing/openblas: update to 0.2.17
Attached is a patch to update testing/openblas to 0.2.17.

This required replacing one use of sys_siglist[] with strsignal().

Also, due to some convolutions of the build system, setting CFLAGS in
the environment rather than passing it to make caused repeated definitions
of CNAME/ASMNAME/ASMFNAME/... in the gcc invocation, making for a very
noisy build.

Thanks,
Isaac Dunham
>From a629abe4458599ab57041e5158430e4db4736308 Mon Sep 17 00:00:00 2001
From: Isaac Dunham <ibid.ag@gmail.com>
Date: Fri, 25 Mar 2016 12:05:29 -0700
Subject: [PATCH] testing/openblas: update to 0.2.17

Use strsignal() instead of sys_siglist[].
While here, pass CFLAGS on the command line rather than in the environment
because the latter confuses make.
(This fixes all the warnings about CNAME/ASMNAME/... getting defined
multiple times.)
2016-03-31 07:12:04 +00:00

36 lines
1.2 KiB
Diff

From 518435f376fb7b1a1972ea44cd932f1314f34cbf Mon Sep 17 00:00:00 2001
From: Isaac Dunham <ibid.ag@gmail.com>
Date: Sat, 26 Mar 2016 21:37:36 -0700
Subject: [PATCH] Use strsignal() instead of sys_siglist[].
musl libc only implements strsignal().
POSIX 2008 requires strsignal() but not sys_siglist[], and glibc,
the BSDs, Solaris, and OS X support both.
I'm not sure about the status on mingw; as far as I can tell, they
define strsignal(x) as sys_siglist[x].
Also use snprintf() because it's not strictly guaranteed that signal
descriptions be any particular length.
I'm not aware of any signal descriptions over 114 bytes long, so this
is mostly paranoia.
---
utest/ctest.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utest/ctest.h b/utest/ctest.h
index a62103f..1deea32 100644
--- a/utest/ctest.h
+++ b/utest/ctest.h
@@ -637,7 +637,7 @@ static void *find_symbol(struct ctest *test, const char *fname)
static void sighandler(int signum)
{
char msg[128];
- sprintf(msg, "[SIGNAL %d: %s]", signum, sys_siglist[signum]);
+ snprintf(msg, sizeof(msg), "[SIGNAL %d: %s]", signum, strsignal(signum));
color_print(ANSI_BRED, msg);
fflush(stdout);
--
2.7.4