Skip to content

Commit 9520425

Browse files
committed
Clear hardware capabilities on libstdc++.so with Sun as
* 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
1 parent 9081064 commit 9520425

File tree

15 files changed

+128
-46
lines changed

15 files changed

+128
-46
lines changed

libstdc++-v3/ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
2012-09-12 Rainer Orth <[email protected]>
2+
3+
* acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Define.
4+
* configure.ac: Call GLIBCXX_CHECK_ASSEMBLER_HWCAP.
5+
* fragment.am (CONFIG_CXXFLAGS): Add $(HWCAP_FLAGS).
6+
* configure: Regenerate.
7+
* Makefile.in: Regenerate.
8+
* doc/Makefile.in: Regenerate.
9+
* include/Makefile.in: Regenerate.
10+
* libsupc++/Makefile.in: Regenerate.
11+
* po/Makefile.in: Regenerate.
12+
* python/Makefile.in: Regenerate.
13+
* src/Makefile.in: Regenerate.
14+
* src/c++11/Makefile.in: Regenerate.
15+
* src/c++98/Makefile.in: Regenerate.
16+
* testsuite/Makefile.in: Regenerate.
17+
118
2012-09-11 Jakub Jelinek <[email protected]>
219

320
PR libstdc++/54172

libstdc++-v3/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ FGREP = @FGREP@
152152
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
153153
GLIBCXX_LIBS = @GLIBCXX_LIBS@
154154
GREP = @GREP@
155+
HWCAP_FLAGS = @HWCAP_FLAGS@
155156
INSTALL = @INSTALL@
156157
INSTALL_DATA = @INSTALL_DATA@
157158
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -296,7 +297,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
296297
# These bits are all figured out from configure. Look in acinclude.m4
297298
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
298299
CONFIG_CXXFLAGS = \
299-
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
300+
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
300301

301302
WARN_CXXFLAGS = \
302303
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once

libstdc++-v3/acinclude.m4

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,32 @@ AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [
168168
])
169169

170170

171+
dnl
172+
dnl Check if the assembler used supports disabling generation of hardware
173+
dnl capabilities. This is only supported by Sun as at the moment.
174+
dnl
175+
dnl Defines:
176+
dnl HWCAP_FLAGS='-Wa,-nH' if possible.
177+
dnl
178+
AC_DEFUN([GLIBCXX_CHECK_ASSEMBLER_HWCAP], [
179+
test -z "$HWCAP_FLAGS" && HWCAP_FLAGS=''
180+
181+
ac_save_CFLAGS="$CFLAGS"
182+
CFLAGS="$CFLAGS -Wa,-nH"
183+
184+
AC_MSG_CHECKING([for as that supports -Wa,-nH])
185+
AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
186+
if test "$ac_hwcap_flags" = "yes"; then
187+
HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS"
188+
fi
189+
AC_MSG_RESULT($ac_hwcap_flags)
190+
191+
CFLAGS="$ac_save_CFLAGS"
192+
193+
AC_SUBST(HWCAP_FLAGS)
194+
])
195+
196+
171197
dnl
172198
dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
173199
dnl the native linker is in use, all variables will be defined to something

libstdc++-v3/configure

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ BUILD_INFO_FALSE
639639
BUILD_INFO_TRUE
640640
baseline_subdir_switch
641641
baseline_dir
642+
HWCAP_FLAGS
642643
GLIBCXX_LDBL_COMPAT_FALSE
643644
GLIBCXX_LDBL_COMPAT_TRUE
644645
ENABLE_VISIBILITY_FALSE
@@ -11507,7 +11508,7 @@ else
1150711508
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1150811509
lt_status=$lt_dlunknown
1150911510
cat > conftest.$ac_ext <<_LT_EOF
11510-
#line 11510 "configure"
11511+
#line 11511 "configure"
1151111512
#include "confdefs.h"
1151211513

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

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

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

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

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

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

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

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

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

7064970650

