Skip to content

Commit

Permalink
[HACK] libstdc++: Force atomic builtin checks to use sparc v8
Browse files Browse the repository at this point in the history
This in effect forces libstdc++ to refuse to use the atomic builtins
unless they're going to work across a more sensible range of CPU
configurations.  Without this hack libstdc++ detects that they're
present with the default cpu (presumably v9, even 32bit) and instead
fails at link-time for non-v9 code.
  • Loading branch information
richlowe committed Jun 27, 2011
1 parent bb64a8a commit 44c4071
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libstdc++-v3/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2444,7 +2444,11 @@ AC_DEFUN([GLIBCXX_ENABLE_ATOMIC_BUILTINS], [
old_CXXFLAGS="$CXXFLAGS"
# Compile unoptimized.
CXXFLAGS='-O0 -S'
# XXX: On sparc, use the lowest practical CPU level # to avoid false positives
case $host in
sparc*-*solaris*) CXXFLAGGS='-O0 -S -mcpu=v8';;
*) CXXFLAGS='-O0 -S';;
esac
# Fake what AC_TRY_COMPILE does, without linking as this is
# unnecessary for a builtins test.
Expand Down
6 changes: 5 additions & 1 deletion libstdc++-v3/configure
Original file line number Diff line number Diff line change
Expand Up @@ -14758,7 +14758,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
old_CXXFLAGS="$CXXFLAGS"

# Compile unoptimized.
CXXFLAGS='-O0 -S'
# XXX: On sparc, use the lowest practical CPU level # to avoid false positives
case $host in
sparc*-*solaris*) CXXFLAGS='-O0 -S -mcpu=v8';;
*) CXXFLAGS='-O0 -S';;
esac

# Fake what AC_TRY_COMPILE does, without linking as this is
# unnecessary for a builtins test.
Expand Down

0 comments on commit 44c4071

Please sign in to comment.