* lib/gdb.exp (gdb_compile): Also set rpath for shlib=, on a
remote host.
This commit is contained in:
parent
75aa492e67
commit
bdf7534a4d
2 changed files with 30 additions and 12 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2009-11-12 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* lib/gdb.exp (gdb_compile): Also set rpath for shlib=, on a
|
||||||
|
remote host.
|
||||||
|
|
||||||
2009-11-12 Nathan Froyd <froydnj@codesourcery.com>
|
2009-11-12 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
* gdb.base/step-line.exp: Copy step-line.inp to the remote host.
|
* gdb.base/step-line.exp: Copy step-line.inp to the remote host.
|
||||||
|
|
|
@ -1734,6 +1734,7 @@ proc gdb_compile {source dest type options} {
|
||||||
# "shlib=librarypath" in OPTIONS.
|
# "shlib=librarypath" in OPTIONS.
|
||||||
set new_options ""
|
set new_options ""
|
||||||
set shlib_found 0
|
set shlib_found 0
|
||||||
|
set shlib_load 0
|
||||||
foreach opt $options {
|
foreach opt $options {
|
||||||
if [regexp {^shlib=(.*)} $opt dummy_var shlib_name] {
|
if [regexp {^shlib=(.*)} $opt dummy_var shlib_name] {
|
||||||
if [test_compiler_info "xlc-*"] {
|
if [test_compiler_info "xlc-*"] {
|
||||||
|
@ -1755,22 +1756,33 @@ proc gdb_compile {source dest type options} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif { $opt == "shlib_load" } {
|
} elseif { $opt == "shlib_load" } {
|
||||||
if { ([istarget "*-*-mingw*"]
|
set shlib_load 1
|
||||||
|| [istarget *-*-cygwin*]
|
|
||||||
|| [istarget *-*-pe*]
|
|
||||||
|| [istarget arm*-*-symbianelf*]
|
|
||||||
|| [istarget hppa*-*-hpux*])} {
|
|
||||||
# Do not need anything.
|
|
||||||
} elseif { [istarget *-*-openbsd*] } {
|
|
||||||
lappend new_options "additional_flags=-Wl,-rpath,${outdir}"
|
|
||||||
} else {
|
|
||||||
lappend new_options "libs=-ldl"
|
|
||||||
lappend new_options "additional_flags=-Wl,-rpath,\\\$ORIGIN"
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
lappend new_options $opt
|
lappend new_options $opt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# We typically link to shared libraries using an absolute path, and
|
||||||
|
# that's how they are found at runtime. If we are going to
|
||||||
|
# dynamically load one by basename, we must specify rpath. If we
|
||||||
|
# are using a remote host, DejaGNU will link to the shared library
|
||||||
|
# using a relative path, so again we must specify an rpath.
|
||||||
|
if { $shlib_load || ($shlib_found && [is_remote host]) } {
|
||||||
|
if { ([istarget "*-*-mingw*"]
|
||||||
|
|| [istarget *-*-cygwin*]
|
||||||
|
|| [istarget *-*-pe*]
|
||||||
|
|| [istarget arm*-*-symbianelf*]
|
||||||
|
|| [istarget hppa*-*-hpux*])} {
|
||||||
|
# Do not need anything.
|
||||||
|
} elseif { [istarget *-*-openbsd*] } {
|
||||||
|
lappend new_options "additional_flags=-Wl,-rpath,${outdir}"
|
||||||
|
} else {
|
||||||
|
if { $shlib_load } {
|
||||||
|
lappend new_options "libs=-ldl"
|
||||||
|
}
|
||||||
|
lappend new_options "additional_flags=-Wl,-rpath,\\\$ORIGIN"
|
||||||
|
}
|
||||||
|
}
|
||||||
set options $new_options
|
set options $new_options
|
||||||
|
|
||||||
if [target_info exists gdb_stub] {
|
if [target_info exists gdb_stub] {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue