Message ID | 20230916103619.819791-3-thomas@t-8ch.de |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1587179vqi; Sat, 16 Sep 2023 03:37:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGn1pfsUpkl1zpWOfKgqILxLr4MCPrx7DTL/74b2FRDPPhfV7GZENLVvTgSMuDdxAHmcbtH X-Received: by 2002:a17:906:68ce:b0:9a6:572f:597f with SMTP id y14-20020a17090668ce00b009a6572f597fmr3476059ejr.38.1694860620877; Sat, 16 Sep 2023 03:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694860620; cv=none; d=google.com; s=arc-20160816; b=tiYAXkU5g+o74UE1sEyWQicz+UaC76AVneNoyPAaHJoZc1rtRKyrKu3Osh+g22nDEp OgfAItyRef/jomdoOSE3ZhprkHL2Gtx74N7de44sPs48/JPF/b7HW/7PQU2/69i1rrz/ cfNVUtMk8C4G1Jrp1Ka9CgbR7uLNGaDzBWbVGMPs/sJhZJvds32eWtFi8NtgIfuj3EdU +ZKUV0kqF6QvW/6XK/coOPDwHvN80+XSlsmjbyjxJHaQRtcms1bNwEokvcxFxCJHp1sY Iiw5s8ngd77DjF3s5TCdDJDW9jWjB2uv5XRT+cpVOCLnXx+tMLXmXM+rW/3yVzZoBGhj QP9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=prJAcUZKdQq+b8mOyyXGAdS51ZvBMva0Jl+059guR4U=; fh=LUrEkQF9vvLXpHHEKq9IbL4CRmZPhfxptKOJUppCeCU=; b=Vl4wMNpVxXv23rodONG+Od95CvLjCwdVroPezABXraFsB3ywtgAburPrlT9NGeDsS/ 3+Vggz/vNVyoLrNK71BQSYPUYII3SSdgWbhLOBVo+r0FXXgoWf6U3DAid7k42wUr/9tj gkNUuRF65McXyb7FGiRgC2BrWLG1K/aQNlr+hj53myieh5OTNi8CybVMaehAJ3v/ZAGY Rwumzh6IbS+UXeVM6GmXfXrZaUUFRSFFuCDPUTgepO85VZiLUvnMaOE3lQLzfL9uVDHG RDQDQRmYdlbIselC4HPjIozMmu9NoDaRInrS6nnPv+v1AbCyuepmjDAo5EgnOob4vQ4L mOaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=GYI7pSSF; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pj4-20020a170906d78400b00993470682e9si4647443ejb.739.2023.09.16.03.37.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 03:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=GYI7pSSF; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C58C385C6EF for <ouuuleilei@gmail.com>; Sat, 16 Sep 2023 10:36:45 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by sourceware.org (Postfix) with ESMTPS id 6FFE63858CD1 for <binutils@sourceware.org>; Sat, 16 Sep 2023 10:36:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FFE63858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-8ch.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=t-8ch.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1694860594; bh=YlE22fNbpswYUwdgZ6BW6GlP9BMJeOZm9k3zmCwd6HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GYI7pSSFVym0P6ppPGo+AqVbu5qMyN3yqRo5qEI9yYOdvjPeBVtxpy1z3SsdVCqQO Lyn2T5nST/Ow8LgDjLuurPEp7ObOhSXxtK5MBYFoB29h5rihJkOKAiZ4TflW3SnWo4 Ka/JhvtzzD2ty0zFpfpwA6jYRWIEm1aCOY9Wy2KE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas@t-8ch.de> To: binutils@sourceware.org Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas@t-8ch.de>, Alan Modra <amodra@gmail.com> Subject: [PATCH v2 2/2] ld: write full paths to dependency-file Date: Sat, 16 Sep 2023 12:36:17 +0200 Message-ID: <20230916103619.819791-3-thomas@t-8ch.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230916103619.819791-1-thomas@t-8ch.de> References: <20230916103619.819791-1-thomas@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777190170583659328 X-GMAIL-MSGID: 1777190170583659328 |
Series |
Improve handling of included linker scripts in dependency-file
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Thomas Weißschuh
Sept. 16, 2023, 10:36 a.m. UTC
When relative paths are written to the dependency-file it forces the
users of it to run from the same directory.
To avoid this only write absolute paths.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
ld/ldmain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 16.09.2023 12:36, Thomas Weißschuh wrote: > When relative paths are written to the dependency-file it forces the > users of it to run from the same directory. > To avoid this only write absolute paths. Using relative paths, otoh, may allow to move build trees around. First and foremost the two behaviors may relevant when (not) building in the source tree itself. Furthermore the compiler, gcc at least, looks to also write relative paths when relative paths were given. Jan
On 2023-09-18 15:38:21+0200, Jan Beulich wrote: > On 16.09.2023 12:36, Thomas Weißschuh wrote: > > When relative paths are written to the dependency-file it forces the > > users of it to run from the same directory. > > To avoid this only write absolute paths. > > Using relative paths, otoh, may allow to move build trees around. First and > foremost the two behaviors may relevant when (not) building in the source > tree itself. Furthermore the compiler, gcc at least, looks to also write > relative paths when relative paths were given. Fair enough. Let's drop this patch then. Thomas
diff --git a/ld/ldmain.c b/ld/ldmain.c index 25cc89b72f90..f11ee6696125 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -174,7 +174,7 @@ track_dependency_files (const char *filename) { struct dependency_file *dep = (struct dependency_file *) xmalloc (sizeof (*dep)); - dep->name = xstrdup (filename); + dep->name = lrealpath (filename); dep->next = NULL; if (dependency_files == NULL) dependency_files = dep;