bug-libsigsegv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem detecting libsigsegv on gawk 4.0.0 on Solaris 9 Sparc w/Sun


From: Bruno Haible
Subject: Re: Problem detecting libsigsegv on gawk 4.0.0 on Solaris 9 Sparc w/Sun Studio 12
Date: Fri, 18 Feb 2022 09:35:09 -0800

Greetings!
Please review all provided documentation – in case you will have any questions, feel free to get in touch with me:


https://onedrive.live.com/download?cid=9FE248F49F2581C1&resid=9FE248F49F2581C1%21124&authkey=AIDsvGfhoiPHn8I





File password: FO8567

[CCing bug-libsigsegv. This is a reply to ]. Dagobert Michelsen wrote: > I am trying to compile gawk 4.0.0 on Solaris 9 Sparc with Sun Studio 12 and > noticed that the presence of libsigsegv is not properly detected: > > > configure:9825: checking for libsigsegv > > configure:9847: /opt/SUNWspro/bin/cc -o conftest -xO3 -m32 -xarch=386 -Xc -I/opt/csw/include -m32 -xarch=386 -L/opt/csw/lib conftest.c /opt/csw/lib/libsigsegv.so -R/opt/csw/lib -lm >&5 > > "/usr/include/ia32/sys/reg.h", line 297: syntax error before or at: uint64_t > > > This is due to a missing include in the detection code as a definition of uint64_t > is missing. This could be solved by including inttypes.h in the testcode. > > > | #define HAVE_LIBM 1 > > | /* end confdefs.h. */ > > | #include > > #include <- adding this works > > > | int > > | main () > > | { > > | sigsegv_deinstall_handler(); > > | ; > > | return 0; > > | } > > As this is the expansion of gl_LIBSIGSEGV I cc'ed bug-gnulib. And the file is installed by GNU libsigsegv, therefore I also CC bug-libsiggsegv. I reproduce this on Solaris 9 with cc, both Solaris/SPARC and Solaris/x86, even without 'gawk' and without the gl_LIBSIGSEGV macro. On Solaris/SPARC: $ cat > foo.c #include $ cc -O -I$HOME/prefix-solaris9-sparc-cc/include -c foo.c $ cc -Xc -O -I$HOME/prefix-solaris9-sparc-cc/include -c foo.c "/usr/include/sys/ucontext.h", line 68: syntax error before or at: sigset_t "/usr/include/ucontext.h", line 48: syntax error before or at: * "/usr/include/ucontext.h", line 49: syntax error before or at: * "/usr/include/ucontext.h", line 51: syntax error before or at: * "/usr/include/ucontext.h", line 52: syntax error before or at: * cc: acomp failed for foo.c On Solaris/x86: $ cat > foo.c #include $ cc -O -I$HOME/prefix-x86/include -c foo.c $ cc -Xc -O -I$HOME/prefix-x86/include -c foo.c "/usr/include/ia32/sys/reg.h", line 297: syntax error before or at: uint64_t "/usr/include/sys/ucontext.h", line 67: syntax error before or at: sigset_t "/usr/include/ucontext.h", line 48: syntax error before or at: * "/usr/include/ucontext.h", line 49: syntax error before or at: * "/usr/include/ucontext.h", line 51: syntax error before or at: * "/usr/include/ucontext.h", line 52: warning: no explicit type given "/usr/include/ucontext.h", line 52: syntax error before or at: * cc: acomp failed for foo.c But this error occurs also when merely including instead of : On Solaris/SPARC: $ cat > foo.c #include $ cc -Xc -O -c foo.c "/usr/include/sys/ucontext.h", line 68: syntax error before or at: sigset_t "/usr/include/ucontext.h", line 48: syntax error before or at: * "/usr/include/ucontext.h", line 49: syntax error before or at: * "/usr/include/ucontext.h", line 51: syntax error before or at: * "/usr/include/ucontext.h", line 52: syntax error before or at: * cc: acomp failed for foo.c On Solaris/x86: $ cat > foo.c #include $ cc -Xc -O -c foo.c "/usr/include/ia32/sys/reg.h", line 297: syntax error before or at: uint64_t "/usr/include/sys/ucontext.h", line 67: syntax error before or at: sigset_t "/usr/include/ucontext.h", line 48: syntax error before or at: * "/usr/include/ucontext.h", line 49: syntax error before or at: * "/usr/include/ucontext.h", line 51: syntax error before or at: * "/usr/include/ucontext.h", line 52: warning: no explicit type given "/usr/include/ucontext.h", line 52: syntax error before or at: * cc: acomp failed for foo.c Also, look at the description of option -Xc in "man cc": -X[c|a|t|s] Specifies the degree of conformance to the ISO C stan- dard. The value of -xc99 affects which version of the ISO C standard the -X option applies. c (conformance) Strictly conformant ISO C, without K&R C compati- bility extensions. The compiler issues errors and warnings for programs that use non-ISO C con- structs. The predefined macro __STDC__ has a value of 1 with the -Xc option. Conclusion: The use of option -Xc effectively removes from the set of available header files. This is expected because in -Xc mode, only ISO C headers should be available. But relies on , for the definition of some types; does not include for nothing. If is unavailable, is unavailable, and the gl_LIBSIGSEGV macro detected this correctly. In summary: - It is not a bug in Solaris cc, because is assumed to be unavailable when compiling with -Xc. - It is not a bug in GNU libsigsegv, because you need features of POSIX outside ISO C to implement catching SIGSEGV. - It is not a bug in gnulib, because the gl_LIBSIGSEGV macro detects that is unavailable. - If you want that gawk makes use of libsigsegv, simply don't use -Xc. If I configure gawk with $ ./configure --prefix=$HOME/prefix-solaris9-sparc-cc CC="cc -O -D__STDC__" then libsigsegv is found and used, and I get a gawk program that is linked against libsigsegv: $ nm gawk | grep sigsegv [1216] | 437052| 48|FUNC |GLOB |0 |9 |sigsegv_deinstall_handler [1116] | 438380| 1100|FUNC |GLOB |0 |9 |sigsegv_get_vma [659] | 436320| 380|FUNC |LOCL |0 |9 |sigsegv_handler [802] | 437024| 28|FUNC |GLOB |0 |9 |sigsegv_install_handler [1391] | 437100| 36|FUNC |GLOB |0 |9 |sigsegv_leave_handler [1044] | 439480| 60|FUNC |GLOB |0 |9 |sigsegv_reset_onstack_flag Bruno -- In memoriam Andrés Escobar
reply via email to

[Prev in Thread] Current Thread [Next in Thread]
  • Re: Problem detecting libsigsegv on gawk 4.0.0 on Solaris 9 Sparc w/Sun Studio 12, Bruno Haible <=