Created attachment 675775 [details] build.log sci-electronics/ngspice-27-r1 fails to build with the following errors: In file included from plot5.c:5: plot5.c: In function ‘Plt5_NewViewport’: ../../../src/include/ngspice/ngspice.h:311:60: error: ‘sys_errlist’ undeclared (first use in this function) 311 | #define perror(string) fprintf(stderr, "%s: %s\n", string, sys_errlist[errno]) | ^~~~~~~~~~~ gnuplot.c:129:9: note: in expansion of macro ‘perror’ 129 | perror(filename); | ^~~~~~ ../../../src/include/ngspice/ngspice.h:311:60: note: each undeclared identifier is reported only once for each function it appears in 311 | #define perror(string) fprintf(stderr, "%s: %s\n", string, sys_errlist[errno]) | ^~~~~~~~~~~ gnuplot.c:129:9: note: in expansion of macro ‘perror’ 129 | perror(filename); | ^~~~~~ ../../../src/include/ngspice/ngspice.h:311:60: error: ‘sys_errlist’ undeclared (first use in this function) 311 | #define perror(string) fprintf(stderr, "%s: %s\n", string, sys_errlist[errno]) | ^~~~~~~~~~~ plot5.c:50:9: note: in expansion of macro ‘perror’ 50 | perror((char*) graph->devdep); | ^~~~~~ ../../../src/include/ngspice/ngspice.h:311:60: note: each undeclared identifier is reported only once for each function it appears in 311 | #define perror(string) fprintf(stderr, "%s: %s\n", string, sys_errlist[errno]) | ^~~~~~~~~~~ plot5.c:50:9: note: in expansion of macro ‘perror’ 50 | perror((char*) graph->devdep); | ^~~~~~ gnuplot.c: In function ‘ft_writesimple’: ../../../src/include/ngspice/ngspice.h:311:60: error: ‘sys_errlist’ undeclared (first use in this function) 311 | #define perror(string) fprintf(stderr, "%s: %s\n", string, sys_errlist[errno]) | ^~~~~~~~~~~ gnuplot.c:360:9: note: in expansion of macro ‘perror’ 360 | perror(filename); | ^~~~~~
Created attachment 675778 [details] emerge --info
Created attachment 675781 [details] emerge -pqv
Created attachment 675784 [details] environment
Created attachment 675790 [details, diff] Patch candidate This patch seems to solve the problem (it builds). However I need to emphasize that I have no idea what sys_errlist was supposed to be, some old relic of libc or w/e. Someone who actually knows what's going on please review. ***REVIEW REQUESTED***
According to: https://sourceware.org/pipermail/libc-announce/2020/000029.html "The GNU C Library version 2.32 is now available ... * The deprecated symbols sys_errlist, _sys_errlist, sys_nerr, and _sys_nerr are no longer available to newly linked binaries, and their declarations have been removed from from <stdio.h>. They are exported solely as compatibility symbols to support old binaries. All programs should use strerror or strerror_r instead. " /// In comment 4, Alex wounders what sys_errlist is. If you do $ man 2 stat there is a header named "ERRORS" with items like "EACCES". Thoose constants (integers) are defined in files like /usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h describing what went wrong with a system call, e.g. $ grep EACCES asm-generic/errno*h asm-generic/errno-base.h:#define EACCES 13 /* Permission denied */ The sys_errlist[] was a way to convert that number (13) to the string "Permission denied" so the programmer can print out some hopeful text to explain what went wrong, e.g. $ rm -f /etc/passwd rm: cannot remove '/etc/passwd': Permission denied
Thank you Karl, you found the documentation to support what I did. Looks like I took the right action by instinct, I say review complete from my side and suggest that this patch be put into production.
(In reply to Alex Orange from comment #6) > Thank you Karl, you found the documentation to support what I did. Looks > like I took the right action by instinct, I say review complete from my side > and suggest that this patch be put into production. I can confirm that this patch works. This should be fixed upstream in my opinion.
Has anyone sent this upstream-upstream?
This actually seems to be fixed in ngspice-34 at least!