[gnu-sol-discuss] Re: [osol-code] /usr/include/execinfo.h - Backtrace() - PSARC/2007/162
Bart Smaalders
bart.smaalders at Sun.COM
Mon Jun 25 10:00:08 PDT 2007
Joubert Nel wrote:
> Hi,
>
> The code comments for this code revision (http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/head/execinfo.h?r=3988) indicate this header file is for glibc backtrace compatibility.
>
> On Solaris 10 I used to compile a system (SBCL) with gcc 4.0.2, gmake 3.81, and gas 2.17 (GNU tools all from Blastwave).
>
> Now, on Solars 11 (Express, Developer 5/07 - i.e. Nevada 64a) x86-74, I get an error message as follows:
>
> gmake: Entering directory `/tank/downloads/sbcl-1.0.6/src/runtime'
> gcc -g -O2 -Wall -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -DSVR4
> -D_REENTRANT -I. -c -o alloc.o alloc.c
> gcc -g -O2 -Wall -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -DSVR4
> -D_REENTRANT -I. -c -o backtrace.o backtrace.c
> backtrace.c: In function 'altstack_pointer_p':
> backtrace.c:293: warning: comparison of distinct pointer types lacks a
> cast
> backtrace.c:293: warning: comparison of distinct pointer types lacks a
> cast
> backtrace.c: At top level:
> backtrace.c:579: error: conflicting types for 'backtrace'
> /usr/include/execinfo.h:41: error: previous declaration of 'backtrace'
> was here
> backtrace.c: In function 'backtrace':
> backtrace.c:581: warning: unused variable 'i'
> gmake: *** [backtrace.o] Error 1
> gmake: Leaving directory `/tank/downloads/sbcl-1.0.6/src/runtime'
>
> Of course, when I rename "backtrace" in the code that I'm trying to compile all works, but I'm wondering why this is now happening in Solaris 11 and whether it is perhaps a config issue on my part.
>
> In short - for this code to compile, do I *have* to rename "backtrace"?
>
Someone else ran into a similar problem with Ruby after my putback to
introduce backtrace() into Solaris.
I filed
6549846 backtrace() visibility after including ucontext.h breaks ruby
build
I fixed it in build 67.
The fix was simply to remove the include of execinfo.h from ucontext.h.
You may wish to do that manually until you install 67.
- Bart
--
Bart Smaalders Solaris Kernel Performance
barts at cyber.eng.sun.com http://blogs.sun.com/barts
More information about the gnu-sol-discuss
mailing list