notes on current atomics config and usage

Mark Mitchell mark@codesourcery.com
Fri Jul 14 06:36:00 GMT 2006


Benjamin Kosnik wrote:

> When you say "explicit -march" I am assuming you are talking about a
> CXXFLAGS="-march=foo" type thing. Is there any other way to pass this
> info? (CFLAGS, I guess.) There has to be a limit to the number of
> variables are scanned looking for this stuff.

I don't think you should be scanning anything. :-) You're guaranteed to
have a compiler you can run at this point.  So, you should run the
compiler, letting autoconf figure out what flags to pass to the
compiler; it's supposed to know.  (If autoconf is getting this wrong,
we're completely hosed on lots of levels.)

> One of the weaknesses of the above three-part plan is that with this in
> place, and somebody who builds libstdc++ with CXXFLAGS="-march=i686",
> then they get the builtin atomics. Cool: this is probably exactly what
> they were expecting.
> 
> However, if they install this as a system lib then all users are going
> to have to use the -march flag exactly as configured or else they'll
> get synthesized calls to non-existent builtin atomics functions. (since
> without the -march flag the default arch for this platform is i386,
> with no builtin atomics.)

I would say that this very sensible behavior. :-)  As you say, they
could instead hack the compiler to change the default arch, or they
could provide multilibs for different variants.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Libstdc++ mailing list