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:

Paolo Carlini wrote:

It does allow for CXXFLAGS="-march=native" to D.T.R.T., as discussed earlier today.

I particularly like the idea that if one makes sure to have CXXFLAGS set when configure is run, then the atomic builtins are automatically picked by the configure test. This is a nice advantage (unrelated to making maintainance easier) wrt the hardcoded approach in place before. Makes perfect sense, indeed, and is already used outside libstdc++.

As a side note, I want to add that this possibility should be exploited only by careful people: if one configures and builds with CXXFLAGS="-march=i686" then _GLIBCXX_ATOMIC_BUILTINS is defined and afterwards, if the user code is not *always* compiled using the same settings the __sync_fetch_and_add calls remain unresolved. Maybe at some point we want to add a short note to the docs about this...

Never mind: I see only now that in this conservative version of the patch you can only force the library to use the i386 configuration (passing i386), you cannot force it to use the atomic builtins, because you didn't remove the cpu/i486 config and the autoconf test is used only when cpu/generic would be otherwise selected. Yes, for now at least better this safe, conservative change ...


Paolo.


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