Centralise clearing hardware capabilities with Sun ld
gcc: * configure.ac ($gcc_cv_ld_clearcap): New test. * configure: Regenerate. * config.in: Regenerate. * config/sol2.opt (mclear-hwcap): New option. * config/sol2.h (LINK_CLEARCAP_SPEC): Define. * config/sol2-clearcap.map: Moved here from testsuite/gcc.target/i386/clearcap.map. * config/sol2-clearcapv2.map: Move here from gcc.target/i386/clearcapv2.map. * config/t-sol2 (install): Depend on install-clearcap-map. (install-clearcap-map): New target. * doc/invoke.texi (Option Summary, Solaris 2 Options): Document -mclear-hwcap. gcc/testsuite: * lib/clearcap.exp: New file. * gcc.dg/vect/vect.exp: Load clearcap.exp. Remove clearcap_ldflags handling. Call clearcap-init, clearcap-finish. * gcc.target/i386/i386.exp: Likewise. * gcc.target/i386/clearcap.map: Move to ../config/sol2-clearcap.map. * gcc.target/i386/clearcapv2.map: Move to ../config/sol2-clearcapv2.map. * gcc.target/x86_64/abi/avx/abi-avx.exp: Likewise. * gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Likewise. libitm: * acinclude.m4 (LIBITM_CHECK_LINKER_HWCAP): Check for -mclear-hwcap instead. * configure: Regenerate. * clearcap.map: Remove. From-SVN: r211014
This commit is contained in:
parent
4c8bd90f9f
commit
3c698bf09b
22 changed files with 243 additions and 115 deletions
|
@ -1,3 +1,19 @@
|
|||
2014-05-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* configure.ac ($gcc_cv_ld_clearcap): New test.
|
||||
* configure: Regenerate.
|
||||
* config.in: Regenerate.
|
||||
* config/sol2.opt (mclear-hwcap): New option.
|
||||
* config/sol2.h (LINK_CLEARCAP_SPEC): Define.
|
||||
* config/sol2-clearcap.map: Moved here from
|
||||
testsuite/gcc.target/i386/clearcap.map.
|
||||
* config/sol2-clearcapv2.map: Move here from
|
||||
gcc.target/i386/clearcapv2.map.
|
||||
* config/t-sol2 (install): Depend on install-clearcap-map.
|
||||
(install-clearcap-map): New target.
|
||||
* doc/invoke.texi (Option Summary, Solaris 2 Options): Document
|
||||
-mclear-hwcap.
|
||||
|
||||
2014-05-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* hwint.h (*_HALF_WIDE_INT*): Move to ...
|
||||
|
|
|
@ -1260,6 +1260,13 @@
|
|||
#endif
|
||||
|
||||
|
||||
/* Define if the linker supports clearing hardware capabilities via mapfile.
|
||||
*/
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_LD_CLEARCAP
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your linker supports --demangle option. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_LD_DEMANGLE
|
||||
|
|
2
gcc/config/sol2-clearcap.map
Normal file
2
gcc/config/sol2-clearcap.map
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Clear all hardware capabilities emitted by Sun as.
|
||||
hwcap_1 = V0x0 OVERRIDE;
|
7
gcc/config/sol2-clearcapv2.map
Normal file
7
gcc/config/sol2-clearcapv2.map
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Clear all hardware capabilities emitted by Sun as.
|
||||
#
|
||||
# Uses mapfile v2 syntax which is the only way to clear AT_SUN_CAP_HW2 flags.
|
||||
$mapfile_version 2
|
||||
CAPABILITY {
|
||||
HW = ;
|
||||
};
|
|
@ -268,12 +268,21 @@ along with GCC; see the file COPYING3. If not see
|
|||
#define LINK_LIBGCC_MAPFILE_SPEC ""
|
||||
#endif
|
||||
|
||||
/* Clear hardware capabilities, either explicitly or with OpenMP:
|
||||
#pragma openmp declare simd creates clones for SSE2, AVX, and AVX2. */
|
||||
#ifdef HAVE_LD_CLEARCAP
|
||||
#define LINK_CLEARCAP_SPEC " %{mclear-hwcap|fopenmp*:-M %sclearcap.map}"
|
||||
#else
|
||||
#define LINK_CLEARCAP_SPEC ""
|
||||
#endif
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{h*} %{v:-V} \
|
||||
%{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \
|
||||
%{static:-dn -Bstatic} \
|
||||
%{shared:-G -dy %{!mimpure-text:-z text}} " LINK_LIBGCC_MAPFILE_SPEC " \
|
||||
%{shared:-G -dy %{!mimpure-text:-z text}} " \
|
||||
LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC " \
|
||||
%{symbolic:-Bsymbolic -G -dy -z text} \
|
||||
%(link_arch) \
|
||||
%{Qy:} %{!Qn:-Qy}"
|
||||
|
|
|
@ -27,6 +27,10 @@ Driver Joined
|
|||
Ym,
|
||||
Driver Joined
|
||||
|
||||
mclear-hwcap
|
||||
Target Report
|
||||
Clear hardware capabilities when linking
|
||||
|
||||
mimpure-text
|
||||
Target Report
|
||||
Pass -z text to linker
|
||||
|
|
|
@ -35,3 +35,10 @@ sol2-stubs.o: $(srcdir)/config/sol2-stubs.c
|
|||
sol2.o: $(srcdir)/config/sol2.c
|
||||
$(COMPILE) $<
|
||||
$(POSTCOMPILE)
|
||||
|
||||
# Install clearcap.map if present.
|
||||
install: install-clearcap-map
|
||||
|
||||
# Ignore failures: file only exists if linker supports it.
|
||||
install-clearcap-map:
|
||||
-$(INSTALL_DATA) clearcap.map $(DESTDIR)$(libdir)
|
||||
|
|
67
gcc/configure
vendored
67
gcc/configure
vendored
|
@ -26920,6 +26920,34 @@ _ACEOF
|
|||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker mapfile support for clearing hardware capabilities" >&5
|
||||
$as_echo_n "checking linker mapfile support for clearing hardware capabilities... " >&6; }
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
for clearcap_map in sol2-clearcapv2.map sol2-clearcap.map; do
|
||||
LDFLAGS="$saved_LDFLAGS -Wl,-M,${srcdir}/config/$clearcap_map"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
int main(void) {return 0;}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
gcc_cv_ld_clearcap=yes; break
|
||||
else
|
||||
gcc_cv_ld_clearcap=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
done
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
if test "x$gcc_cv_ld_clearcap" = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_LD_CLEARCAP 1" >>confdefs.h
|
||||
|
||||
ac_config_links="$ac_config_links clearcap.map:${srcdir}/config/$clearcap_map"
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_clearcap" >&5
|
||||
$as_echo "$gcc_cv_ld_clearcap" >&6; }
|
||||
|
||||
case "$target:$tm_file" in
|
||||
powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
|
||||
case "$target" in
|
||||
|
@ -28456,6 +28484,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
|||
# Files that config.status was made for.
|
||||
config_files="$ac_config_files"
|
||||
config_headers="$ac_config_headers"
|
||||
config_links="$ac_config_links"
|
||||
config_commands="$ac_config_commands"
|
||||
|
||||
_ACEOF
|
||||
|
@ -28485,6 +28514,9 @@ $config_files
|
|||
Configuration headers:
|
||||
$config_headers
|
||||
|
||||
Configuration links:
|
||||
$config_links
|
||||
|
||||
Configuration commands:
|
||||
$config_commands
|
||||
|
||||
|
@ -28620,6 +28652,7 @@ do
|
|||
"as") CONFIG_FILES="$CONFIG_FILES as:exec-tool.in" ;;
|
||||
"collect-ld") CONFIG_FILES="$CONFIG_FILES collect-ld:exec-tool.in" ;;
|
||||
"nm") CONFIG_FILES="$CONFIG_FILES nm:exec-tool.in" ;;
|
||||
"clearcap.map") CONFIG_LINKS="$CONFIG_LINKS clearcap.map:${srcdir}/config/$clearcap_map" ;;
|
||||
"$all_outputs") CONFIG_FILES="$CONFIG_FILES $all_outputs" ;;
|
||||
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
|
||||
|
||||
|
@ -28635,6 +28668,7 @@ done
|
|||
if $ac_need_defaults; then
|
||||
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
|
||||
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
|
||||
test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
|
||||
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
|
||||
fi
|
||||
|
||||
|
@ -28956,7 +28990,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||
fi # test -n "$CONFIG_HEADERS"
|
||||
|
||||
|
||||
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
|
||||
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS"
|
||||
shift
|
||||
for ac_tag
|
||||
do
|
||||
|
@ -29192,7 +29226,38 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
|
|||
|| as_fn_error "could not create -" "$LINENO" 5
|
||||
fi
|
||||
;;
|
||||
:L)
|
||||
#
|
||||
# CONFIG_LINK
|
||||
#
|
||||
|
||||
if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
|
||||
:
|
||||
else
|
||||
# Prefer the file from the source tree if names are identical.
|
||||
if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
|
||||
ac_source=$srcdir/$ac_source
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
|
||||
$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
|
||||
|
||||
if test ! -r "$ac_source"; then
|
||||
as_fn_error "$ac_source: file not found" "$LINENO" 5
|
||||
fi
|
||||
rm -f "$ac_file"
|
||||
|
||||
# Try a relative symlink, then a hard link, then a copy.
|
||||
case $srcdir in
|
||||
[\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
|
||||
*) ac_rel_source=$ac_top_build_prefix$ac_source ;;
|
||||
esac
|
||||
ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
|
||||
ln "$ac_source" "$ac_file" 2>/dev/null ||
|
||||
cp -p "$ac_source" "$ac_file" ||
|
||||
as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
|
||||
fi
|
||||
;;
|
||||
:C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
|
||||
$as_echo "$as_me: executing $ac_file commands" >&6;}
|
||||
;;
|
||||
|
|
|
@ -4734,6 +4734,21 @@ if test x"$gcc_cv_ld_as_needed" = xyes; then
|
|||
[Define to the linker option to keep unused dependencies.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(linker mapfile support for clearing hardware capabilities)
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
for clearcap_map in sol2-clearcapv2.map sol2-clearcap.map; do
|
||||
LDFLAGS="$saved_LDFLAGS -Wl,-M,${srcdir}/config/$clearcap_map"
|
||||
AC_LINK_IFELSE([int main(void) {return 0;}],
|
||||
[gcc_cv_ld_clearcap=yes; break], [gcc_cv_ld_clearcap=no])
|
||||
done
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
if test "x$gcc_cv_ld_clearcap" = xyes; then
|
||||
AC_DEFINE([HAVE_LD_CLEARCAP], 1,
|
||||
[Define if the linker supports clearing hardware capabilities via mapfile.])
|
||||
AC_CONFIG_LINKS([clearcap.map:${srcdir}/config/$clearcap_map])
|
||||
fi
|
||||
AC_MSG_RESULT($gcc_cv_ld_clearcap)
|
||||
|
||||
case "$target:$tm_file" in
|
||||
powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
|
||||
case "$target" in
|
||||
|
|
|
@ -983,7 +983,7 @@ See RS/6000 and PowerPC Options.
|
|||
-mpretend-cmove -mtas}
|
||||
|
||||
@emph{Solaris 2 Options}
|
||||
@gccoptlist{-mimpure-text -mno-impure-text @gol
|
||||
@gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text -mno-impure-text @gol
|
||||
-pthreads -pthread}
|
||||
|
||||
@emph{SPARC Options}
|
||||
|
@ -20940,6 +20940,13 @@ patterns. This can result in faster code on the SH4 processor.
|
|||
These @samp{-m} options are supported on Solaris 2:
|
||||
|
||||
@table @gcctabopt
|
||||
@item -mclear-hwcap
|
||||
@opindex mclear-hwcap
|
||||
@option{-mclear-hwcap} tells the compiler to remove the hardware
|
||||
capabilities generated by the Solaris assembler. This is only necessary
|
||||
when object files use ISA extensions not supported by the current
|
||||
machine, but check at runtime whether or not to use them.
|
||||
|
||||
@item -mimpure-text
|
||||
@opindex mimpure-text
|
||||
@option{-mimpure-text}, used in addition to @option{-shared}, tells
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
2014-05-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* lib/clearcap.exp: New file.
|
||||
* gcc.dg/vect/vect.exp: Load clearcap.exp.
|
||||
Remove clearcap_ldflags handling.
|
||||
Call clearcap-init, clearcap-finish.
|
||||
* gcc.target/i386/i386.exp: Likewise.
|
||||
* gcc.target/i386/clearcap.map: Move to ../config/sol2-clearcap.map.
|
||||
* gcc.target/i386/clearcapv2.map: Move to
|
||||
../config/sol2-clearcapv2.map.
|
||||
* gcc.target/x86_64/abi/avx/abi-avx.exp: Likewise.
|
||||
* gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Likewise.
|
||||
|
||||
2014-05-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/61335
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
# Load support procs.
|
||||
load_lib gcc-dg.exp
|
||||
load_lib clearcap.exp
|
||||
|
||||
# Set up flags used for tests that don't specify options.
|
||||
global DEFAULT_VECTCFLAGS
|
||||
|
@ -41,30 +42,9 @@ if ![check_vect_support_and_set_flags] {
|
|||
# These flags are used for all targets.
|
||||
lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" "-fno-common"
|
||||
|
||||
# If the linker used understands -M <mapfile>, pass it to clear hardware
|
||||
# capabilities set by the Sun assembler.
|
||||
# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags.
|
||||
set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcapv2.map"
|
||||
|
||||
if ![check_no_compiler_messages mapfilev2 executable {
|
||||
int main (void) { return 0; }
|
||||
} $clearcap_ldflags ] {
|
||||
# If this doesn't work, fall back to the less capable v1 syntax.
|
||||
set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
|
||||
|
||||
if ![check_no_compiler_messages mapfile executable {
|
||||
int main (void) { return 0; }
|
||||
} $clearcap_ldflags ] {
|
||||
unset clearcap_ldflags
|
||||
}
|
||||
}
|
||||
|
||||
if [info exists clearcap_ldflags] {
|
||||
lappend DEFAULT_VECTCFLAGS $clearcap_ldflags
|
||||
}
|
||||
|
||||
# Initialize `dg'.
|
||||
dg-init
|
||||
clearcap-init
|
||||
|
||||
global VEC_FLAGS
|
||||
set VEC_FLAGS $DEFAULT_VECTCFLAGS
|
||||
|
@ -308,4 +288,5 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]
|
|||
set dg-do-what-default ${save-dg-do-what-default}
|
||||
|
||||
# All done.
|
||||
clearcap-finish
|
||||
dg-finish
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# clear all hardware capabilities emitted by Sun as: the tests here
|
||||
# guard against execution at runtime
|
||||
hwcap_1 = V0x0 OVERRIDE;
|
|
@ -1,7 +0,0 @@
|
|||
# clear all hardware capabilities emitted by Sun as: the tests here
|
||||
# guard against execution at runtime
|
||||
# uses mapfile v2 syntax which is the only way to clear AT_SUN_CAP_HW2 flags
|
||||
$mapfile_version 2
|
||||
CAPABILITY {
|
||||
HW = ;
|
||||
};
|
|
@ -23,6 +23,7 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
|
|||
|
||||
# Load support procs.
|
||||
load_lib gcc-dg.exp
|
||||
load_lib clearcap.exp
|
||||
|
||||
# Return 1 if attribute ms_hook_prologue is supported.
|
||||
proc check_effective_target_ms_hook_prologue { } {
|
||||
|
@ -307,39 +308,6 @@ proc check_effective_target_sha { } {
|
|||
} "-O2 -msha" ]
|
||||
}
|
||||
|
||||
# If the linker used understands -M <mapfile>, pass it to clear hardware
|
||||
# capabilities set by the Sun assembler.
|
||||
# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags.
|
||||
set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcapv2.map"
|
||||
|
||||
if ![check_no_compiler_messages mapfilev2 executable {
|
||||
int main (void) { return 0; }
|
||||
} $clearcap_ldflags ] {
|
||||
# If this doesn't work, fall back to the less capable v1 syntax.
|
||||
set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcap.map"
|
||||
|
||||
if ![check_no_compiler_messages mapfile executable {
|
||||
int main (void) { return 0; }
|
||||
} $clearcap_ldflags ] {
|
||||
unset clearcap_ldflags
|
||||
}
|
||||
}
|
||||
|
||||
if [info exists clearcap_ldflags] {
|
||||
if { [info procs gcc_target_compile] != [list] \
|
||||
&& [info procs saved_gcc_target_compile] == [list] } {
|
||||
rename gcc_target_compile saved_gcc_target_compile
|
||||
|
||||
proc gcc_target_compile { source dest type options } {
|
||||
global clearcap_ldflags
|
||||
# Always pass -Wl,-M,<mapfile>, but don't let it show up in gcc.sum.
|
||||
lappend options "additional_flags=$clearcap_ldflags"
|
||||
|
||||
return [saved_gcc_target_compile $source $dest $type $options]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# If a testcase doesn't have special options, use these.
|
||||
global DEFAULT_CFLAGS
|
||||
if ![info exists DEFAULT_CFLAGS] then {
|
||||
|
@ -348,6 +316,7 @@ if ![info exists DEFAULT_CFLAGS] then {
|
|||
|
||||
# Initialize `dg'.
|
||||
dg-init
|
||||
clearcap-init
|
||||
|
||||
# Special case compilation of vect-args.c so we don't have to
|
||||
# replicate it 10 times.
|
||||
|
@ -367,4 +336,5 @@ set tests [prune $tests $srcdir/$subdir/vect-args.c]
|
|||
dg-runtest $tests "" $DEFAULT_CFLAGS
|
||||
|
||||
# All done.
|
||||
clearcap-finish
|
||||
dg-finish
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
load_lib c-torture.exp
|
||||
load_lib target-supports.exp
|
||||
load_lib torture-options.exp
|
||||
load_lib clearcap.exp
|
||||
|
||||
if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
|
||||
|| ![is-effective-target lp64]
|
||||
|
@ -28,20 +29,10 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
|
|||
}
|
||||
|
||||
|
||||
# If the linker used understands -M <mapfile>, pass it to clear hardware
|
||||
# capabilities set by the Sun assembler.
|
||||
set flags ""
|
||||
set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
|
||||
|
||||
if [check_no_compiler_messages mapfile executable {
|
||||
int main (void) { return 0; }
|
||||
} $clearcap_ldflags ] {
|
||||
set flags $clearcap_ldflags
|
||||
}
|
||||
|
||||
torture-init
|
||||
clearcap-init
|
||||
set-torture-options $C_TORTURE_OPTIONS
|
||||
set additional_flags "-W -Wall -mavx $flags"
|
||||
set additional_flags "-W -Wall -mavx"
|
||||
|
||||
foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] {
|
||||
if {[runtest_file_p $runtests $src]} {
|
||||
|
@ -58,4 +49,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] {
|
|||
}
|
||||
}
|
||||
|
||||
clearcap-finish
|
||||
torture-finish
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
load_lib c-torture.exp
|
||||
load_lib target-supports.exp
|
||||
load_lib torture-options.exp
|
||||
load_lib clearcap.exp
|
||||
|
||||
if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
|
||||
|| ![is-effective-target lp64]
|
||||
|
@ -28,20 +29,10 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
|
|||
}
|
||||
|
||||
|
||||
# If the linker used understands -M <mapfile>, pass it to clear hardware
|
||||
# capabilities set by the Sun assembler.
|
||||
set flags ""
|
||||
set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
|
||||
|
||||
if [check_no_compiler_messages mapfile executable {
|
||||
int main (void) { return 0; }
|
||||
} $clearcap_ldflags ] {
|
||||
set flags $clearcap_ldflags
|
||||
}
|
||||
|
||||
torture-init
|
||||
clearcap-init
|
||||
set-torture-options $C_TORTURE_OPTIONS
|
||||
set additional_flags "-W -Wall -mavx512f $flags"
|
||||
set additional_flags "-W -Wall -mavx512f"
|
||||
|
||||
foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] {
|
||||
if {[runtest_file_p $runtests $src]} {
|
||||
|
@ -58,4 +49,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] {
|
|||
}
|
||||
}
|
||||
|
||||
clearcap-finish
|
||||
torture-finish
|
||||
|
|
58
gcc/testsuite/lib/clearcap.exp
Normal file
58
gcc/testsuite/lib/clearcap.exp
Normal file
|
@ -0,0 +1,58 @@
|
|||
# Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GCC; see the file COPYING3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Clear hardware capabilities on Solaris.
|
||||
if [istarget *-*-solaris2*] {
|
||||
set clearcap_ldflags "-mclear-hwcap"
|
||||
}
|
||||
|
||||
#
|
||||
# clearcap-init -- called at the start of each subdir of tests
|
||||
#
|
||||
|
||||
proc clearcap-init { args } {
|
||||
global TEST_ALWAYS_FLAGS
|
||||
global ALWAYS_CXXFLAGS
|
||||
global clearcap_saved_TEST_ALWAYS_FLAGS
|
||||
global clearcap_ldflags
|
||||
|
||||
if [info exists TEST_ALWAYS_FLAGS] {
|
||||
set clearcap_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS
|
||||
}
|
||||
if [info exists clearcap_ldflags] {
|
||||
if [info exists ALWAYS_CXXFLAGS] {
|
||||
set ALWAYS_CXXFLAGS [concat "{ldflags=$clearcap_ldflags}" $ALWAYS_CXXFLAGS]
|
||||
} else {
|
||||
append TEST_ALWAYS_FLAGS " $clearcap_ldflags"
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# clearcap-finish -- called at the start of each subdir of tests
|
||||
#
|
||||
|
||||
proc clearcap-finish { args } {
|
||||
global TEST_ALWAYS_FLAGS
|
||||
global clearcap_saved_TEST_ALWAYS_FLAGS
|
||||
|
||||
if [info exists clearcap_saved_TEST_ALWAYS_FLAGS] {
|
||||
set TEST_ALWAYS_FLAGS $clearcap_saved_TEST_ALWAYS_FLAGS
|
||||
} else {
|
||||
unset TEST_ALWAYS_FLAGS
|
||||
}
|
||||
}
|
|
@ -1,3 +1,10 @@
|
|||
2014-05-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* acinclude.m4 (LIBITM_CHECK_LINKER_HWCAP): Check for
|
||||
-mclear-hwcap instead.
|
||||
* configure: Regenerate.
|
||||
* clearcap.map: Remove.
|
||||
|
||||
2014-05-21 John Marino <gnugcc@marino.st>
|
||||
|
||||
* configure.tgt (*-*-dragonfly*): New target.
|
||||
|
|
|
@ -301,10 +301,10 @@ AC_DEFUN([LIBITM_CHECK_LINKER_FEATURES], [
|
|||
|
||||
dnl
|
||||
dnl Check if the linker used supports linker maps to clear hardware
|
||||
dnl capabilities. This is only supported by Sun ld at the moment.
|
||||
dnl capabilities. This is only supported on Solaris at the moment.
|
||||
dnl
|
||||
dnl Defines:
|
||||
dnl HWCAP_LDFLAGS='-Wl,-M,clearcap.map' if possible
|
||||
dnl HWCAP_LDFLAGS=-mclear-hwcap if possible
|
||||
dnl LD (as a side effect of testing)
|
||||
dnl
|
||||
AC_DEFUN([LIBITM_CHECK_LINKER_HWCAP], [
|
||||
|
@ -312,12 +312,12 @@ AC_DEFUN([LIBITM_CHECK_LINKER_HWCAP], [
|
|||
AC_REQUIRE([AC_PROG_LD])
|
||||
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LFLAGS -Wl,-M,$srcdir/clearcap.map"
|
||||
LDFLAGS="$LFLAGS -mclear-hwcap"
|
||||
|
||||
AC_MSG_CHECKING([for ld that supports -Wl,-M,mapfile])
|
||||
AC_MSG_CHECKING([for -mclear-hwcap])
|
||||
AC_TRY_LINK([], [return 0;], [ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
|
||||
if test "$ac_hwcap_ldflags" = "yes"; then
|
||||
HWCAP_LDFLAGS="-Wl,-M,$srcdir/clearcap.map $HWCAP_LDFLAGS"
|
||||
HWCAP_LDFLAGS="-mclear-hwcap $HWCAP_LDFLAGS"
|
||||
fi
|
||||
AC_MSG_RESULT($ac_hwcap_ldflags)
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
# Clear hardware capabilities emitted by Sun as: calls to the x86_avx.c
|
||||
# functions are only emitted with -mavx.
|
||||
#
|
||||
# The v1 mapfile syntax has no support for clearing specific capabilities,
|
||||
# so clear everything.
|
||||
#
|
||||
hwcap_1 = V0x0 OVERRIDE;
|
||||
#
|
||||
# If we can assume mapfile v2 syntax, we can specificially clear AVX.
|
||||
#
|
||||
#$mapfile_version 2
|
||||
#CAPABILITY {
|
||||
# HW -= AVX;
|
||||
#};
|
8
libitm/configure
vendored
8
libitm/configure
vendored
|
@ -16739,10 +16739,10 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
|
|||
|
||||
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LFLAGS -Wl,-M,$srcdir/clearcap.map"
|
||||
LDFLAGS="$LFLAGS -mclear-hwcap"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-M,mapfile" >&5
|
||||
$as_echo_n "checking for ld that supports -Wl,-M,mapfile... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mclear-hwcap" >&5
|
||||
$as_echo_n "checking for -mclear-hwcap... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
@ -16762,7 +16762,7 @@ fi
|
|||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
if test "$ac_hwcap_ldflags" = "yes"; then
|
||||
HWCAP_LDFLAGS="-Wl,-M,$srcdir/clearcap.map $HWCAP_LDFLAGS"
|
||||
HWCAP_LDFLAGS="-mclear-hwcap $HWCAP_LDFLAGS"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_hwcap_ldflags" >&5
|
||||
$as_echo "$ac_hwcap_ldflags" >&6; }
|
||||
|
|
Loading…
Add table
Reference in a new issue