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.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 8E9D41F4B4 for ; Mon, 14 Sep 2020 00:54:36 +0000 (UTC) Received: from localhost ([::1]:44698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHclO-00076s-V4 for normalperson@yhbt.net; Sun, 13 Sep 2020 20:54:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHclG-00076g-FO for bug-gnulib@gnu.org; Sun, 13 Sep 2020 20:54:26 -0400 Received: from smtp2.cs.stanford.edu ([171.64.64.26]:40200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHclE-000170-Hz for bug-gnulib@gnu.org; Sun, 13 Sep 2020 20:54:26 -0400 Received: from 75-54-222-30.lightspeed.rdcyca.sbcglobal.net ([75.54.222.30]:36290 helo=sigxcpu.attlocal.net) by smtp2.cs.Stanford.EDU with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1kHcl8-0001qP-L8; Sun, 13 Sep 2020 17:54:19 -0700 From: Ben Pfaff To: bug-gnulib@gnu.org, Bruno Haible Subject: [PATCH] reloc-ldflags: Fix handling of multiple relocatable library directories. Date: Sun, 13 Sep 2020 17:52:37 -0700 Message-Id: <20200914005236.3852819-1-blp@cs.stanford.edu> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scan-Signature: 2d1a4fa5d0150c38835749a59b44c419 Received-SPF: pass client-ip=171.64.64.26; envelope-from=blp@cs.stanford.edu; helo=smtp2.cs.Stanford.EDU X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/13 20:54:20 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Ben Pfaff Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Each one needs its own -Wl,-rpath,$dir option, instead of being attached to a single one in some way. Otherwise, the build fails at link time. --- 2020-09-13 Ben Pfaff * 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 145e741f8f..b1188a8707 100755 --- a/build-aux/reloc-ldflags +++ b/build-aux/reloc-ldflags @@ -90,7 +90,7 @@ if test -n "$origin_token"; then done dir="$origin_token"`echo "$idir" | sed -e 's,//*[^/]*,/..,g'`"$dir" # Add dir to rpath. - rpath="${rpath}${rpath:+ }$dir" + rpath="${rpath}${rpath:+ }-Wl,-rpath,$dir" ;; *) if test -n "$dir"; then @@ -106,9 +106,9 @@ if test -n "$origin_token"; then # At least some versions of FreeBSD, DragonFly, and OpenBSD need the # linker option "-z origin". See . freebsd* | dragonfly* | openbsd*) - echo "-Wl,-z,origin -Wl,-rpath,$rpath" ;; + echo "-Wl,-z,origin $rpath" ;; *) - echo "-Wl,-rpath,$rpath" ;; + echo "$rpath" ;; esac fi else -- 2.28.0