From patchwork Wed Aug 23 16:51:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shane Slattery X-Patchwork-Id: 74576 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 9E07A3853D16 for ; Wed, 23 Aug 2023 16:51:22 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 66F1A3858401 for ; Wed, 23 Aug 2023 16:51:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66F1A3858401 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-wr1-x435.google.com with SMTP id ffacd0b85a97d-31c479ede21so3088624f8f.2 for ; Wed, 23 Aug 2023 09:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1692809467; x=1693414267; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Mi97xVvX2OTy4sNDKv4IeEgxFECUhey3kr4+EqJ3jQE=; b=TSCxCHs4o/dmEzgin2/PTagNdLwOHYRksbPL7tQn+pgpK0SIplYIvBGQrvWvUrO/Gw HTOCZ+cti2dhqcY5PAvaiYujBz+JhYvjrtzhS91xpLdk0Z9QVqrq0rDBoVJFmL4RwHlO F4bZaaKL8RKzO1TZRCL/yCSHGaj2/5sqmXNmqOt2QrOzD0CRCJtczhj/iTCRbs0ZogD0 oSlLY+UNVhB6KI9qPiex6nI1RjCw9LrrEhIRwsuCp7D9Nn9fjLtQ0uBBRpffFgn9s6N/ oo7AqtiDUmHPWYGBU8evLbKIP384ZGAxMeLdbzZCpbUu0gCXXKfAwTD+i2DOfZJYYGyY rdoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692809467; x=1693414267; 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=Mi97xVvX2OTy4sNDKv4IeEgxFECUhey3kr4+EqJ3jQE=; b=V+Y0CclBtTj7e/dm8Ohzy2bK3tqU9XjHNTqC4/G9bPSZ+mILYxdWLkYRB0ZkrtNQzj Kf7GkldQbwxC8L2O9T5HL7tbyY+gqFLCR+IFrN6KNEG13JpC9r9uWOkXvdmFywepxeci diFTXDgVOJ8AbC7k4TysHxEsWx3xwFv1VgSqk+EtHPNWYEU8xJjNyN5cMrodvVIlzIY+ DfBWn3HMm0KClj/Fk17WiCmDpX9cacAOG4e3TBpoVWpmHPyaD6YymcZVGa6BpUFHVuUT SayDt5fLDOVKR7vS9diVKPvv3iyaHhknStLrsdlL8B1RyRHbpXoptSqp5228EkxKgsOu jxxQ== X-Gm-Message-State: AOJu0YxIdsxY/ebG1FZgQgAERa6UjN9HLORxFd1TvhFWofsZFwtNMbUp IYjjkFrLx/Qgj0h388NuMRp9ygj9Xy+/piYY8KP0mQ== X-Google-Smtp-Source: AGHT+IHVbS3vBLUJNPd65AcMwLZAdEwrLHfqvjL7rRoye3XJJ9R3vtB43VubA49vyx6X9wIFhEH+2Q== X-Received: by 2002:adf:d0c4:0:b0:319:785a:fce5 with SMTP id z4-20020adfd0c4000000b00319785afce5mr8936021wrh.38.1692809466708; Wed, 23 Aug 2023 09:51:06 -0700 (PDT) Received: from shane-ThinkPad-T15-Gen-1.sou.embecosm-corp.com ([212.69.42.53]) by smtp.gmail.com with ESMTPSA id n17-20020a5d4211000000b0030ae499da59sm19511684wrq.111.2023.08.23.09.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 09:51:06 -0700 (PDT) From: Shane Slattery To: libc-alpha@sourceware.org Cc: Shane Slattery , carlos@redhat.com Subject: [PATCH] elf: Escape sed delimiter in Makefile [BZ #25127] Date: Wed, 23 Aug 2023 17:51:03 +0100 Message-Id: <20230823165103.38950-1-shane.slattery@embecosm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.9 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 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..3545ad6d3c 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 = $(shell echo '${common-objpfx}' | sed -n 's@\@@\\\@@gp')) 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 ;; \