Commit b30bfd40 by Richard Sandiford Committed by Richard Sandiford

gcc-defs.exp (gcc-set-multilib-library-path): Delete.

gcc/testsuite/
	* lib/gcc-defs.exp (gcc-set-multilib-library-path): Delete.
	* lib/target-libpath.exp (ld_library_path_vars): New variable.
	(init_ld_library_path_env_vars): New function, replacing the
	orig_*_saved assignments.  Call it after defining it.
	(set_ld_library_path_env_vars): Rewrite to use ld_library_path_vars.
	(restore_ld_library_path_env_vars): Likewise.
	(add_path, find_libgcc_s): New functions.
	* lib/objc.exp (objc_init): Use find_libgcc_s instead of
	gcc-set-multilib-library-path.
	(objc_target_compile): Don't add "." to ld_library_path.
	Use add_path.
	* lib/gfortran.exp (gfortran_link_flags): Don't add "." to
	ld_library_path.  Use add_path.  Use find_libgcc_s instead of
	gcc-set-multilib-library-path.
	* lib/g++.exp (g++_link_flags): Likewise.
	* lib/obj-c++.exp (obj-c++_link_flags): Likewise.
	* lib/c-torture.exp: Do not manipulate ld_library_path at the
	top level; do it...
	(c-torture-execute): ...here instead.  Use $ld_library_path_multilib
	to tell when this needs to happen.  Use find_libgcc_s instead of
	gcc-set-multilib-library-path.
	* lib/gcc-dg.exp: Likewise.
	* lib/gnat.exp (gnat_target_compile): Don't add "." to ld_library_path.
	* g++.dg/compat/compat.exp (alt_ld_library_path): Don't add "."
	unless it is in $ALT_LD_LIBRARY_PATH.
	* g++.dg/compat/struct-layout-1.exp (alt_ld_library_path): Likewise.

libffi/
	* testsuite/lib/libffi-dg.exp (libffi-init): Don't add "."
	to ld_library_path.  Use add_path.  Add just find_libgcc_s
	to ld_library_path, not every libgcc multilib directory.

libgomp/
	* testsuite/lib/libgomp.exp (libgomp_init): Don't add "." to
	ld_library_path.  Use add_path.  Add just find_libgcc_s to
	ld_library_path, not every libgcc multilib directory.
	* testsuite/libgomp.c/c.exp (ld_library_path): Don't call
	gcc-set-multilib-library-path; rely on $always_ld_library_path instead.
	* testsuite/libgomp.c++/c++.exp (ld_library_path): Likewise.
	Use add_path.
	* testsuite/libgomp.fortran/fortran.exp (ld_library_path): Likewise.

libjava/
	* testsuite/lib/libjava.exp (libjava_init): Just add
	find_libgcc_s to libjava_libgcc_s_path, rather than every
	libgcc multilib directory.
	(libjava_arguments): Explain why we add "." to ld_library_path.
	(gcj_invoke, exec_gij, libjava_invoke): Use add_path.

libmudflap/
	* testsuite/lib/libmudflap.exp (libmudflap-init): Don't add "."
	to ld_library_path.  Use add_path.  Add just find_libgcc_s to
	ld_library_path, not every libgcc multilib directory.

libstdc++-v3/
	* testsuite/lib/libstdc++.exp (libstdc++_init): Don't add "."
	to ld_library_path.  Use add_path.  Add just find_libgcc_s to
	ld_library_path, not every libgcc multilib directory.

