Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[HACK] libstdc++: Force atomic builtin checks to use sparc v8

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...
commit 44c407188f47a48288260678c905628797a5f859 1 parent bb64a8a
@richlowe richlowe authored
Showing with 10 additions and 2 deletions.
  1. +5 −1 libstdc++-v3/acinclude.m4
  2. +5 −1 libstdc++-v3/configure
View
6 libstdc++-v3/acinclude.m4
@@ -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.
View
6 libstdc++-v3/configure
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.