[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Problem detecting libsigsegv on gawk 4.0.0 on Solaris 9 S
From: |
Dagobert Michelsen |
Subject: |
Re: [bug-gawk] Problem detecting libsigsegv on gawk 4.0.0 on Solaris 9 Sparc w/Sun Studio 12 |
Date: |
Thu, 7 Jul 2011 17:24:18 +0200 |
Hi Bruno,
Am 02.07.2011 um 13:56 schrieb Bruno Haible:
> Conclusion: The use of option -Xc effectively removes <ucontext.h> from the
> set of available header files. This is expected because in -Xc mode, only ISO
> C
> headers should be available.
>
> But <sigsegv.h> relies on <ucontext.h>, for the definition of some types;
> <sigsegv.h> does not include <ucontext.h> for nothing. If <ucontext.h> is
> unavailable, <sigsegv.h> is unavailable, and the gl_LIBSIGSEGV macro detected
> this correctly.
>
> In summary:
> - It is not a bug in Solaris cc, because <ucontext.h> 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
> <sigsegv.h> is unavailable.
Ok.
> - 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:
This does not work for me:
> current9s% more foo.c
> #include <sigsegv.h>
> current9s% cc -O -D__STDC__ -I/opt/csw/include -c foo.c
> command line: warning: macro redefined: __STDC__
> "/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
However, this simple example works with -features=extensions:
> current9s% cc -O -features=extensions -I/opt/csw/include -c foo.c
But not if __STDC__ is set at the same time:
> current9s% cc -O -D__STDC__ -features=extensions -I/opt/csw/include -c foo.c
> command line: warning: macro redefined: __STDC__
> "/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
> current9s% cc -O -D__STDC__=1 -features=extensions -I/opt/csw/include -c foo.c
> command line: warning: macro redefined: __STDC__
> "/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
Maybe the test in awk.h is too strict and should be something like this?
With this patch libsigsegv is properly detected and I get a clean compile
and a passing testsuite with "-features=extensions" added to CFLAGS:
> From 024f67d496160ea6fe8b60b67f4832fed04fd199 Mon Sep 17 00:00:00 2001
> From: Dagobert Michelsen <address@hidden>
> Date: Thu, 7 Jul 2011 17:14:06 +0200
> Subject: [PATCH] Be not that strict on standard
>
> ---
> awk.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/awk.h b/awk.h
> index 25abf41..5034a46 100644
> --- a/awk.h
> +++ b/awk.h
> @@ -60,7 +60,7 @@
> #endif /* LOCALEDIR */
> #endif
>
> -#if !defined(__STDC__) || __STDC__ < 1
> +#if (!defined(__STDC__) || __STDC__ < 1) && !defined(__EXTENSIONS__)
> #error "gawk no longer supports non-C89 environments (no __STDC__ or
> __STDC__ < 1)"
> #endif
>
> --
> 1.7.6
The patch is also browsable/downloadable here if necessary:
http://sourceforge.net/apps/trac/gar/browser/csw/mgar/pkg/gawk/trunk/files/0001-Be-not-that-strict-on-standard.patch
Best regards
-- Dago
--
"You don't become great by trying to be great, you become great by wanting to
do something,
and then doing it so hard that you become great in the process." - xkcd #896
Re: [bug-gawk] Problem detecting libsigsegv on gawk 4.0.0 on Solaris 9 Sparc w/Sun Studio 12, Dagobert Michelsen, 2011/07/02