70651+
# Check if assembler supports disabling hardware capability support.
70652+
70653+
test -z "$HWCAP_FLAGS" && HWCAP_FLAGS=''
70654+
70655+
ac_save_CFLAGS="$CFLAGS"
70656+
CFLAGS="$CFLAGS -Wa,-nH"
70657+
70658+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for as that supports -Wa,-nH" >&5
70659+
$as_echo_n "checking for as that supports -Wa,-nH... " >&6; }
70660+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
70661+
/* end confdefs.h. */
70662+
70663+
int
70664+
main ()
70665+
{
70666+
return 0;
70667+
;
70668+
return 0;
70669+
}
70670+
_ACEOF
70671+
if ac_fn_c_try_compile "$LINENO"; then :
70672+
ac_hwcap_flags=yes
70673+
else
70674+
ac_hwcap_flags=no
70675+
fi
70676+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
70677+
if test "$ac_hwcap_flags" = "yes"; then
70678+
HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS"
70679+
fi
70680+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_hwcap_flags" >&5
70681+
$as_echo "$ac_hwcap_flags" >&6; }
70682+
70683+
CFLAGS="$ac_save_CFLAGS"
70684+
70685+
70686+
70687+
7065070688
# Check if assembler supports rdrand opcode.
7065170689

7065270690
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rdrand support in assembler" >&5

libstdc++-v3/configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ case "$target" in
333333
esac
334334
GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT, test $ac_ldbl_compat = yes)
335335

336+
# Check if assembler supports disabling hardware capability support.
337+
GLIBCXX_CHECK_ASSEMBLER_HWCAP
338+
336339
# Check if assembler supports rdrand opcode.
337340
GLIBCXX_CHECK_X86_RDRAND
338341

libstdc++-v3/doc/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ FGREP = @FGREP@
124124
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
125125
GLIBCXX_LIBS = @GLIBCXX_LIBS@
126126
GREP = @GREP@
127+
HWCAP_FLAGS = @HWCAP_FLAGS@
127128
INSTALL = @INSTALL@
128129
INSTALL_DATA = @INSTALL_DATA@
129130
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -278,7 +279,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
278279
# These bits are all figured out from configure. Look in acinclude.m4
279280
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
280281
CONFIG_CXXFLAGS = \
281-
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
282+
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
282283

283284
WARN_CXXFLAGS = \
284285
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once

libstdc++-v3/fragment.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endif
2222
# These bits are all figured out from configure. Look in acinclude.m4
2323
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
2424
CONFIG_CXXFLAGS = \
25-
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
25+
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
2626
WARN_CXXFLAGS = \
2727
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once
2828

libstdc++-v3/include/Makefile.in

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Makefile.in generated by automake 1.11.3 from Makefile.am.
1+
# Makefile.in generated by automake 1.11.1 from Makefile.am.
22
# @configure_input@
33

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

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

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

12141214
installcheck: installcheck-am
12151215
install-strip:
1216-
if test -z '$(STRIP)'; then \
1217-
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1218-
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1219-
install; \
1220-
else \
1221-
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1222-
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1223-
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
1224-
fi
1216+
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1217+
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1218+
`test -z '$(STRIP)' || \
1219+
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
12251220
mostlyclean-generic:
12261221

12271222
clean-generic:

libstdc++-v3/libsupc++/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ FGREP = @FGREP@
184184
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
185185
GLIBCXX_LIBS = @GLIBCXX_LIBS@
186186
GREP = @GREP@
187+
HWCAP_FLAGS = @HWCAP_FLAGS@
187188
INSTALL = @INSTALL@
188189
INSTALL_DATA = @INSTALL_DATA@
189190
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -328,7 +329,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
328329
# These bits are all figured out from configure. Look in acinclude.m4
329330
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
330331
CONFIG_CXXFLAGS = \
331-
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
332+
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
332333

333334
WARN_CXXFLAGS = \
334335
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once

libstdc++-v3/po/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ FGREP = @FGREP@
124124
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
125125
GLIBCXX_LIBS = @GLIBCXX_LIBS@
126126
GREP = @GREP@
127+
HWCAP_FLAGS = @HWCAP_FLAGS@
127128
INSTALL = @INSTALL@
128129
INSTALL_DATA = @INSTALL_DATA@
129130
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -268,7 +269,7 @@ toolexeclibdir = $(glibcxx_toolexeclibdir)
268269
# These bits are all figured out from configure. Look in acinclude.m4
269270
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
270271
CONFIG_CXXFLAGS = \
271-
$(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
272+
$(SECTION_FLAGS) $(HWCAP_FLAGS) $(EXTRA_CXX_FLAGS) -frandom-seed=$@
272273

273274
WARN_CXXFLAGS = \
274275
$(WARN_FLAGS) $(WERROR_FLAG) -fdiagnostics-show-location=once

0 commit comments

Comments
 (0)