From patchwork Mon May 10 11:48:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_H=C3=B6ger?= X-Patchwork-Id: 1476336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fdzpv2nmsz9t5K for ; Mon, 10 May 2021 21:48:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1338B38515E5; Mon, 10 May 2021 11:48:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.umpa-net.de (mail.umpa-net.de [85.25.45.218]) by sourceware.org (Postfix) with ESMTPS id A889E3857C6D for ; Mon, 10 May 2021 11:48:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A889E3857C6D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=umpa-net.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=choeger@umpa-net.de Received: by mail.umpa-net.de (Postfix, from userid 502) id A6A12AC99C9; Mon, 10 May 2021 11:48:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from firebrand.celeraone.local (unknown [178.19.211.114]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: choeger) by mail.umpa-net.de (Postfix) with ESMTPSA id BC1AFAC99C6; Mon, 10 May 2021 11:48:43 +0000 (UTC) From: choeger@umpa-net.de To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix awk substr invocation in libgo buildsystem Date: Mon, 10 May 2021 13:48:28 +0200 Message-Id: <20210510114828.200068-1-choeger@umpa-net.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" From: Christoph Höger The awk script used a zero-based index which worked on surprisingly many plattforms. According to the man page, however, the function expects one-based indexing. For reference see this bug in the go git repository: https://github.com/golang/go/issues/45843 Signed-off-by: Christoph Höger --- ChangeLog | 4 ++++ libgo/mklinknames.awk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2174ab1ea90..495e6f79b76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-05-10 Christoph Höger + + * libgo/mklinknames.awk: Fix awk substr invocation + 2021-05-04 Nick Clifton * configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99. diff --git a/libgo/mklinknames.awk b/libgo/mklinknames.awk index 71cb3be7966..0e49c07349e 100644 --- a/libgo/mklinknames.awk +++ b/libgo/mklinknames.awk @@ -37,7 +37,7 @@ BEGIN { # The goal is to extract "__timegm50". if ((def | getline fndef) > 0 && match(fndef, "__asm__\\(\"\\*?")) { asmname = substr(fndef, RSTART + RLENGTH) - asmname = substr(asmname, 0, length(asmname) - 2) + asmname = substr(asmname, 1, length(asmname) - 2) printf("//go:linkname %s %s\n", gofnname, asmname) } else { # Assume the asm name is the same as the declared C name.