re PR target/6429 (libgcc_s problem on dual 32/64-bit arches)
PR target/6429 * Makefile.in (libgcc.mk): Pass SHLIB_SLIBDIR_SUFFIXES to mklibgcc. * mklibgcc.in: If SHLIB_SLIBDIR_SUFFIXES is defined, put libgcc_s shared libraries into multilib dirs, with SONAME libgcc_s.so.1 for base multilibs. * config/t-slibgcc-elf-ver (SHLIB_LINK): Adjust for the above. * config/t-slibgcc-sld (SHLIB_LINK): Likewise. * config/i386/t-linux64 (SHLIB_SLIBDIR_SUFFIXES): Define. * config/sparc/t-linux64 (SHLIB_SLIBDIR_SUFFIXES): Define. * config/sparc/t-sol2-64 (SHLIB_SLIBDIR_SUFFIXES): Define. * lib/g77.exp (g77_link_flags): Append all multilib dirs containing libgcc_s*.so.1 below gcc object dir to LD_LIBRARY_PATH. * lib/g++.exp (g++_link_flags): Likewise. * lib/objc.exp (objc_target_compile): Likewise. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Append all multilib dirs containing libgcc_s*.so.1 below gcc object dir to LD_LIBRARY_PATH. * testsuite/lib/libjava.exp (libjava_arguments): Append all multilib dirs containing libgcc_s*.so.1 below gcc object dir to LD_LIBRARY_PATH. From-SVN: r53345
This commit is contained in:
committed by
Jakub Jelinek
parent
086c0f96be
commit
2937267b6a
@@ -113,6 +113,8 @@ proc libjava_init { args } {
|
||||
global original_ld_library_path
|
||||
global env objdir
|
||||
global env gcc_version
|
||||
global tool_root_dir
|
||||
global libjava_libgcc_s_path
|
||||
|
||||
if { $libjava_initialized == 1 } { return; }
|
||||
|
||||
@@ -170,6 +172,29 @@ proc libjava_init { args } {
|
||||
}
|
||||
}
|
||||
|
||||
# Finally, add the gcc build directory so that we can find the
|
||||
# shared libgcc. This, like much of dejagnu, is hideous.
|
||||
set libjava_libgcc_s_path {}
|
||||
set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
|
||||
if {$gccdir != ""} {
|
||||
set gccdir [file dirname $gccdir]
|
||||
lappend libjava_libgcc_s_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 } {
|
||||
lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set libjava_initialized 1
|
||||
}
|
||||
|
||||
@@ -252,6 +277,7 @@ proc libjava_arguments {{mode compile}} {
|
||||
global env
|
||||
global tool_root_dir
|
||||
global gcc_version
|
||||
global libjava_libgcc_s_path
|
||||
|
||||
if [info exists LIBJAVA] {
|
||||
set libjava $LIBJAVA;
|
||||
@@ -301,13 +327,7 @@ proc libjava_arguments {{mode compile}} {
|
||||
}
|
||||
}
|
||||
|
||||
# Finally, add the gcc build directory so that we can find the
|
||||
# shared libgcc. This, like much of dejagnu, is hideous.
|
||||
set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
|
||||
if {$gccdir != ""} {
|
||||
lappend lpath [file dirname $gccdir]
|
||||
}
|
||||
|
||||
set lpath [concat $lpath $libjava_libgcc_s_path]
|
||||
set ld_library_path [join $lpath :]
|
||||
|
||||
# That's enough to make things work for the normal case.
|
||||
|
||||
Reference in New Issue
Block a user