This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: notes on current atomics config and usage


Paolo Carlini wrote:

> As pointed out be Benjamin yesterday, there is a problem of consistency
> between the atomics used inside in the library and those used in the
> headers. If the user passes -march=i386 and doesn't want unresolved
> symbols at link time the only ways are: 1- Inline the mutexes, or, 2-
> Call mutexes inside the library. However, inside the library the atomics
> are using builtins, not mutexes, and that is the mechanism used by the
> whole library in its functioning, thus there are problems of
> interoperation between the library code and the user code.

How is this different than any other situation with different
architectures?  If any library (GLIBC, say) is compiled with
-march=i686, and then the user tries to link to use it on an i386, bad
things will happen.  Ideally, the linker would give an error at that point.

If libstdc++ wants to support -march=i386, then you're going to need
multilibs.  And, inside the library, you have test feature macros; in
i386 mode, you use mutexes, everywhere, headers and source files.  In
i486+ mode, you use builtins.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]