* lib/gdb.exp (gdb_compile): OpenBSD doesn't need -dl, and doesn't
authorMark Kettenis <kettenis@gnu.org>
Sun, 9 Sep 2007 22:19:15 +0000 (22:19 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 9 Sep 2007 22:19:15 +0000 (22:19 +0000)
know about $ORIGIN.  Calculate output dir from $dest instead of
using ${objdir}/{$subdir}.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index b7ecb215fc42410bc4f73a734770284983633963..a6536acf9ff8275d76d8daabd5b0480c5859a46e 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-10  Mark Kettenis  <kettenis@gnu.org>
+
+       * lib/gdb.exp (gdb_compile): OpenBSD doesn't need -dl, and doesn't
+       know about $ORIGIN.  Calculate output dir from $dest instead of
+       using ${objdir}/{$subdir}.
+
 2007-09-09  Mark Kettenis  <kettenis@gnu.org>
 
        * gdb.base/gcore-buffer-overflow.exp: Check whether gdb supports
index 193a076e576625e3fe8001015f87d5da35a2b3fd..5629762a251b18d9f4aacbc6ee95024f68391759 100644 (file)
@@ -1520,11 +1520,13 @@ proc gdb_compile {source dest type options} {
     global gdb_wrapper_flags;
     global gdb_wrapper_initialized;
 
-     # Add platform-specific options if a shared library was specified using
-     # "shlib=librarypath" in OPTIONS.
-     set new_options ""
-     set shlib_found 0
-     foreach opt $options {
+    set outdir [file dirname $dest]
+
+    # Add platform-specific options if a shared library was specified using
+    # "shlib=librarypath" in OPTIONS.
+    set new_options ""
+    set shlib_found 0
+    foreach opt $options {
         if [regexp {^shlib=(.*)} $opt dummy_var shlib_name] {
             if [test_compiler_info "xlc-*"] {
                # IBM xlc compiler doesn't accept shared library named other
@@ -1542,9 +1544,9 @@ proc gdb_compile {source dest type options} {
                 if { ([test_compiler_info "gcc-*"]
                       &&  ([istarget "powerpc*-*-aix*"]
                         || [istarget "rs6000*-*-aix*"] )) } {
-                    lappend options "additional_flags=-L${objdir}/${subdir}"
+                    lappend options "additional_flags=-L${outdir}"
                 } elseif { [istarget "mips-sgi-irix*"] } {
-                    lappend options "additional_flags=-rpath ${objdir}/${subdir}"
+                    lappend options "additional_flags=-rpath ${outdir}"
                 }
             }
        } elseif { $opt == "shlib_load" } {
@@ -1554,6 +1556,8 @@ proc gdb_compile {source dest type options} {
                  || [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"
@@ -1561,8 +1565,8 @@ proc gdb_compile {source dest type options} {
         } else {
             lappend new_options $opt
         }
-     }
-     set options $new_options
+    }
+    set options $new_options
 
     if [target_info exists gdb_stub] {
        set options2 { "additional_flags=-Dusestubs" }