diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-08-11 13:02:04 +0200 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2020-09-12 23:04:44 +0200 |
commit | 4ba59baf97c3d57df76d90dc028d1ccd86e5ec12 (patch) | |
tree | 5d2b703288e57728cbca696acf808e98acdddc13 /pkgs/development/libraries/physics | |
parent | c60a09b49847db3724616eeb0558905c8ff4b3d2 (diff) |
cernlib: fix build w/glibc-2.32
Diffstat (limited to 'pkgs/development/libraries/physics')
-rw-r--r-- | pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch | 94 | ||||
-rw-r--r-- | pkgs/development/libraries/physics/cernlib/default.nix | 2 |
2 files changed, 95 insertions, 1 deletions
diff --git a/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch b/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch new file mode 100644 index 0000000000000..bc8c77f913c62 --- /dev/null +++ b/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch @@ -0,0 +1,94 @@ +From a69607c511b6da94cde477283b129cbc9cfdd5a3 Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch <maximilian@mbosch.me> +Date: Tue, 11 Aug 2020 12:32:06 +0200 +Subject: [PATCH] Use `strerror` rather than `sys_errlist` to fix compilation + w/glibc-2.32 + +To quote the release-notes[1]: + + All programs should use + strerror or strerror_r instead. + +[1] https://sourceware.org/pipermail/libc-announce/2020/000029.html +--- + 2006/src/packlib/cspack/sysreq/serror.c | 10 +--------- + 2006/src/packlib/cspack/sysreq/socket.c | 2 +- + 2006/src/packlib/kernlib/kernbit/z268/systems.c | 4 ++-- + 2006/src/pawlib/paw/piafs/piafc.c | 5 +---- + 4 files changed, 5 insertions(+), 16 deletions(-) + +diff --git a/2006/src/packlib/cspack/sysreq/serror.c b/2006/src/packlib/cspack/sysreq/serror.c +index 3667c42a..c560e499 100644 +--- a/2006/src/packlib/cspack/sysreq/serror.c ++++ b/2006/src/packlib/cspack/sysreq/serror.c +@@ -176,15 +176,7 @@ int n; + } + else { + #if !defined(vms) +- if ((n>0) && (n<sys_nerr)) { +- return(sys_errlist[n]); +- } +- else { +- (void) sprintf(buf,"%s: %d\n", +- sys_serrlist[SEMAXERR+1-SEBASEOFF], +- n); +- return(buf); +- } ++ return strerror(n); + #else /* vms */ + /* + * There are (were) some bugs is DEC C compilers (/OPT), just check +diff --git a/2006/src/packlib/cspack/sysreq/socket.c b/2006/src/packlib/cspack/sysreq/socket.c +index ceb5bd63..34c2a7bc 100644 +--- a/2006/src/packlib/cspack/sysreq/socket.c ++++ b/2006/src/packlib/cspack/sysreq/socket.c +@@ -412,7 +412,7 @@ char * + s_errmsg() /* return last error message */ + { + #if !defined(vms) +- return(sys_errlist[errno]); ++ return(strerror(errno)); + #else /* vms */ + #if defined(MULTINET) && (MULTINET == 1) + return(vms_errno_string()); +diff --git a/2006/src/packlib/kernlib/kernbit/z268/systems.c b/2006/src/packlib/kernlib/kernbit/z268/systems.c +index 98459459..d1ad63ed 100644 +--- a/2006/src/packlib/kernlib/kernbit/z268/systems.c ++++ b/2006/src/packlib/kernlib/kernbit/z268/systems.c +@@ -134,7 +134,7 @@ int *ovflw; + #endif /* hpux */ + + if ( (ps=(FILE *)popen(command,"r"))==NULL ) { +- fprintf(stderr,"systems(): popen(): %s\n",sys_errlist[errno] ); ++ fprintf(stderr,"systems(): popen(): %s\n",strerror(errno) ); + *rc= -errno; + *chars=0 ; + *l=0 ; +@@ -144,7 +144,7 @@ int *ovflw; + rcode = fread(buf, 1, buflen , ps ); + if ( rcode < 0 ) { + fprintf(stderr,"systems(): pipe fread(): %s\n", +- sys_errlist[errno] ); ++ strerror(errno) ); + buf[0]='\n'; + *rc= -errno; + *chars=0 ; +diff --git a/2006/src/pawlib/paw/piafs/piafc.c b/2006/src/pawlib/paw/piafs/piafc.c +index b163f80c..4d8d5528 100644 +--- a/2006/src/pawlib/paw/piafs/piafc.c ++++ b/2006/src/pawlib/paw/piafs/piafc.c +@@ -1795,10 +1795,7 @@ static void fatalperror(char *msg) + extern char *sys_errlist[]; + #endif + +- if ((unsigned) errno < sys_nerr) +- sprintf(buf, "%s: %s", msg, sys_errlist[errno]); +- else +- sprintf(buf, "%s: Error %d", msg, errno); ++ sprintf(buf, "%s: %s", msg, strerror(errno)); + + fatal(buf); + } +-- +2.25.4 + diff --git a/pkgs/development/libraries/physics/cernlib/default.nix b/pkgs/development/libraries/physics/cernlib/default.nix index 8c4d688b697ec..3c2cd4c69145b 100644 --- a/pkgs/development/libraries/physics/cernlib/default.nix +++ b/pkgs/development/libraries/physics/cernlib/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ gnumake imake makedepend ]; sourceRoot = "."; - patches = [ ./patch.patch ]; + patches = [ ./patch.patch ./0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch ]; postPatch = '' substituteInPlace 2006/src/config/site.def \ |