Skip to content

Commit

Permalink
Clear hardware capabilities on libstdc++.so with Sun as
Browse files Browse the repository at this point in the history
	* acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Define.
	* configure.ac: Call GLIBCXX_CHECK_ASSEMBLER_HWCAP.
	* fragment.am (CONFIG_CXXFLAGS): Add $(HWCAP_FLAGS).
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r191218
  • Loading branch information
rorth committed Sep 12, 2012
1 parent 9081064 commit 9520425
Show file tree
Hide file tree
Showing 15 changed files with 128 additions and 46 deletions.
17 changes: 17 additions & 0 deletions libstdc++-v3/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2012-09-12 Rainer Orth <[email protected]>

* acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Define.
* configure.ac: Call GLIBCXX_CHECK_ASSEMBLER_HWCAP.
* fragment.am (CONFIG_CXXFLAGS): Add $(HWCAP_FLAGS).
* configure: Regenerate.
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
* include/Makefile.in: Regenerate.
* libsupc++/Makefile.in: Regenerate.
* po/Makefile.in: Regenerate.
* python/Makefile.in: Regenerate.
* src/Makefile.in: Regenerate.
* src/c++11/Makefile.in: Regenerate.
* src/c++98/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

2012-09-11 Jakub Jelinek <[email protected]>

PR libstdc++/54172
Expand Down
3 changes: 2 additions & 1 deletion libstdc++-v3/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -296,7 +297,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down
26 changes: 26 additions & 0 deletions libstdc++-v3/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,32 @@ AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [
])


dnl
dnl Check if the assembler used supports disabling generation of hardware
dnl capabilities. This is only supported by Sun as at the moment.
dnl
dnl Defines:
dnl HWCAP_FLAGS='-Wa,-nH' if possible.
dnl
AC_DEFUN([GLIBCXX_CHECK_ASSEMBLER_HWCAP], [
test -z "$HWCAP_FLAGS" && HWCAP_FLAGS=''
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wa,-nH"
AC_MSG_CHECKING([for as that supports -Wa,-nH])
AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
if test "$ac_hwcap_flags" = "yes"; then
HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS"
fi
AC_MSG_RESULT($ac_hwcap_flags)
CFLAGS="$ac_save_CFLAGS"
AC_SUBST(HWCAP_FLAGS)
])


dnl
dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
dnl the native linker is in use, all variables will be defined to something
Expand Down
58 changes: 48 additions & 10 deletions libstdc++-v3/configure
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ BUILD_INFO_FALSE
BUILD_INFO_TRUE
baseline_subdir_switch
baseline_dir
HWCAP_FLAGS
GLIBCXX_LDBL_COMPAT_FALSE
GLIBCXX_LDBL_COMPAT_TRUE
ENABLE_VISIBILITY_FALSE
Expand Down Expand Up @@ -11507,7 +11508,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11510 "configure"
#line 11511 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -11613,7 +11614,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11616 "configure"
#line 11617 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -14994,7 +14995,7 @@ fi
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
#line 14997 "configure"
#line 14998 "configure"
struct S { ~S(); };
void bar();
void foo()
Expand Down Expand Up @@ -15329,7 +15330,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.

cat > conftest.$ac_ext << EOF
#line 15332 "configure"
#line 15333 "configure"
int main()
{
typedef bool atomic_type;
Expand Down Expand Up @@ -15364,7 +15365,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*

cat > conftest.$ac_ext << EOF
#line 15367 "configure"
#line 15368 "configure"
int main()
{
typedef short atomic_type;
Expand Down Expand Up @@ -15399,7 +15400,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*

cat > conftest.$ac_ext << EOF
#line 15402 "configure"
#line 15403 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
Expand Down Expand Up @@ -15435,7 +15436,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*

cat > conftest.$ac_ext << EOF
#line 15438 "configure"
#line 15439 "configure"
int main()
{
typedef long long atomic_type;
Expand Down Expand Up @@ -15514,7 +15515,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.

cat > conftest.$ac_ext << EOF
#line 15517 "configure"
#line 15518 "configure"
int main()
{
_Decimal32 d1;
Expand Down Expand Up @@ -15556,7 +15557,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.

cat > conftest.$ac_ext << EOF
#line 15559 "configure"
#line 15560 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
Expand Down Expand Up @@ -15590,7 +15591,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*

cat > conftest.$ac_ext << EOF
#line 15593 "configure"
#line 15594 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
Expand Down Expand Up @@ -70647,6 +70648,43 @@ $as_echo "#define _GLIBCXX_LONG_DOUBLE_COMPAT 1" >>confdefs.h
esac


# Check if assembler supports disabling hardware capability support.

test -z "$HWCAP_FLAGS" && HWCAP_FLAGS=''

ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wa,-nH"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for as that supports -Wa,-nH" >&5
$as_echo_n "checking for as that supports -Wa,-nH... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_hwcap_flags=yes
else
ac_hwcap_flags=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$ac_hwcap_flags" = "yes"; then
HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_hwcap_flags" >&5
$as_echo "$ac_hwcap_flags" >&6; }

CFLAGS="$ac_save_CFLAGS"




# Check if assembler supports rdrand opcode.

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rdrand support in assembler" >&5
Expand Down
3 changes: 3 additions & 0 deletions libstdc++-v3/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ case "$target" in
esac
GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT, test $ac_ldbl_compat = yes)

# Check if assembler supports disabling hardware capability support.
GLIBCXX_CHECK_ASSEMBLER_HWCAP

# Check if assembler supports rdrand opcode.
GLIBCXX_CHECK_X86_RDRAND

Expand Down
3 changes: 2 additions & 1 deletion libstdc++-v3/doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -278,7 +279,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down
2 changes: 1 addition & 1 deletion libstdc++-v3/fragment.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once

Expand Down
23 changes: 9 additions & 14 deletions libstdc++-v3/include/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Expand Down Expand Up @@ -124,6 +124,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -268,7 +269,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down Expand Up @@ -1177,7 +1178,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/fragment.am:

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
Expand Down Expand Up @@ -1213,15 +1213,10 @@ install-am: all-am

installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:
Expand Down
3 changes: 2 additions & 1 deletion libstdc++-v3/libsupc++/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -328,7 +329,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down
3 changes: 2 additions & 1 deletion libstdc++-v3/po/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -268,7 +269,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down
3 changes: 2 additions & 1 deletion libstdc++-v3/python/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -292,7 +293,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down
3 changes: 2 additions & 1 deletion libstdc++-v3/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ FGREP = @FGREP@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
HWCAP_FLAGS = @HWCAP_FLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -321,7 +322,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@

WARN_CXXFLAGS = \
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
Expand Down
Loading

0 comments on commit 9520425

Please sign in to comment.