From-SVN: r149113
parent f82a627c
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* lib/gcc-defs.exp (gcc-set-multilib-library-path): Delete.
* lib/target-libpath.exp (ld_library_path_vars): New variable.
(init_ld_library_path_env_vars): New function, replacing the
orig_*_saved assignments. Call it after defining it.
(set_ld_library_path_env_vars): Rewrite to use ld_library_path_vars.
(restore_ld_library_path_env_vars): Likewise.
(add_path, find_libgcc_s): New functions.
* lib/objc.exp (objc_init): Use find_libgcc_s instead of
gcc-set-multilib-library-path.
(objc_target_compile): Don't add "." to ld_library_path.
Use add_path.
* lib/gfortran.exp (gfortran_link_flags): Don't add "." to
ld_library_path. Use add_path. Use find_libgcc_s instead of
gcc-set-multilib-library-path.
* lib/g++.exp (g++_link_flags): Likewise.
* lib/obj-c++.exp (obj-c++_link_flags): Likewise.
* lib/c-torture.exp: Do not manipulate ld_library_path at the
top level; do it...
(c-torture-execute): ...here instead. Use $ld_library_path_multilib
to tell when this needs to happen. Use find_libgcc_s instead of
gcc-set-multilib-library-path.
* lib/gcc-dg.exp: Likewise.
* lib/gnat.exp (gnat_target_compile): Don't add "." to ld_library_path.
* g++.dg/compat/compat.exp (alt_ld_library_path): Don't add "."
unless it is in $ALT_LD_LIBRARY_PATH.
* g++.dg/compat/struct-layout-1.exp (alt_ld_library_path): Likewise.
2009-06-30 Eric Botcazou <ebotcazou@adacore.com> 2009-06-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr12.adb: New test. * gnat.dg/discr12.adb: New test.
......
...@@ -103,14 +103,14 @@ set sid "cp_compat" ...@@ -103,14 +103,14 @@ set sid "cp_compat"
# are different. # are different.
set use_alt 0 set use_alt 0
set same_alt 0 set same_alt 0
set alt_ld_library_path "." set alt_ld_library_path ""
if [info exists ALT_CXX_UNDER_TEST] then { if [info exists ALT_CXX_UNDER_TEST] then {
set use_alt 1 set use_alt 1
if [string match "same" $ALT_CXX_UNDER_TEST] then { if [string match "same" $ALT_CXX_UNDER_TEST] then {
set same_alt 1 set same_alt 1
} else { } else {
if [info exists ALT_LD_LIBRARY_PATH] then { if [info exists ALT_LD_LIBRARY_PATH] then {
append alt_ld_library_path ":${ALT_LD_LIBRARY_PATH}" set alt_ld_library_path $ALT_LD_LIBRARY_PATH
} }
} }
} }
......
...@@ -109,14 +109,14 @@ set sid "cp_compat" ...@@ -109,14 +109,14 @@ set sid "cp_compat"
# are different. # are different.
set use_alt 0 set use_alt 0
set same_alt 0 set same_alt 0
set alt_ld_library_path "." set alt_ld_library_path ""
if [info exists ALT_CXX_UNDER_TEST] then { if [info exists ALT_CXX_UNDER_TEST] then {
set use_alt 1 set use_alt 1
if [string match "same" $ALT_CXX_UNDER_TEST] then { if [string match "same" $ALT_CXX_UNDER_TEST] then {
set same_alt 1 set same_alt 1
} else { } else {
if [info exists ALT_LD_LIBRARY_PATH] then { if [info exists ALT_LD_LIBRARY_PATH] then {
append alt_ld_library_path ":${ALT_LD_LIBRARY_PATH}" set alt_ld_library_path $ALT_LD_LIBRARY_PATH
} }
} }
} }
......
...@@ -54,15 +54,6 @@ if ![info exists GCC_UNDER_TEST] { ...@@ -54,15 +54,6 @@ if ![info exists GCC_UNDER_TEST] {
set GCC_UNDER_TEST "[find_gcc]" set GCC_UNDER_TEST "[find_gcc]"
} }
global orig_environment_saved
# This file may be sourced, so don't override environment settings
# that have been previously setup.
if { $orig_environment_saved == 0 } {
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
}
# #
# c-torture-compile -- runs the Tege C-torture test # c-torture-compile -- runs the Tege C-torture test
# #
...@@ -108,6 +99,13 @@ proc c-torture-compile { src option } { ...@@ -108,6 +99,13 @@ proc c-torture-compile { src option } {
# #
proc c-torture-execute { sources args } { proc c-torture-execute { sources args } {
global tmpdir tool srcdir output compiler_conditional_xfail_data global tmpdir tool srcdir output compiler_conditional_xfail_data
global ld_library_path ld_library_path_multilib GCC_UNDER_TEST
if { "$ld_library_path_multilib"
!= "[board_info target multilib_flags]" } {
set ld_library_path [find_libgcc_s $GCC_UNDER_TEST]
set_ld_library_path_env_vars
}
# Use the first source filename given as the filename under test. # Use the first source filename given as the filename under test.
set src [lindex $sources 0] set src [lindex $sources 0]
......
...@@ -106,52 +106,51 @@ proc g++_link_flags { paths } { ...@@ -106,52 +106,51 @@ proc g++_link_flags { paths } {
set gccpath ${paths} set gccpath ${paths}
set libio_dir "" set libio_dir ""
set flags "" set flags ""
set ld_library_path "." set ld_library_path ""
set shlib_ext [get_shlib_extension] set shlib_ext [get_shlib_extension]
verbose "shared lib extension: $shlib_ext" verbose "shared lib extension: $shlib_ext"
if { $gccpath != "" } { if { $gccpath != "" } {
if [file exists "${gccpath}/lib/libstdc++.a"] { if [file exists "${gccpath}/lib/libstdc++.a"] {
append ld_library_path ":${gccpath}/lib" add_path ld_library_path "${gccpath}/lib"
} }
if [file exists "${gccpath}/libg++/libg++.a"] { if [file exists "${gccpath}/libg++/libg++.a"] {
append flags "-L${gccpath}/libg++ " append flags "-L${gccpath}/libg++ "
append ld_library_path ":${gccpath}/libg++" add_path ld_library_path "${gccpath}/libg++"
} }
if [file exists "${gccpath}/libstdc++/libstdc++.a"] { if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
append flags "-L${gccpath}/libstdc++ " append flags "-L${gccpath}/libstdc++ "
append ld_library_path ":${gccpath}/libstdc++" add_path ld_library_path "${gccpath}/libstdc++"
} }
if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] { if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] {
append flags " -L${gccpath}/libstdc++-v3/src/.libs " append flags " -L${gccpath}/libstdc++-v3/src/.libs "
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" add_path ld_library_path "${gccpath}/libstdc++-v3/src/.libs"
} }
# Look for libstdc++.${shlib_ext}. # Look for libstdc++.${shlib_ext}.
if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shlib_ext}"] { if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shlib_ext}"] {
append flags " -L${gccpath}/libstdc++-v3/src/.libs " append flags " -L${gccpath}/libstdc++-v3/src/.libs "
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" add_path ld_library_path "${gccpath}/libstdc++-v3/src/.libs"
} }
if [file exists "${gccpath}/libiberty/libiberty.a"] { if [file exists "${gccpath}/libiberty/libiberty.a"] {
append flags "-L${gccpath}/libiberty " append flags "-L${gccpath}/libiberty "
} }
if [file exists "${gccpath}/librx/librx.a"] { if [file exists "${gccpath}/librx/librx.a"] {
append flags "-L${gccpath}/librx " append flags "-L${gccpath}/librx "
} }
append ld_library_path [gcc-set-multilib-library-path $GXX_UNDER_TEST] add_path ld_library_path [find_libgcc_s $GXX_UNDER_TEST]
} else { } else {
global tool_root_dir global tool_root_dir
set libgpp [lookfor_file ${tool_root_dir} libg++] set libgpp [lookfor_file ${tool_root_dir} libg++]
if { $libgpp != "" } { if { $libgpp != "" } {
append flags "-L${libgpp} " append flags "-L${libgpp} "
append ld_library_path ":${libgpp}" add_path ld_library_path ${libgpp}
} }
set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]
if { $libstdcpp != "" } { if { $libstdcpp != "" } {
append flags "-L${libstdcpp} " append flags "-L${libstdcpp} "
append ld_library_path ":${libstdcpp}" add_path ld_library_path ${libstdcpp}
} }
set libiberty [lookfor_file ${tool_root_dir} libiberty] set libiberty [lookfor_file ${tool_root_dir} libiberty]
if { $libiberty != "" } { if { $libiberty != "" } {
......
...@@ -233,35 +233,3 @@ proc dg-additional-files-options { options source } { ...@@ -233,35 +233,3 @@ proc dg-additional-files-options { options source } {
return $options return $options
} }
# Return a colon-separate list of directories to search for libraries
# for COMPILER, including multilib directories.
proc gcc-set-multilib-library-path { compiler } {
global rootme
# ??? rootme will not be set when testing an installed compiler.
# In that case, we should perhaps use some other method to find
# libraries.
if {![info exists rootme]} {
return ""
}
set libpath ":${rootme}"
set compiler [lindex $compiler 0]
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
set mldir ""
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
set mldir [string trimright $mldir "\;@"]
if { "$mldir" == "." } {
continue
}
if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } {
append libpath ":${rootme}/${mldir}"
}
}
}
return $libpath
}
...@@ -65,15 +65,6 @@ if ![info exists GCC_UNDER_TEST] { ...@@ -65,15 +65,6 @@ if ![info exists GCC_UNDER_TEST] {
set GCC_UNDER_TEST "[find_gcc]" set GCC_UNDER_TEST "[find_gcc]"
} }
global orig_environment_saved
# This file may be sourced, so don't override environment settings
# that have been previously setup.
if { $orig_environment_saved == 0 } {
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
}
# Define gcc callbacks for dg.exp. # Define gcc callbacks for dg.exp.
proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } { proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
...@@ -117,6 +108,14 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } { ...@@ -117,6 +108,14 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
set output_file "[file rootname [file tail $prog]].o" set output_file "[file rootname [file tail $prog]].o"
} }
"run" { "run" {
global ld_library_path ld_library_path_multilib GCC_UNDER_TEST
if { "$ld_library_path_multilib"
!= "[board_info target multilib_flags]" } {
set ld_library_path [find_libgcc_s $GCC_UNDER_TEST]
set_ld_library_path_env_vars
}
set compile_type "executable" set compile_type "executable"
# FIXME: "./" is to cope with "." not being in $PATH. # FIXME: "./" is to cope with "." not being in $PATH.
# Should this be handled elsewhere? # Should this be handled elsewhere?
......
...@@ -84,7 +84,7 @@ proc gfortran_link_flags { paths } { ...@@ -84,7 +84,7 @@ proc gfortran_link_flags { paths } {
set gccpath ${paths} set gccpath ${paths}
set libio_dir "" set libio_dir ""
set flags "" set flags ""
set ld_library_path "." set ld_library_path ""
set shlib_ext [get_shlib_extension] set shlib_ext [get_shlib_extension]
verbose "shared lib extension: $shlib_ext" verbose "shared lib extension: $shlib_ext"
...@@ -94,11 +94,11 @@ proc gfortran_link_flags { paths } { ...@@ -94,11 +94,11 @@ proc gfortran_link_flags { paths } {
# for uninstalled testing. # for uninstalled testing.
append flags "-B${gccpath}/libgfortran/.libs " append flags "-B${gccpath}/libgfortran/.libs "
append flags "-L${gccpath}/libgfortran/.libs " append flags "-L${gccpath}/libgfortran/.libs "
append ld_library_path ":${gccpath}/libgfortran/.libs" add_path ld_library_path "${gccpath}/libgfortran/.libs"
} }
if [file exists "${gccpath}/libgfortran/.libs/libgfortran.${shlib_ext}"] { if [file exists "${gccpath}/libgfortran/.libs/libgfortran.${shlib_ext}"] {
append flags "-L${gccpath}/libgfortran/.libs " append flags "-L${gccpath}/libgfortran/.libs "
append ld_library_path ":${gccpath}/libgfortran/.libs" add_path ld_library_path "${gccpath}/libgfortran/.libs"
} }
if [file exists "${gccpath}/libgfortran/libgforbegin.a"] { if [file exists "${gccpath}/libgfortran/libgforbegin.a"] {
append flags "-L${gccpath}/libgfortran " append flags "-L${gccpath}/libgfortran "
...@@ -106,8 +106,7 @@ proc gfortran_link_flags { paths } { ...@@ -106,8 +106,7 @@ proc gfortran_link_flags { paths } {
if [file exists "${gccpath}/libiberty/libiberty.a"] { if [file exists "${gccpath}/libiberty/libiberty.a"] {
append flags "-L${gccpath}/libiberty " append flags "-L${gccpath}/libiberty "
} }
append ld_library_path \ add_path ld_library_path [find_libgcc_s $GFORTRAN_UNDER_TEST]
[gcc-set-multilib-library-path $GFORTRAN_UNDER_TEST]
} }
set_ld_library_path_env_vars set_ld_library_path_env_vars
......
...@@ -147,7 +147,7 @@ proc gnat_target_compile { source dest type options } { ...@@ -147,7 +147,7 @@ proc gnat_target_compile { source dest type options } {
set GNAT_UNDER_TEST "$GNAT_UNDER_TEST_ORIG $gnat_rts_opt" set GNAT_UNDER_TEST "$GNAT_UNDER_TEST_ORIG $gnat_rts_opt"
} }
set ld_library_path ".:${gnat_libgcc_s_path}" set ld_library_path ${gnat_libgcc_s_path}
lappend options "compiler=$GNAT_UNDER_TEST -q -f" lappend options "compiler=$GNAT_UNDER_TEST -q -f"
lappend options "timeout=[timeout_value]" lappend options "timeout=[timeout_value]"
......
...@@ -106,30 +106,30 @@ proc obj-c++_link_flags { paths } { ...@@ -106,30 +106,30 @@ proc obj-c++_link_flags { paths } {
set gccpath ${paths} set gccpath ${paths}
set libio_dir "" set libio_dir ""
set flags "" set flags ""
set ld_library_path "." set ld_library_path ""
set shlib_ext [get_shlib_extension] set shlib_ext [get_shlib_extension]
verbose "shared lib extension: $shlib_ext" verbose "shared lib extension: $shlib_ext"
if { $gccpath != "" } { if { $gccpath != "" } {
if [file exists "${gccpath}/lib/libstdc++.a"] { if [file exists "${gccpath}/lib/libstdc++.a"] {
append ld_library_path ":${gccpath}/lib" add_path ld_library_path "${gccpath}/lib"
} }
if [file exists "${gccpath}/libg++/libg++.a"] { if [file exists "${gccpath}/libg++/libg++.a"] {
append flags "-L${gccpath}/libg++ " append flags "-L${gccpath}/libg++ "
append ld_library_path ":${gccpath}/libg++" add_path ld_library_path "${gccpath}/libg++"
} }
if [file exists "${gccpath}/libstdc++/libstdc++.a"] { if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
append flags "-L${gccpath}/libstdc++ " append flags "-L${gccpath}/libstdc++ "
append ld_library_path ":${gccpath}/libstdc++" add_path ld_library_path "${gccpath}/libstdc++"
} }
if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] { if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] {
append flags " -L${gccpath}/libstdc++-v3/src/.libs " append flags " -L${gccpath}/libstdc++-v3/src/.libs "
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" add_path ld_library_path "${gccpath}/libstdc++-v3/src/.libs"
} }
# Look for libstdc++.${shlib_ext}. # Look for libstdc++.${shlib_ext}.
if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shlib_ext}"] { if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shlib_ext}"] {
append flags " -L${gccpath}/libstdc++-v3/src/.libs " append flags " -L${gccpath}/libstdc++-v3/src/.libs "
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs" add_path ld_library_path "${gccpath}/libstdc++-v3/src/.libs"
} }
if [file exists "${gccpath}/libiberty/libiberty.a"] { if [file exists "${gccpath}/libiberty/libiberty.a"] {
append flags "-L${gccpath}/libiberty " append flags "-L${gccpath}/libiberty "
...@@ -158,23 +158,21 @@ proc obj-c++_link_flags { paths } { ...@@ -158,23 +158,21 @@ proc obj-c++_link_flags { paths } {
if { $libobjc_dir != "" } { if { $libobjc_dir != "" } {
set libobjc_dir [file dirname ${libobjc_dir}] set libobjc_dir [file dirname ${libobjc_dir}]
append flags "-L${libobjc_dir}" append flags "-L${libobjc_dir}"
append ld_library_path ":${libobjc_dir}" add_path ld_library_path ${libobjc_dir}
} }
append ld_library_path \ add_path ld_library_path [find_libgcc_s $OBJCXX_UNDER_TEST]
[gcc-set-multilib-library-path $OBJCXX_UNDER_TEST]
} else { } else {
global tool_root_dir; global tool_root_dir;
set libgpp [lookfor_file ${tool_root_dir} libg++]; set libgpp [lookfor_file ${tool_root_dir} libg++];
if { $libgpp != "" } { if { $libgpp != "" } {
append flags "-L${libgpp} "; append flags "-L${libgpp} ";
append ld_library_path ":${libgpp}" add_path ld_library_path ${libgpp}
} }
set libstdcpp [lookfor_file ${tool_root_dir} libstdc++]; set libstdcpp [lookfor_file ${tool_root_dir} libstdc++];
if { $libstdcpp != "" } { if { $libstdcpp != "" } {
append flags "-L${libstdcpp} "; append flags "-L${libstdcpp} ";
append ld_library_path ":${libstdcpp}" add_path ld_library_path ${libstdcpp}
} }
set libiberty [lookfor_file ${tool_root_dir} libiberty]; set libiberty [lookfor_file ${tool_root_dir} libiberty];
if { $libiberty != "" } { if { $libiberty != "" } {
......
...@@ -121,7 +121,7 @@ proc objc_init { args } { ...@@ -121,7 +121,7 @@ proc objc_init { args } {
objc_maybe_build_wrapper "${tmpdir}/objc-testglue.o" objc_maybe_build_wrapper "${tmpdir}/objc-testglue.o"
set objc_libgcc_s_path [gcc-set-multilib-library-path $OBJC_UNDER_TEST] set objc_libgcc_s_path [find_libgcc_s $OBJC_UNDER_TEST]
} }
proc objc_target_compile { source dest type options } { proc objc_target_compile { source dest type options } {
...@@ -135,7 +135,7 @@ proc objc_target_compile { source dest type options } { ...@@ -135,7 +135,7 @@ proc objc_target_compile { source dest type options } {
global objc_libgcc_s_path global objc_libgcc_s_path
global shlib_ext global shlib_ext
set ld_library_path ".:${objc_libgcc_s_path}" set ld_library_path ${objc_libgcc_s_path}
lappend options "libs=-lobjc" lappend options "libs=-lobjc"
set shlib_ext [get_shlib_extension] set shlib_ext [get_shlib_extension]
verbose "shared lib extension: $shlib_ext" verbose "shared lib extension: $shlib_ext"
...@@ -191,7 +191,7 @@ proc objc_target_compile { source dest type options } { ...@@ -191,7 +191,7 @@ proc objc_target_compile { source dest type options } {
set libobjc_dir [file dirname ${libobjc_dir}] set libobjc_dir [file dirname ${libobjc_dir}]
set objc_link_flags "-L${libobjc_dir}" set objc_link_flags "-L${libobjc_dir}"
lappend options "additional_flags=${objc_link_flags}" lappend options "additional_flags=${objc_link_flags}"
append ld_library_path ":${libobjc_dir}" add_path ld_library_path ${libobjc_dir}
} }
if { $type == "precompiled_header" } { if { $type == "precompiled_header" } {
# If we generating a precompiled header, we have say this is an # If we generating a precompiled header, we have say this is an
......
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* testsuite/lib/libffi-dg.exp (libffi-init): Don't add "."
to ld_library_path. Use add_path. Add just find_libgcc_s
to ld_library_path, not every libgcc multilib directory.
2009-06-16 Wim Lewis <wiml@hhhh.org> 2009-06-16 Wim Lewis <wiml@hhhh.org>
* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
......
...@@ -108,32 +108,11 @@ proc libffi-init { args } { ...@@ -108,32 +108,11 @@ proc libffi-init { args } {
verbose "libstdc++ $blddircxx" verbose "libstdc++ $blddircxx"
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} { add_path ld_library_path [find_libgcc_s "$gccdir/xgcc"]
set gccdir [file dirname $gccdir]
}
verbose "gccdir $gccdir"
set ld_library_path "."
append ld_library_path ":${gccdir}"
set compiler "${gccdir}/xgcc"
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
set mldir ""
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
set mldir [string trimright $mldir "\;@"]
if { "$mldir" == "." } {
continue
}
if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
append ld_library_path ":${gccdir}/${mldir}"
}
}
}
# add the library path for libffi. # add the library path for libffi.
append ld_library_path ":${blddirffi}/.libs" add_path ld_library_path "${blddirffi}/.libs"
# add the library path for libstdc++ as well. # add the library path for libstdc++ as well.
append ld_library_path ":${blddircxx}/src/.libs" add_path ld_library_path "${blddircxx}/src/.libs"
verbose "ld_library_path: $ld_library_path" verbose "ld_library_path: $ld_library_path"
......
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* testsuite/lib/libgomp.exp (libgomp_init): Don't add "." to
ld_library_path. Use add_path. Add just find_libgcc_s to
ld_library_path, not every libgcc multilib directory.
* testsuite/libgomp.c/c.exp (ld_library_path): Don't call
gcc-set-multilib-library-path; rely on $always_ld_library_path instead.
* testsuite/libgomp.c++/c++.exp (ld_library_path): Likewise.
Use add_path.
* testsuite/libgomp.fortran/fortran.exp (ld_library_path): Likewise.
2009-06-09 Nathan Froyd <froydnj@codesourcery.com> 2009-06-09 Nathan Froyd <froydnj@codesourcery.com>
* Makefile.am (LTLDFLAGS): Define. * Makefile.am (LTLDFLAGS): Define.
......
...@@ -86,39 +86,8 @@ proc libgomp_init { args } { ...@@ -86,39 +86,8 @@ proc libgomp_init { args } {
set CFLAGS "" set CFLAGS ""
} }
# Locate libgcc.a so we don't need to account for different values of set always_ld_library_path "${blddir}/.libs"
# SHLIB_EXT on different platforms add_path always_ld_library_path [find_libgcc_s $GCC_UNDER_TEST]
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
}
# Compute what needs to be put into LD_LIBRARY_PATH
set always_ld_library_path ".:${blddir}/.libs"
# Compute what needs to be added to the existing LD_LIBRARY_PATH.
if {$gccdir != ""} {
# Add AIX pthread directory first.
if { [llength [glob -nocomplain ${gccdir}/pthread/libgcc_s*.a]] >= 1 } {
append always_ld_library_path ":${gccdir}/pthread"
}
append always_ld_library_path ":${gccdir}"
set compiler [lindex $GCC_UNDER_TEST 0]
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
set mldir ""
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
set mldir [string trimright $mldir "\;@"]
if { "$mldir" == "." } {
continue
}
if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
append always_ld_library_path ":${gccdir}/${mldir}"
}
}
}
}
set ALWAYS_CFLAGS "" set ALWAYS_CFLAGS ""
if { $blddir != "" } { if { $blddir != "" } {
......
...@@ -37,12 +37,10 @@ if { $lang_test_file_found } { ...@@ -37,12 +37,10 @@ if { $lang_test_file_found } {
# Gather a list of all tests. # Gather a list of all tests.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]] set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
set ld_library_path $always_ld_library_path
if { $blddir != "" } { if { $blddir != "" } {
set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" add_path ld_library_path "${blddir}/${lang_library_path}"
} else {
set ld_library_path "$always_ld_library_path"
} }
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars set_ld_library_path_env_vars
set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags" set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
......
...@@ -20,7 +20,6 @@ dg-init ...@@ -20,7 +20,6 @@ dg-init
set tests [lsort [find $srcdir/$subdir *.c]] set tests [lsort [find $srcdir/$subdir *.c]]
set ld_library_path $always_ld_library_path set ld_library_path $always_ld_library_path
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars set_ld_library_path_env_vars
# Main loop. # Main loop.
......
...@@ -26,12 +26,10 @@ if { $lang_test_file_found } { ...@@ -26,12 +26,10 @@ if { $lang_test_file_found } {
# Gather a list of all tests. # Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]] set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
set ld_library_path $always_ld_library_path
if { $blddir != "" } { if { $blddir != "" } {
set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}" add_path ld_library_path "${blddir}/${lang_library_path}"
} else {
set ld_library_path "$always_ld_library_path"
} }
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars set_ld_library_path_env_vars
# Main loop. # Main loop.
......
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* testsuite/lib/libjava.exp (libjava_init): Just add
find_libgcc_s to libjava_libgcc_s_path, rather than every
libgcc multilib directory.
(libjava_arguments): Explain why we add "." to ld_library_path.
(gcj_invoke, exec_gij, libjava_invoke): Use add_path.
2009-06-22 Matthias Klose <doko@ubuntu.com> 2009-06-22 Matthias Klose <doko@ubuntu.com>
* libtool-version: Bump soversion. * libtool-version: Bump soversion.
......
...@@ -197,36 +197,8 @@ proc libjava_init { args } { ...@@ -197,36 +197,8 @@ proc libjava_init { args } {
} }
# Finally, add the gcc build directory so that we can find the # Finally, add the gcc build directory so that we can find the
# shared libgcc. This, like much of dejagnu, is hideous. # shared libgcc.
set libjava_libgcc_s_path {} set libjava_libgcc_s_path [find_libgcc_s $GCJ_UNDER_TEST]
if { [istarget "*-*-darwin*"] } {
set so_extension "dylib"
} elseif { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } {
set so_extension "dll"
} else {
set so_extension "so"
}
set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
lappend libjava_libgcc_s_path $gccdir
verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
set compiler ${gccdir}/xgcc
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
set mldir ""
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
set mldir [string trimright $mldir "\;@"]
if { "$mldir" == "." } {
continue
}
if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] >= 1 } {
lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
}
}
}
}
set libjava_initialized 1 set libjava_initialized 1
} }
...@@ -337,6 +309,8 @@ proc libjava_arguments {{mode compile}} { ...@@ -337,6 +309,8 @@ proc libjava_arguments {{mode compile}} {
# Basically we want to build up a colon separated path list from # Basically we want to build up a colon separated path list from
# the value of $libjava. # the value of $libjava.
# Add "." to the list so that we pick up shared libraries created
# by the testsuite itself.
set lpath "." set lpath "."
foreach dir [list $libjava] { foreach dir [list $libjava] {
foreach item [split $dir " "] { foreach item [split $dir " "] {
...@@ -470,8 +444,8 @@ proc gcj_invoke {program expectFile ld_library_additions} { ...@@ -470,8 +444,8 @@ proc gcj_invoke {program expectFile ld_library_additions} {
global ld_library_path global ld_library_path
set ld_library_path "$libjava_ld_library_path" set ld_library_path "$libjava_ld_library_path"
if {[llength $ld_library_additions] > 0} { foreach path $ld_library_additions {
append ld_library_path :[join $ld_library_additions :] add_path ld_library_path $path
} }
set_ld_library_path_env_vars set_ld_library_path_env_vars
...@@ -512,8 +486,8 @@ proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} { ...@@ -512,8 +486,8 @@ proc exec_gij {jarfile expectFile {ld_library_additions {}} {addl_flags {}}} {
global ld_library_path global ld_library_path
set ld_library_path "$libjava_ld_library_path" set ld_library_path "$libjava_ld_library_path"
if {[llength $ld_library_additions] > 0} { foreach path $ld_library_additions {
append ld_library_path :[join $ld_library_additions :] add_path ld_library_path $path
} }
set_ld_library_path_env_vars set_ld_library_path_env_vars
...@@ -562,8 +536,8 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile ...@@ -562,8 +536,8 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile
global ld_library_path global ld_library_path
set ld_library_path "$libjava_ld_library_path" set ld_library_path "$libjava_ld_library_path"
if {[llength $ld_library_additions] > 0} { foreach path $ld_library_additions {
append ld_library_path :[join $ld_library_additions :] add_path ld_library_path $path
} }
set_ld_library_path_env_vars set_ld_library_path_env_vars
......
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* testsuite/lib/libmudflap.exp (libmudflap-init): Don't add "."
to ld_library_path. Use add_path. Add just find_libgcc_s to
ld_library_path, not every libgcc multilib directory.
2009-04-09 Nick Clifton <nickc@redhat.com> 2009-04-09 Nick Clifton <nickc@redhat.com>
* mf-hooks1.c: Change copyright header to refer to version 3 * mf-hooks1.c: Change copyright header to refer to version 3
......
...@@ -60,28 +60,9 @@ proc libmudflap-init { language } { ...@@ -60,28 +60,9 @@ proc libmudflap-init { language } {
# set LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found. # set LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found.
# locate libgcc.a so we don't need to account for different values of # locate libgcc.a so we don't need to account for different values of
# SHLIB_EXT on different platforms # SHLIB_EXT on different platforms
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] set ld_library_path [find_libgcc_s $cxx]
if {$gccdir != ""} { add_path ld_library_path "${cxxblddir}/src/.libs"
set gccdir [file dirname $gccdir] add_path ld_library_path "${blddir}/.libs"
}
set ld_library_path "."
append ld_library_path ":${gccdir}"
append ld_library_path ":${cxxblddir}/src/.libs"
if {[is_remote host] == 0} {
foreach i "[exec ${gccdir}/xgcc --print-multi-lib]" {
set mldir ""
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
set mldir [string trimright $mldir "\;@"]
if { "$mldir" == "." } {
continue
}
if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
append ld_library_path ":${gccdir}/${mldir}"
}
}
}
append ld_library_path ":${blddir}/.libs"
set libs "-L${blddir}/.libs" set libs "-L${blddir}/.libs"
set cxxflags "-ggdb3 -DDEBUG_ASSERT" set cxxflags "-ggdb3 -DDEBUG_ASSERT"
......
2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
* testsuite/lib/libstdc++.exp (libstdc++_init): Don't add "."
to ld_library_path. Use add_path. Add just find_libgcc_s to
ld_library_path, not every libgcc multilib directory.
2009-06-30 Paolo Carlini <paolo.carlini@oracle.com> 2009-06-30 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40600 PR libstdc++/40600
......
...@@ -132,7 +132,6 @@ proc libstdc++_init { testfile } { ...@@ -132,7 +132,6 @@ proc libstdc++_init { testfile } {
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} { if {$gccdir != ""} {
set gccdir [file dirname $gccdir] set gccdir [file dirname $gccdir]
append ld_library_path_tmp ":${gccdir}"
} }
v3track gccdir 3 v3track gccdir 3
...@@ -142,7 +141,7 @@ proc libstdc++_init { testfile } { ...@@ -142,7 +141,7 @@ proc libstdc++_init { testfile } {
if {$libgompdir != ""} { if {$libgompdir != ""} {
set v3-libgomp 1 set v3-libgomp 1
set libgompdir [file dirname $libgompdir] set libgompdir [file dirname $libgompdir]
append ld_library_path_tmp ":${libgompdir}" add_path ld_library_path_tmp ${libgompdir}
verbose -log "libgomp support detected" verbose -log "libgomp support detected"
} }
v3track libgompdir 3 v3track libgompdir 3
...@@ -162,22 +161,8 @@ proc libstdc++_init { testfile } { ...@@ -162,22 +161,8 @@ proc libstdc++_init { testfile } {
if {$gccdir != ""} { if {$gccdir != ""} {
set compiler ${gccdir}/g++ set compiler ${gccdir}/g++
set ld_library_path ${ld_library_path_tmp} set ld_library_path ${ld_library_path_tmp}
append ld_library_path ":${blddir}/src/.libs" add_path ld_library_path "${blddir}/src/.libs"
add_path ld_library_path [find_libgcc_s $compiler]
if { [is_remote host] == 0 && [which $compiler] != 0 } {
foreach i "[exec $compiler --print-multi-lib]" {
set mldir ""
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
set mldir [string trimright $mldir "\;@"]
if { "$mldir" == "." } {
continue
}
if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
append ld_library_path ":${gccdir}/${mldir}"
}
}
}
set_ld_library_path_env_vars set_ld_library_path_env_vars
if [info exists env(LD_LIBRARY_PATH)] { if [info exists env(LD_LIBRARY_PATH)] {
verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment