From patchwork Wed Oct 16 21:51:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1178191 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=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106044-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="mWG5hFnG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46tmGS4hnDz9sPF for ; Thu, 17 Oct 2019 08:51:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; q=dns; s=default; b=rXi/YCVCR9FiksNk Zd4rvQoR2il0Y7dRZN2rg7TNWFMKrOthK9ZUBHM0XHGaKXRylST3njjONp8qBvpm yxnCDnsmq4ptxw9WdZXNviTAKnAduqcMKcG1TkELgXwrsdFrmDxlsvfDdzkBMjvE uzCFEAWUAwJ+nj05hdWEBm3xBeE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; s=default; bh=zsf3wHDFF9/a2Fre3cR6mb 60ujs=; b=mWG5hFnGHz2bdzbR4R+s7KRar6TzJXBda63KnwPXwnGTgTX24ARQqM k+8Dtu8aRT37CrysuFsFMFlZz2Yt23i5tCHwgpjkSya8VbPWiscdXJo1DknHXrbU oXaR7i7a+a39wrq5tptbAaSVxoRXZ+7V9bHQm73f1JZ2gLhTo1bKM= Received: (qmail 98296 invoked by alias); 16 Oct 2019 21:51:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 98288 invoked by uid 89); 16 Oct 2019 21:51:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=U*dj, dj@redhat.com, delorie, djredhatcom X-HELO: esa3.mentor.iphmx.com IronPort-SDR: nN+z3FL8jLDsdfMK5Qng/7FVvCVRQA2xsLzNHlG6cVTtpBpdCuzdkLJvo99sjqh8iXxTUm3rt1 6vKnB7wM1Nue/VcSrdhijwJZAF+v5S1EdlYcqTdo+RjWFPfAlpYsMOOhS7e2/McxPg9UHRKfQs 30/xLghWLQKtJloBLL4Ggm8a78MvISj9B/sNyqHN1Jnfj4Q7AcgXdFGUO1BXyZnM777mAhalrK +ydCa7jMYr7Wr2t4Il5WlIVITsdo0Ow+jefqRMWE7O9MTZ1R6QGyOBqIKfiZblIjKuikzAjr3G dLk= IronPort-SDR: WJ47kLJLXrxSqVtYT55lTJ/jsHydl4kQ0hIi/Iafp5NyCBXso6ZeKc+DzElpfxnp0K0kY7+/ut YnWhQQMYDd38v7tuy8IpEXUwD1sN3mfVtvc1NN8o0aj8enZzHASMXSU9pL/6g6Tgw3OKzPLrn7 wHO/+17Ew/tLfl3/EDW/A25WFwOw6tamkEHx8nl1JN//H+qfJ6Glt5NRnPBLnN5nkI71bWiFHo qzR2EEwDm74PU0y52fwVoxFl5zodK7ZMgGAr+jmwObvYwUDY4+3g6kOqShXT/YDimD+nfIsEDz OkM= Date: Wed, 16 Oct 2019 21:51:31 +0000 From: Joseph Myers To: CC: Subject: Fix testroot.pristine creation copying dynamic linker Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 This patch addresses an issue reported in where the creation of testroot.pristine, on encountering LD_TRACE_LOADED_OBJECTS=1 of the form libc.so.6 => /scratch/jmyers/glibc/mbs/obj/glibc-8-0-mips64-linux-gnu-x86_64-linux-gnu/default/libc.so.6 (0x772dd000) /lib32/ld.so.1 => /scratch/jmyers/glibc/mbs/obj/glibc-8-0-mips64-linux-gnu-x86_64-linux-gnu/default/elf/ld.so.1 (0x7747b000) tries to copy /lib32/ld.so.1 (which does not exist) into the testroot instead of copying the path on the RHS of "=>", which does exist, because the Makefile logic assumes that the path on such a line with '/' should be copied, when if there are such paths on both the LHS and the RHS of "=>", only the one on the RHS necessarily exists and so only that should be copied. The patch follows the approach suggested by DJ in . Tested for x86_64, with and without --enable-hardcoded-path-in-tests; also previously tested for MIPS, with and without --enable-hardcoded-path-in-tests, to confirm it fixes the original problem. Co-authored-by: DJ Delorie diff --git a/Makefile b/Makefile index a736c3afcc..b16b82d3e1 100644 --- a/Makefile +++ b/Makefile @@ -555,7 +555,7 @@ ifeq ($(run-built-tests),yes) for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \ $(rtld-prefix) \ $(objpfx)testroot.pristine/bin/sh \ - | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\ + | grep / | sed 's@.*=> /@/@' | sed 's/^[^/]*//' | sed 's/ .*//'` ;\ do \ test -d `dirname $(objpfx)testroot.pristine$$dso` || \ mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\ @@ -564,7 +564,7 @@ ifeq ($(run-built-tests),yes) for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \ $(rtld-prefix) \ $(objpfx)support/$(LINKS_DSO_PROGRAM) \ - | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\ + | grep / | sed 's@.*=> /@/@' | sed 's/^[^/]*//' | sed 's/ .*//'` ;\ do \ test -d `dirname $(objpfx)testroot.pristine$$dso` || \ mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\