From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9C28C1F4B4 for ; Sun, 20 Sep 2020 14:50:10 +0000 (UTC) Received: from localhost ([::1]:48630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK0fI-0001sn-Pa for normalperson@yhbt.net; Sun, 20 Sep 2020 10:50:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK0fF-0001rO-94 for bug-gnulib@gnu.org; Sun, 20 Sep 2020 10:50:05 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.218]:35980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK0fC-0003tv-Tc for bug-gnulib@gnu.org; Sun, 20 Sep 2020 10:50:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600613399; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=BwN7bxe6dkzDBgis2aw1y8Z+5ieUw2PcVJYhHsQ5U58=; b=L/H55z70rJqa9p9YzGfJcGuJL0bHIAmtRRvwF4Xr8axJxqh4xlVOi2AfkTArDyfSK4 IK8V1VUM7KgWoUMY1I1UDFFLtsa8K1RNVBa+6asRSeUp5VGq+FZ7EhQnC0O4laF9n9TO mA7ruihON3tH8Gs7s+mgWWyoipA8eXiRmtC5WErAQoF/zD58SePQzXc+0PpZ8ajyzDk4 1wYbxXAWnLipPQFnBtUhfdDNecJ2Aq1o3+3uoK/LDAorOGrUFcpxviDY7YTkMXEbw7Nd Ffk5CwiGPkoQfCvfOzUGuSXUsJnDrufKZvwXvx+ADVOpeAUnTl1n65wYCVh9ohgUOc5J 4kyQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqfyyPs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id z05f0fw8KEnx8ck (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 20 Sep 2020 16:49:59 +0200 (CEST) From: Bruno Haible To: Ben Pfaff Subject: Re: [PATCH] reloc-ldflags: Fix handling of multiple relocatable library directories. Date: Sun, 20 Sep 2020 16:49:58 +0200 Message-ID: <2059262.66RfUa1sB5@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20200914005236.3852819-1-blp@cs.stanford.edu> References: <20200914005236.3852819-1-blp@cs.stanford.edu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Received-SPF: none client-ip=81.169.146.218; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 10:49:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Ben, Thanks for the patch! You are right: since none of the platforms for which reloc-ldflags is being used is AIX, HP-UX, IRIX =E2=80=94 these are the pla= tforms for which libtool.m4 defines hardcode_libdir_separator to ':' =E2=80=94, th= e rpath options are cumulative. I applied your patch, revising comments and a variable name. 2020-09-19 Ben Pfaff Bruno Haible relocatable-prog: Fix for multiple relocatable library directories. * build-aux/reloc-ldflags: Fix handling of multiple relocatable library directories. Each one needs its own -Wl,-rpath,$dir option, instead of being attached to a single one. diff --git a/build-aux/reloc-ldflags b/build-aux/reloc-ldflags index 145e741..cdb2f47 100755 =2D-- a/build-aux/reloc-ldflags +++ b/build-aux/reloc-ldflags @@ -68,7 +68,9 @@ case "$host_os" in ;; esac if test -n "$origin_token"; then =2D rpath=3D + # We are not on AIX, HP-UX, or IRIX. Therefore the -rpath options are + # cumulative. + rpath_options=3D save_IFS=3D"$IFS"; IFS=3D":" for dir in $library_path_value; do IFS=3D"$save_IFS" @@ -89,8 +91,8 @@ if test -n "$origin_token"; then idir=3D`echo "$idir" | sed -e 's,^//*[^/]*,,'` done dir=3D"$origin_token"`echo "$idir" | sed -e 's,//*[^/]*,/..,g'`"$d= ir" =2D # Add dir to rpath. =2D rpath=3D"${rpath}${rpath:+ }$dir" + # Augment rpath_options with dir. + rpath_options=3D"${rpath_options}${rpath_options:+ }-Wl,-rpath,$di= r" ;; *) if test -n "$dir"; then @@ -101,15 +103,14 @@ if test -n "$origin_token"; then done IFS=3D"$save_IFS" # Output it. =2D if test -n "$rpath"; then + if test -n "$rpath_options"; then case "$host_os" in # At least some versions of FreeBSD, DragonFly, and OpenBSD need the # linker option "-z origin". See . freebsd* | dragonfly* | openbsd*) =2D echo "-Wl,-z,origin -Wl,-rpath,$rpath" ;; =2D *) =2D echo "-Wl,-rpath,$rpath" ;; + rpath_options=3D"-Wl,-z,origin $rpath_options" ;; esac + echo "$rpath_options" fi else echo "relocation via rpath not supported on this system: $host" 1>&2