From patchwork Fri Jul 15 14:14:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 2714 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C42E323F55 for ; Fri, 15 Jul 2011 14:14:51 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 8BBDBA18793 for ; Fri, 15 Jul 2011 14:14:51 +0000 (UTC) Received: by qwb8 with SMTP id 8so875626qwb.11 for ; Fri, 15 Jul 2011 07:14:51 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr2898689qci.114.1310739289613; Fri, 15 Jul 2011 07:14:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs49351qcb; Fri, 15 Jul 2011 07:14:48 -0700 (PDT) Received: by 10.227.179.14 with SMTP id bo14mr3153337wbb.90.1310739287787; Fri, 15 Jul 2011 07:14:47 -0700 (PDT) Received: from mtagate1.uk.ibm.com (mtagate1.uk.ibm.com [194.196.100.161]) by mx.google.com with ESMTPS id ep1si2792538wbb.109.2011.07.15.07.14.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jul 2011 07:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of uweigand@de.ibm.com designates 194.196.100.161 as permitted sender) client-ip=194.196.100.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of uweigand@de.ibm.com designates 194.196.100.161 as permitted sender) smtp.mail=uweigand@de.ibm.com Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p6FEEktk009852 for ; Fri, 15 Jul 2011 14:14:46 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6FEEkjl1814696 for ; Fri, 15 Jul 2011 15:14:46 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p6FEEjJq031842 for ; Fri, 15 Jul 2011 08:14:45 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p6FEEi9t031837 for ; Fri, 15 Jul 2011 08:14:44 -0600 Message-Id: <201107151414.p6FEEi9t031837@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 15 Jul 2011 16:14:44 +0200 Subject: [rfc] Fix remote shared library tests (fwd) To: patches@linaro.org Date: Fri, 15 Jul 2011 16:14:44 +0200 (CEST) From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 http://sourceware.org/ml/gdb-patches/2011-07/msg00241.html ChangeLog: * lib/gdb.exp (gdb_compile): Specify rpath if the *target* is a remote machine, not the host. (gdb_compile_shlib): Set soname if target is remote. Index: gdb/testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.182 diff -u -p -r1.182 gdb.exp --- gdb/testsuite/lib/gdb.exp 1 Jul 2011 00:19:25 -0000 1.182 +++ gdb/testsuite/lib/gdb.exp 7 Jul 2011 13:19:23 -0000 @@ -2168,7 +2168,7 @@ proc gdb_compile {source dest type optio # 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 { $shlib_load || ($shlib_found && [is_remote target]) } { if { ([istarget "*-*-mingw*"] || [istarget *-*-cygwin*] || [istarget *-*-pe*] @@ -2383,7 +2383,17 @@ proc gdb_compile_shlib {sources dest opt || [istarget *-*-cygwin*] || [istarget *-*-pe*])} { lappend link_options "additional_flags=-Wl,--out-implib,${dest}.a" - } + } elseif [is_remote target] { + # By default, we do not set the soname. This causes the linker + # on ELF systems to create a DT_NEEDED entry in the executable + # refering to the full path name of the library. This is a + # problem in remote testing if the library is in a different + # directory there. To fix this, we set a soname of just the + # base filename for the library, and add an appropriate -rpath + # to the main executable (in gdb_compile). + set destbase [file tail $dest] + lappend link_options "additional_flags=-Wl,-soname,$destbase" + } } if {[gdb_compile "${objects}" "${dest}" executable $link_options] != ""} { return -1