From patchwork Thu Aug 24 12:11:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shane Slattery X-Patchwork-Id: 1825357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=Y3U51NIj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RWhmG30l7z1yZs for ; Thu, 24 Aug 2023 22:12:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 780E53857C5A for ; Thu, 24 Aug 2023 12:12:28 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 267E63858C2C for ; Thu, 24 Aug 2023 12:12:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 267E63858C2C 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-x331.google.com with SMTP id 5b1f17b1804b1-3fef56f7248so31968695e9.3 for ; Thu, 24 Aug 2023 05:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1692879136; x=1693483936; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bb2lUFjuQNqfIeuVjnwak6RDtYtTeJXjIQmvJRQkDlc=; b=Y3U51NIjXyfTc1bZQzEep1lg2Ok+okeIgbJhJY2FLQ2JZyDIFasm8v5wuUObTD1HlP Fy536Fy8shDLVK5gLwAB5IyAe/EyddbIU3I7tzT7tXcxhPIaA9Bqd9B68SCgNFUNVj9j 66X+AcMcMz4APycL0+ae8LNdef0HaFboRCv/szG3oSdB6a/zECAxMonx28kZAn5tk1yT FmMEOomWdgpnQ6ASnjWc7UcBgXcRiPGDmVV5i8p8VCTN9qSuPrNfw4FWPtQEcRXLE04/ R9KDwDCfYqgVZFEoXM4Uu7+eubEwfakLAtVLw6SOAgHYpPX9UiwjTgbCySVWcwVylybh ++nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692879136; x=1693483936; 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=bb2lUFjuQNqfIeuVjnwak6RDtYtTeJXjIQmvJRQkDlc=; b=MKJJ6J2+2UW+xwzW9ULwZ2lQanxnWDaCNjVK1ZmWDeoaM10j9q/aNzGC6FKDBnxRoC F36o1NDyBBp5tnbr2xr6N5WenmN4KVhSXlTQNKrkGqLri/qLLiVmeJLs8BbaAp3We5hT sLF0o1nmMoy22B/PEhM3ooibib7AZ5UXfGIg/VAsPAJrOQXSUN4VVMbFdV9NauZ1PbmD lodRrL2tgKJ89i4Izul9T24LdFwZWPIfyHF81SDZw8D2wcrdpljKdMQ3XCyyVEXucOPk QWpznTU82EWGiJTWtQiAQ+Jif7LRUSluPYnCXmNUFX2k+GIRB7zPMEZTaxCXYa0xb6/m makg== X-Gm-Message-State: AOJu0YxJoupI/inw3xFDbpJ5skGLdCqhHxTiAU1poz6rxkSYXCqdhh/G sL+o4w9MysCTGDGkNoTSvgFQiPBIF1vEAkdLUbwoAw== X-Google-Smtp-Source: AGHT+IGsHq6Q2vnZF2umsXEgVD33HhhnDp7X+rjWPGlTUJVp4XCMD5WJDLs0ZP4NS3tCjmyueoJ1xQ== X-Received: by 2002:a7b:cd8a:0:b0:400:8d91:ffea with SMTP id y10-20020a7bcd8a000000b004008d91ffeamr2739265wmj.37.1692879136403; Thu, 24 Aug 2023 05:12: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 p25-20020a1c7419000000b003fe195cecb3sm2456371wmc.38.2023.08.24.05.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 05:12:15 -0700 (PDT) From: Shane Slattery To: libc-alpha@sourceware.org Cc: Shane Slattery , carlos@redhat.com Subject: [PATCH v2] elf: Escape sed delimiter in Makefile [BZ #25127] Date: Thu, 24 Aug 2023 13:11:47 +0100 Message-Id: <20230824121147.11435-1-shane.slattery@embecosm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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 adding an additional sed command to escape possible @'s in the path before it is used with sed later. No regressions or further issues have been observed due to this change. --- elf/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index c00e2ccfc5..8eabd647fb 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 + $(eval 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 ;; \