tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
cernlib: fix build w/glibc-2.32
Maximilian Bosch
5 years ago
4ba59baf
c60a09b4
+95
-1
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
physics
cernlib
0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch
default.nix
+94
pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch
reviewed
···
1
1
+
From a69607c511b6da94cde477283b129cbc9cfdd5a3 Mon Sep 17 00:00:00 2001
2
2
+
From: Maximilian Bosch <maximilian@mbosch.me>
3
3
+
Date: Tue, 11 Aug 2020 12:32:06 +0200
4
4
+
Subject: [PATCH] Use `strerror` rather than `sys_errlist` to fix compilation
5
5
+
w/glibc-2.32
6
6
+
7
7
+
To quote the release-notes[1]:
8
8
+
9
9
+
All programs should use
10
10
+
strerror or strerror_r instead.
11
11
+
12
12
+
[1] https://sourceware.org/pipermail/libc-announce/2020/000029.html
13
13
+
---
14
14
+
2006/src/packlib/cspack/sysreq/serror.c | 10 +---------
15
15
+
2006/src/packlib/cspack/sysreq/socket.c | 2 +-
16
16
+
2006/src/packlib/kernlib/kernbit/z268/systems.c | 4 ++--
17
17
+
2006/src/pawlib/paw/piafs/piafc.c | 5 +----
18
18
+
4 files changed, 5 insertions(+), 16 deletions(-)
19
19
+
20
20
+
diff --git a/2006/src/packlib/cspack/sysreq/serror.c b/2006/src/packlib/cspack/sysreq/serror.c
21
21
+
index 3667c42a..c560e499 100644
22
22
+
--- a/2006/src/packlib/cspack/sysreq/serror.c
23
23
+
+++ b/2006/src/packlib/cspack/sysreq/serror.c
24
24
+
@@ -176,15 +176,7 @@ int n;
25
25
+
}
26
26
+
else {
27
27
+
#if !defined(vms)
28
28
+
- if ((n>0) && (n<sys_nerr)) {
29
29
+
- return(sys_errlist[n]);
30
30
+
- }
31
31
+
- else {
32
32
+
- (void) sprintf(buf,"%s: %d\n",
33
33
+
- sys_serrlist[SEMAXERR+1-SEBASEOFF],
34
34
+
- n);
35
35
+
- return(buf);
36
36
+
- }
37
37
+
+ return strerror(n);
38
38
+
#else /* vms */
39
39
+
/*
40
40
+
* There are (were) some bugs is DEC C compilers (/OPT), just check
41
41
+
diff --git a/2006/src/packlib/cspack/sysreq/socket.c b/2006/src/packlib/cspack/sysreq/socket.c
42
42
+
index ceb5bd63..34c2a7bc 100644
43
43
+
--- a/2006/src/packlib/cspack/sysreq/socket.c
44
44
+
+++ b/2006/src/packlib/cspack/sysreq/socket.c
45
45
+
@@ -412,7 +412,7 @@ char *
46
46
+
s_errmsg() /* return last error message */
47
47
+
{
48
48
+
#if !defined(vms)
49
49
+
- return(sys_errlist[errno]);
50
50
+
+ return(strerror(errno));
51
51
+
#else /* vms */
52
52
+
#if defined(MULTINET) && (MULTINET == 1)
53
53
+
return(vms_errno_string());
54
54
+
diff --git a/2006/src/packlib/kernlib/kernbit/z268/systems.c b/2006/src/packlib/kernlib/kernbit/z268/systems.c
55
55
+
index 98459459..d1ad63ed 100644
56
56
+
--- a/2006/src/packlib/kernlib/kernbit/z268/systems.c
57
57
+
+++ b/2006/src/packlib/kernlib/kernbit/z268/systems.c
58
58
+
@@ -134,7 +134,7 @@ int *ovflw;
59
59
+
#endif /* hpux */
60
60
+
61
61
+
if ( (ps=(FILE *)popen(command,"r"))==NULL ) {
62
62
+
- fprintf(stderr,"systems(): popen(): %s\n",sys_errlist[errno] );
63
63
+
+ fprintf(stderr,"systems(): popen(): %s\n",strerror(errno) );
64
64
+
*rc= -errno;
65
65
+
*chars=0 ;
66
66
+
*l=0 ;
67
67
+
@@ -144,7 +144,7 @@ int *ovflw;
68
68
+
rcode = fread(buf, 1, buflen , ps );
69
69
+
if ( rcode < 0 ) {
70
70
+
fprintf(stderr,"systems(): pipe fread(): %s\n",
71
71
+
- sys_errlist[errno] );
72
72
+
+ strerror(errno) );
73
73
+
buf[0]='\n';
74
74
+
*rc= -errno;
75
75
+
*chars=0 ;
76
76
+
diff --git a/2006/src/pawlib/paw/piafs/piafc.c b/2006/src/pawlib/paw/piafs/piafc.c
77
77
+
index b163f80c..4d8d5528 100644
78
78
+
--- a/2006/src/pawlib/paw/piafs/piafc.c
79
79
+
+++ b/2006/src/pawlib/paw/piafs/piafc.c
80
80
+
@@ -1795,10 +1795,7 @@ static void fatalperror(char *msg)
81
81
+
extern char *sys_errlist[];
82
82
+
#endif
83
83
+
84
84
+
- if ((unsigned) errno < sys_nerr)
85
85
+
- sprintf(buf, "%s: %s", msg, sys_errlist[errno]);
86
86
+
- else
87
87
+
- sprintf(buf, "%s: Error %d", msg, errno);
88
88
+
+ sprintf(buf, "%s: %s", msg, strerror(errno));
89
89
+
90
90
+
fatal(buf);
91
91
+
}
92
92
+
--
93
93
+
2.25.4
94
94
+
+1
-1
pkgs/development/libraries/physics/cernlib/default.nix
reviewed
···
16
16
nativeBuildInputs = [ gnumake imake makedepend ];
17
17
sourceRoot = ".";
18
18
19
19
-
patches = [ ./patch.patch ];
19
19
+
patches = [ ./patch.patch ./0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch ];
20
20
21
21
postPatch = ''
22
22
substituteInPlace 2006/src/config/site.def \