From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78603 invoked by alias); 11 Apr 2016 13:12:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 78522 invoked by uid 89); 11 Apr 2016 13:12:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2123, gdbtesters, gdb-testers X-HELO: mail-pa0-f46.google.com Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 11 Apr 2016 13:12:17 +0000 Received: by mail-pa0-f46.google.com with SMTP id td3so121506264pab.2 for ; Mon, 11 Apr 2016 06:12:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=N7MhXPrbnLvLtLIuBop/0bfr/Wis1mQhLmNyqb8WXW8=; b=UByaB2BsbcJ337EqlT7HfmBJg13/7dh1rrPOILk4h0nq0tUVx8dmv0iDhPmO/AiRrD Ggsn7jH7btZCAmK31ZIe4AONA4ytqmKcbsn5ESWpQPR3MslxDic2xzd58Jl6AfttMsTa 3/minHX7s7iBuh8C6zF0OUwGA0rREVryvLJzodab2nqZn/s6/CqZAb9d//RPqOzNCIFg g/phChIHJQqAOCbzAatKf8oJQPcngt7QxWqUz3gt849fUu0Fo26MMM/mzrqBYgFSIxnI k+r2J8K1NpCvJXNWUES9aGiOBIsLDBIeOuMpoDjVZ6DypPaLgS92JqGmV8bkKkRxHrrj ttpg== X-Gm-Message-State: AD7BkJIvUwXe+Ow+NtKe2BHTcgTfJAG95S6mpXQrki0VuS4af3UIsP3aKrspSI8AfPneag== X-Received: by 10.66.153.101 with SMTP id vf5mr33085283pab.131.1460380335747; Mon, 11 Apr 2016 06:12:15 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id z13sm36365356pfi.5.2016.04.11.06.12.12 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 11 Apr 2016 06:12:14 -0700 (PDT) From: Yao Qi To: Simon Marchi Cc: Subject: Re: [PATCH v2 2/2] Make ftrace tests work with remote targets References: <1459794657-2087-1-git-send-email-simon.marchi@ericsson.com> <1459794657-2087-2-git-send-email-simon.marchi@ericsson.com> Date: Mon, 11 Apr 2016 13:12:00 -0000 In-Reply-To: <1459794657-2087-2-git-send-email-simon.marchi@ericsson.com> (Simon Marchi's message of "Mon, 4 Apr 2016 14:30:57 -0400") Message-ID: <8660vol272.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00205.txt.bz2 Simon Marchi writes: > The executable and the library are then uploaded side-by-side on the > remote system. To allow the dynamic linker to find the shared library, > we have to add the special RPATH value $ORIGIN, which tells it to search > in the executable's directory: > > $ readelf -a testsuite/gdb.python/py-shared | grep ORIGIN > 0x000000000000000f (RPATH) Library rpath: [$ORIGIN] > > The problem with the IPA library is that it doesn't have an SONAME, > making it very difficult to do testing on a remote board. When a > test executable is linked with it, it contains an absolute reference to > the library path. Therefore, unless the paths on the target are the > same as on the build system, it won't work. Yes, that is how fast tracepoint works for me. My build and target have the same directory hierarchy. In fact, target /scratch is mounted to build /scratch through nfs. That is quite convenient, and don't need to copy binaries and libraries from host to target. However, this commit breaks my testing. It also breaks the typical testing with native-gdbserver. See https://sourceware.org/ml/gdb-testers/2016-q2/msg001= 62.html > > To make it possible for tests using the IPA library to run test on > remote boards, I suggest adding an SONAME to libinproctrace.so. I don't > think it should be a big problem for users. All the libraries installed > on my system have an SONAME, so it should be fine if libinproctrace.so > does too. That is fine to add SONAME... > > As a consequence, native testing does not work anymore, since > executables do not contain the absolute path to the library anymore. To > keep them working, we can have gdb_load_shlibs copy the library to the > test directory when testing natively. That's done by modifying > gdb_load_shlibs. We also have to add RPATH=3D$ORIGIN to executables, even > when testing natively. However, setting "RPATH=3D$ORIGIN" only works for your testing env, because executable and libraries can be downloaded to the different places on the target. --=20 Yao (=E9=BD=90=E5=B0=A7)