From patchwork Thu Aug 24 15:23:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shane Slattery X-Patchwork-Id: 74657 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6524B3857712 for ; Thu, 24 Aug 2023 15:23:32 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 839C43858C53 for ; Thu, 24 Aug 2023 15:23:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 839C43858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40061928e5aso14825055e9.3 for ; Thu, 24 Aug 2023 08:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1692890597; x=1693495397; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uKsstn/GppYTfqqJnPKjpIrLV2Exj/SDAW9jRP8RM4s=; b=SqnSSgBJp0zX9CF2rnY1A3zUyNqqe2u6ir68M3BPXrhsMGWmWxtOpPPO/mpmwl36Mg yAefB6EenKqtQ8KEAKksH1dUB7KKGEcVVbIRy2dCYcbhSK1vS3mXzD5DvR1upaOCk/DF HoEx7JQCKmnspRWcL1qzLAgkNL7QV0EnxdT+qm+OfMst/HMOrZ5eJx9JI0D601jYFYXA DCXIDCHqqE6novT6yOm3/18lIpiPlO+gtjjqSJCMVITJ05q6SDlnAW8rcyfVmQrueui1 8pRjM4KmjoFUbriq8uHDxHfUxT5PpeFRBdNc3DpQDTVKSpgLweZ60Vzm5tbifPAomzYt vt6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692890597; x=1693495397; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uKsstn/GppYTfqqJnPKjpIrLV2Exj/SDAW9jRP8RM4s=; b=ImVuhffF9qYn2s9m4kZRODB4b+1slLDfh/DH7eLnaqTl7iH6utX60His3vqvMVTM9g J1q+XI/C4OU47CXYLYMd2JwckQV071Q1S5CJa3b/07r5oxOsCC9CF4YmKAT1s1IHqwqv mPLzNDNxP+VZyVEZrO/NL/sL6Bd2AilkPkOaRAp9jMpuWk+fnxI8hB3VkyST37AaNlMK WUgcgN/DEQNcwK0lTRAFDlvIirruMZY1Pym58b1oSlDfG2n+tbruFsbla0PHurYiFvfb FyJ7FhHxyDeVd51aRTFwurQ3/Gqq2Gim3A2IH1l6dB3oLT61QfMGEljwIBoOX8gXuJqH a7uQ== X-Gm-Message-State: AOJu0YznHEFqUNU4HulYyaPxxlwdHaq/YTlmcQ4Avg1R0hFEUIAixnQo zLYkcp7W1eIO2MzvEMBoyAmCaCUXGSMM3QkZMfydLg== X-Google-Smtp-Source: AGHT+IEJGMlLAL7D/VBIbQJSSRALNqFd7HCYjinvoARWbM8vphAMe7ynPslwd+g8X6uCkH+OPxlcGw== X-Received: by 2002:a7b:c84a:0:b0:401:b1c6:97e8 with SMTP id c10-20020a7bc84a000000b00401b1c697e8mr867737wml.36.1692890596775; Thu, 24 Aug 2023 08:23:16 -0700 (PDT) Received: from shane-ThinkPad-T15-Gen-1.sou.embecosm-corp.com ([212.69.42.53]) by smtp.gmail.com with ESMTPSA id i7-20020a5d5227000000b0031435731dfasm22322350wra.35.2023.08.24.08.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 08:23:16 -0700 (PDT) From: Shane Slattery To: libc-alpha@sourceware.org Cc: Shane Slattery , carlos@redhat.com, schwab@suse.de Subject: [PATCH v3] elf: Escape sed delimiter in Makefile [BZ #25127] Date: Thu, 24 Aug 2023 16:23:04 +0100 Message-Id: <20230824152304.49973-1-shane.slattery@embecosm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This is v3 of the patch. Now uses subst and shell variables for escaped string. This patch proposes a fix for BZ report #25127. Like mentioned in BZ #25127, the use of an @ character in glibc's build path breaks two sed commands, as @ is the delimiter used. This subsequently makes the build fail, as the path is then considered part of the regex. This commonly ends up affecting Jenkins concurrent builds, due to it's default usage of @ in the workspace path for said builds. While a patch was suggested in the original BZ report, this is only a mitigation and doesn't fix the issue, i.e. the same issue would occur with the character #. The issue is fixed by escaping possible @'s in the path before the path is used with sed later. No regressions or further issues have been observed due to this change. Reviewed-by: Adhemerval Zanella --- elf/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index c00e2ccfc5..a1ff5cf28f 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1291,8 +1291,9 @@ $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a # For lld, skip preceding addresses and values before matching the archive and the member. $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile + common_objpfx_esc=$(subst @,\\\@,${common-objpfx}) ; \ LC_ALL=C \ - sed -n 's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ + sed -n 's@^[0-9a-f ]*'$${common_objpfx_esc}'\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ $< | \ while read lib file; do \ case $$lib in \ @@ -1300,7 +1301,7 @@ $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile LC_ALL=C grep -F -l /$$file \ $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \ LC_ALL=C \ - sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ + sed 's@^'$${common_objpfx_esc}'\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ ;; \ */*.a) \ echo rtld-$${lib%%/*} += $$file ;; \