From bdfb7c6d56a79c4bb0c937ee1d4a7186a6aa3438 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Tue, 18 Sep 2007 15:25:39 +0000 Subject: [PATCH] configure.host: Set atomic_flags on i486. 2007-09-17 Benjamin Kosnik * configure.host: Set atomic_flags on i486. * include/Makefile.am: Remove parallel-mode pch. * include/Makefile.in: Regenerate. * testsuite/lib/libstdc++.exp: Set ld_library_flags for libgomp if present. * acinclude.m4 (GLIBCXX_ENABLE_PARALLEL): Comment. * configure: Regenerate. From-SVN: r128579 --- libstdc++-v3/ChangeLog | 13 +++++++++++++ libstdc++-v3/acinclude.m4 | 14 +++++++++++++- libstdc++-v3/configure | 17 +++++++++++++++-- libstdc++-v3/configure.host | 2 +- libstdc++-v3/include/Makefile.am | 13 ++----------- libstdc++-v3/include/Makefile.in | 13 ++----------- libstdc++-v3/testsuite/lib/libstdc++.exp | 16 +++++++++++++--- 7 files changed, 59 insertions(+), 29 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a5ac39f..d8e8666 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2007-09-17 Benjamin Kosnik + + * configure.host: Set atomic_flags on i486. + + * include/Makefile.am: Remove parallel-mode pch. + * include/Makefile.in: Regenerate. + + * testsuite/lib/libstdc++.exp: Set ld_library_flags for libgomp if + present. + + * acinclude.m4 (GLIBCXX_ENABLE_PARALLEL): Comment. + * configure: Regenerate. + 2007-09-17 Johannes Singler * include/parallel/for_each.h: Fixed comment/doxygen markup typos. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index a6343ed..c26225e 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1732,11 +1732,23 @@ dnl + Usage: GLIBCXX_ENABLE_PARALLEL dnl AC_DEFUN([GLIBCXX_ENABLE_PARALLEL], [ + # NB: libstdc++ may be configured before libgomp: can't check for the actual + # dependencies (omp.h and libgomp). enable_parallel=no; - if test -f "${glibcxx_builddir}/../libgomp/omp.h"; then + if test -f $glibcxx_builddir/../libgomp/omp.h; then enable_parallel=yes; + else + AC_MSG_NOTICE([$glibcxx_builddir/../libgomp/omp.h not found]) fi + # Check to see if it's explicitly disabled. +# GLIBCXX_ENABLE(libgomp,$1,,[enable code depending on libgomp], +# [permit yes|no]) + +# if test x$enable_libgomp = xno; then +# enable_parallel=no +# fi + AC_MSG_CHECKING([for parallel mode support]) AC_MSG_RESULT([$enable_parallel]) GLIBCXX_CONDITIONAL(ENABLE_PARALLEL, test $enable_parallel = yes) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 1ced987..e42e1bb 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -16470,11 +16470,24 @@ echo "${ECHO_T}$enable_libstdcxx_debug" >&6 + # NB: libstdc++ may be configured before libgomp: can't check for the actual + # dependencies (omp.h and libgomp). enable_parallel=no; - if test -f "${glibcxx_builddir}/../libgomp/omp.h"; then + if test -f $glibcxx_builddir/../libgomp/omp.h; then enable_parallel=yes; + else + { echo "$as_me:$LINENO: $glibcxx_builddir/../libgomp/omp.h not found" >&5 +echo "$as_me: $glibcxx_builddir/../libgomp/omp.h not found" >&6;} fi + # Check to see if it's explicitly disabled. +# GLIBCXX_ENABLE(libgomp,,,[enable code depending on libgomp], +# [permit yes|no]) + +# if test x$enable_libgomp = xno; then +# enable_parallel=no +# fi + echo "$as_me:$LINENO: checking for parallel mode support" >&5 echo $ECHO_N "checking for parallel mode support... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $enable_parallel" >&5 @@ -17292,7 +17305,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 17295 "configure" +#line 17308 "configure" int main() { // NB: _Atomic_word not necessarily int. diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 4031b4e..1742128 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -147,7 +147,7 @@ case "${host_cpu}" in ia64) atomic_word_dir=cpu/ia64 ;; - i[567]86 | x86_64) + i[4567]86 | x86_64) atomic_flags="-march=native" ;; powerpc* | rs6000) diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 3dd11b4..017ffcb 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -844,8 +844,7 @@ pch1_output_anchor = ${host_builddir}/stdc++.h pch1_output_installdir = ${host_installdir}/stdc++.h.gch pch1a_output = ${pch1_output_builddir}/O0g.gch pch1b_output = ${pch1_output_builddir}/O2g.gch -pch1c_output = ${pch1_output_builddir}/O2gp.gch -pch1_output = ${pch1a_output} ${pch1b_output} ${pch1c_output} +pch1_output = ${pch1a_output} ${pch1b_output} pch2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h pch2_output_builddir = ${host_builddir}/stdtr1c++.h.gch @@ -1154,7 +1153,7 @@ ${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \ -e 's,^#include "\(.*\)",#include ,g' \ < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@ -# Build three precompiled C++ includes, stdc++.h.gch/*.gch +# Build two precompiled C++ includes, stdc++.h.gch/*.gch ${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} if [ ! -d "${pch1_output_builddir}" ]; then \ mkdir -p ${pch1_output_builddir}; \ @@ -1169,14 +1168,6 @@ ${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@ touch ${pch1_output_anchor} -${pch1c_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} - if [ ! -d "${pch1_output_builddir}" ]; then \ - mkdir -p ${pch1_output_builddir}; \ - fi; \ - CXX_PARALLEL_FLAGS="-fgomp -march=native"; - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g $(CXX_PARALLEL_FLAGS) ${pch1_source} -o $@ - touch ${pch1_output_anchor} - # Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch ${pch2_output}: ${pch2_source} ${pch1_output} if [ ! -d "${pch2_output_builddir}" ]; then \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 80a7c24..0558c66 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1076,8 +1076,7 @@ pch1_output_anchor = ${host_builddir}/stdc++.h pch1_output_installdir = ${host_installdir}/stdc++.h.gch pch1a_output = ${pch1_output_builddir}/O0g.gch pch1b_output = ${pch1_output_builddir}/O2g.gch -pch1c_output = ${pch1_output_builddir}/O2gp.gch -pch1_output = ${pch1a_output} ${pch1b_output} ${pch1c_output} +pch1_output = ${pch1a_output} ${pch1b_output} pch2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h pch2_output_builddir = ${host_builddir}/stdtr1c++.h.gch pch2_output_anchor = ${host_builddir}/stdtr1c++.h @@ -1542,7 +1541,7 @@ ${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \ -e 's,^#include "\(.*\)",#include ,g' \ < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@ -# Build three precompiled C++ includes, stdc++.h.gch/*.gch +# Build two precompiled C++ includes, stdc++.h.gch/*.gch ${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} if [ ! -d "${pch1_output_builddir}" ]; then \ mkdir -p ${pch1_output_builddir}; \ @@ -1557,14 +1556,6 @@ ${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@ touch ${pch1_output_anchor} -${pch1c_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} - if [ ! -d "${pch1_output_builddir}" ]; then \ - mkdir -p ${pch1_output_builddir}; \ - fi; \ - CXX_PARALLEL_FLAGS="-fgomp -march=native"; - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g $(CXX_PARALLEL_FLAGS) ${pch1_source} -o $@ - touch ${pch1_output_anchor} - # Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch ${pch2_output}: ${pch2_source} ${pch1_output} if [ ! -d "${pch2_output_builddir}" ]; then \ diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 136c2f7..4ba9dc5 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -123,15 +123,26 @@ proc libstdc++_init { testfile } { v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"] v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"] + set ld_library_path_tmp "" + # Locate libgcc.a so we don't need to account for different values of # SHLIB_EXT on different platforms set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] if {$gccdir != ""} { set gccdir [file dirname $gccdir] + append ld_library_path_tmp ":${gccdir}" } v3track gccdir 3 - # Look for shared library. (ie libstdc++.so.) + # Locate libgomp. This is only required for parallel mode. + set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so] + if {$libgompdir != ""} { + set libgompdir [file dirname $libgompdir] + append ld_library_path_tmp ":${libgompdir}" + } + v3track libgompdir 3 + + # Locate libstdc++ shared library. (ie libstdc++.so.) set v3-sharedlib 0 set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.so] if {$sharedlibdir != ""} { @@ -144,9 +155,8 @@ proc libstdc++_init { testfile } { # Compute what needs to be added to the existing LD_LIBRARY_PATH. if {$gccdir != ""} { - set ld_library_path "" - append ld_library_path ":${gccdir}" set compiler ${gccdir}/g++ + set ld_library_path ${ld_library_path_tmp} append ld_library_path ":${blddir}/src/.libs" if { [is_remote host] == 0 && [which $compiler] != 0 } { -- 2.7.4