Problem/Bug with binutils-gdb and strsignal ?

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Oct 26 20:03:27 GMT 2021


On Oct 24 08:26, Claudius Schnörr via Cygwin wrote:
>      o suggestion: undefining DEFS_H might be risky -> to be added at
>        line 55:
>          + #ifndef DEFS_H
>            #    include <string.h>             /* for strsignal on
>            cygwin */
>            #else
>            char *strsignal (int __signo);      /* see
>            /usr/include/string.h on cygwin */
>            #endif
>      o then it compiles, however a library is missed now:
>          + x86_64-pc-cygwin/bin/ld:
>            event-top.o:.../insight/bundle/gdb/event-top.c:899:
>            undefined reference to `strsignal(int)'
>            collect2: error: ld returned 1 exit status

Makes sense.  The GDB build uses a c++ compiler.  If you define strsignal
as above, c++ assumes it's a C++ symbol, so its name gets mangled per
the C++ mangling rules.  Given the symbol is a plain C symbol, you'd
have to specify this explicitely, i. e. 

  extern "C" char *strsignal (int __signo);

Anyway, this needs fixing in the system header.  There's a matching
thread on the newlib mailing list addressing this problem.


Thanks,
Corinna


More information about the Cygwin mailing list