From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21439 invoked by alias); 14 Jan 2008 20:27:21 -0000 Received: (qmail 21429 invoked by uid 22791); 14 Jan 2008 20:27:20 -0000 X-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 14 Jan 2008 20:27:03 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0EKR1Mg010192 for ; Mon, 14 Jan 2008 15:27:01 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0EKR08O004724 for ; Mon, 14 Jan 2008 15:27:00 -0500 Received: from [172.16.57.153] (multics.rdu.redhat.com [172.16.57.153]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0EKR0wV030790; Mon, 14 Jan 2008 15:27:00 -0500 Subject: Re: /an/absolute/path/program.debug; Was: [SCM] master: Add -sysroot option to fhpd. From: Stan Cox To: Andrew Cagney Cc: frysk@sourceware.org In-Reply-To: <478B9246.3060505@redhat.com> References: <20080114051518.31275.qmail@sourceware.org> <478B9246.3060505@redhat.com> Content-Type: text/plain Date: Mon, 14 Jan 2008 20:27:00 -0000 Message-Id: <1200342313.16575.109.camel@multics.rdu.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00024.txt.bz2 Here is a more explicit example using a mock generated tree for ed and which. So if elfutils is given the path .debug:/accu/sysroot/usr/lib/debug then it will look in: /accu/sysroot/usr/bin/which.debug (looks in dir of executable) /accu/sysroot/usr/bin/.debug/which.debug (relative: looks in dir of executable + relative dir + which.debug) /accu/sysroot/usr/lib/debug/accu/sysroot/usr/bin/which.debug (absolute: looks in absolute + executable dir + which.debug) So what the code does is use a relative dir e.g. ../../usr/lib/debug/ so one gets /accu/sysroot/usr/bin/../../usr/lib/debug/usr/bin/which.debug (executable dir + relative dir + executable dir + which.debug) /accu/sysroot/bin: ./ ../ ed* /accu/sysroot/usr/bin: ./ ../ which* /accu/sysroot/usr/lib/debug/bin: ./ ../ ed.debug* /accu/sysroot/usr/lib/debug/usr/bin: ./ ../ which.debug* /accu/sysroot/usr/src/debug/ed-0.5: ./ buf.c carg_parser.h glbl.c main.c re.c ../ carg_parser.c ed.h io.c main_loop.c signal.c /accu/sysroot/usr/src/debug/which-2.16: ./ ../ bash.c getopt.h tilde/ which.c