Add -fno-common where supported (WAF only)

Andrew Bartlett abartlet at samba.org
Mon May 16 07:30:10 MDT 2011


On Sun, 2011-05-15 at 16:36 +0930, Rusty Russell wrote:
> On Thu, 12 May 2011 16:43:04 +0200, Andrew Bartlett <abartlet at samba.org> wrote:
> > On Tue, 2011-05-10 at 05:22 +0200, Rusty Russell wrote:
> > > 
> > >     Add -fno-common where supported (WAF only)
> > >     
> > >     Normally under UNIX, uninitialized non-static global variables get
> > >     placed in the "common" section, where they are merged at link
> > > time.
> > >     This means if two C files define "int debug", they will end up
> > >     referring to the same variable.  Or if one does "float level" and
> > > the
> > >     other does "int level" you'll get an accidental union.
> > >     
> > >     Such bugs can be hard to track down; fortunately GCC offers
> > >     -fno-common to disable this feature.  It didn't reveal any places
> > >     which need fixing, however).
> > >     
> > >     Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
> > 
> > Rusty,
> > 
> > this breaks 'make SYMBOLCHECK=1', due to __progname in the setprogname
> > implementation in Heimdal.
> > 
> > Can you look into this, and determine if the Heimdal roken use was
> > invalid, or if it was deliberately referencing the __progname in the
> > system libs?  It is fatally reported as a duplicate with my system libs,
> > when I run that.
> 
> Thanks...
> 
> OK, if it wanted the one in the system libraries, it should be using
> 'extern const char *__progname;'.  The problem seems to be that you
> have __progname, yet this is getting compiled:
> 
> source4/heimdal/lib/roken/getprogname.c:
>         #ifndef HAVE___PROGNAME
>         const char *__progname;
>         #endif
> 
> We don't have a configuration test for HAVE___PROGNAME that I can tell,
> yet it seems it should be set on your system?

Oddly, this problem 'went away' with later compile runs.  I'll have to
dig into this a bit further. 

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list