develooper Front page | perl.perl5.porters | Postings from March 2007

Re: g++ on FreeBSD

Thread Previous | Thread Next
From:
Andrew Dougherty
Date:
March 27, 2007 14:54
Subject:
Re: g++ on FreeBSD
Message ID:
Pine.LNX.4.62.0703271720240.27058@fractal.phys.lafayette.edu
On Tue, 27 Mar 2007, Nicholas Clark wrote:

> On Tue, Mar 27, 2007 at 09:24:57PM +0100, Nicholas Clark wrote:
> > On Tue, Mar 27, 2007 at 02:32:28PM -0400, Andy Dougherty wrote:
> > > One reason Linux can get away with this is that it HAS_STRERROR is 
> > > defined, so this section of perl.h never gets invoked.
> > > 
> > > On FreeBSD, with g++, what do you get for
> > > 
> > > 	grep err config.sh
> > > 
> > > (I'm particularly interested in d_strerror, but may eventually wonder 
> > > about the others too, so I might as well see them all at once.)
> > $ grep err config.sh
> > 
> > d_dlerror='define'
> > d_strerrm='strerror(e)'
> > d_strerror='define'
> > d_strerror_r='define'
> > d_syserrlst='define'
> > i_neterrno='undef'
> > strerror_r_proto='REENTRANT_PROTO_I_IBW'
> > 
> > Odd.
> 
> But if I use g++ as my C compiler:
> 
> d_dlerror='undef'
> d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
> d_strerror='undef'
> d_strerror_r='undef'
> d_syserrlst='define'
> i_neterrno='undef'
> strerror_r_proto='0'
> 
> mmm. Houston, we have a problem.

Ok.  This is what I was expecting, though I don't understand it.  I wonder 
why we're not seeing strerror() with g++?  More broadly, are there lots of 
other differences between the gcc and g++ config.sh files?  (Especially 
the d_* defines.)  I'm especially curious about ones like d_vprintf and 
d_socket, which use the same "eval $csym" method.  I'm now wondering if 
the whole nm-extraction plan isn't working because we're missing the C++ 
libraries.

Maybe it'd be easier if you just ship me copies of config.sh generated by 
'gcc' and by 'g++' (each from a fresh tree, of course).  Then I can stare 
at them and try to guess at what's happening.

We can certainly work around this particular sys_errlist declaration 
problem (and we should, and I intend to do so) but first it might be 
better to understand how we got into this problem in the first place.

-- 
    Andy Dougherty		doughera@lafayette.edu

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About