https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125197

--- Comment #18 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Eric Botcazou from comment #17)
> > And the issue is that the -m32 multilib of libstdc++.so has undefined
> > references to symbols like __atomic_sub_fetch_4, which means it depends on
> > libatomic.so, but the 32-bit libatomic.so assumes it's built for sparcv9. So
> > libstdc++.so is built to work on older hardware by using libatomic.so
> > instead of native v9 instructions, but libatomic.so doesn't actually work on
> > older hardware.
> 
> Why is the atomic_flags setting apparently not respected in libstdc++.so?
> 
> # Set specific CPU overrides for atomic_word_dir and atomic_flags. 
> # Most can just use generic.
> # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
> case "${host_cpu}" in
>   cris*)
>     atomic_word_dir=cpu/cris
>     ;;
>   i[4567]86 | x86_64)
>     atomic_flags="-march=native"
>     ;;
>   sparc* | ultrasparc)
>     atomic_word_dir=cpu/sparc
>     atomic_flags="-mcpu=v9"
>     ;;
> esac

This is for testing only.  We certainly can't build libstdc++ with
-march=native
on x86-64 by default.

Reply via email to