From patchwork Wed Jan 10 11:14:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 186804 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp721015dyi; Wed, 10 Jan 2024 03:15:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHv1f3/pwzAeBFhyhiur23s6BaM4iDNAbU4qyU6oX9c/RNDRzVcxG3tAUI/MIejqonhygWB X-Received: by 2002:a05:620a:c46:b0:783:3572:6943 with SMTP id u6-20020a05620a0c4600b0078335726943mr1080496qki.102.1704885320919; Wed, 10 Jan 2024 03:15:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704885320; cv=pass; d=google.com; s=arc-20160816; b=uXsYtjqDhUaTiXOLxnoIM+ah2hqThFF8+ahCWeBhQ0dBJw/JX+IeYEad12JjV/nst9 h/7vI9j+aCaqPIOlCR+h4prGYmdFwoYQtTP+CTCrfCDZ6fOdsvx+TKZBsiZWCJlS3gZn 5bdlK81jFq4xtBwtdwjruv6aKUSqoWP04ucbxCZ4d2zim5E9X+xtLcK039ZiBf2VA6y2 iVRFAuavZ+486lxmhb/n5UMK2atDbPxvS6WoK0DDsbbDbu+Twktd3cjlz2J5HrpXXsng 4+ee/X8U2X+2mgyC/dsOcTKlQdf8BZDkV6uLHouYL4tCJ12RCLBBcG54BN53u/sPgqo3 V73g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition:in-reply-to :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=9GEyGvV2g5PvZH85eR6mhiXZXzC6lY+//y7ln4AXRD0=; fh=rNZ5myWb/f6fUYpTopW1ZqGkiCv2UGDffTsTwY8nOvE=; b=mR9hkUVX8Lu8OytpbK5xdkUxKGMYBiplSxXsualrA9FgpB9jiy4C2Vzg2B6HizhERW tHmR+4C25V9/wrCDsGKnvCAZSKum9jvrga1vrCKQ4tJ7s8EdgfEUFrmrMeoQSvoUWNhW 5NHj374AyVXuvSM1L+iD9Eny1zSCXDqAiSDsrGm/6quJHIRDQi1K2Q93fN/8KNkurR3z MoNjyfxB5BXE/PY8a4//j2nb3Wiwm8JwIK4WdqiN6N+Z0rUo/qt4d3P4qBjkY0/TAxhr lZ+vfLTLC/q3jdzBgJHjAkfmf0PCRPOpAcuyMIC84G0DoP2YtSiLCWECFeOzxmLyfCMd t/mg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bVLDsLRo; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p3-20020a05620a112300b007830cf0a689si3674590qkk.329.2024.01.10.03.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 03:15:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bVLDsLRo; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E2E8385800C for ; Wed, 10 Jan 2024 11:15:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 927CB38582AD for ; Wed, 10 Jan 2024 11:14:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 927CB38582AD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 927CB38582AD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704885264; cv=none; b=cAr0V3y9Y9qVDRKkH08Cup+N8zcCkbRcI1eqS5iJxW6VmcrfZi7fBCOHgEVIdz7tl0oC3JHrnJRvwQoNmk7CH/H0jrMR6aOYT1XkczmFb9lN0tv/6pABVKp6q7LOdXbOyP/MDR6oM8ldztGxz4T7xyJfNgSRECh1g40s76rtNAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704885264; c=relaxed/simple; bh=46gNrO3MPi/sqpU1S0RmRqYw/Nd4z7ASeIlyBEtp5e8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=d0dU6d4SBXeeA4JMMlxBtLbapm+9CnuFfuRok6obk4/3Ah6M29dVNYZhttaEWN1iyAgOm4+NpX7eO/HG2nyQTY7ijxH5BuLfH7ZXP9LUc+jWPRDfMPjNVpN/40bTbIJyJgwsb2UzCpXV2n0QOvmML/mPiSHfFTgDF3E0li05xNw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704885262; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=9GEyGvV2g5PvZH85eR6mhiXZXzC6lY+//y7ln4AXRD0=; b=bVLDsLRoNGghNws7FL+GruST3nUct2KXbKhVkSgR1LeSWFqW6PrjD0GJn0KgSwKyan+USL w91KXw+VsQMex8i7KwUv0Gs8VviZFY+PEKucTM5NEjj+RIk0Ntnhnb/5dEyszWkfpJNmYs i6hRkDo1dJbnn9CuZfpoZR4AAl890tQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-A_aPwBn8Nma6lSSZsCJ-Lw-1; Wed, 10 Jan 2024 06:14:19 -0500 X-MC-Unique: A_aPwBn8Nma6lSSZsCJ-Lw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 740C0285F998; Wed, 10 Jan 2024 11:14:19 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 184F63C39; Wed, 10 Jan 2024 11:14:18 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 40ABEG5w392008 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 12:14:16 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40ABEDoG392007; Wed, 10 Jan 2024 12:14:13 +0100 Date: Wed, 10 Jan 2024 12:14:12 +0100 From: Jakub Jelinek To: Rainer Orth , John David Anglin Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] libgomp, v2: Use absolute pathname to testsuite/flock [PR113192] Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787701830261992746 X-GMAIL-MSGID: 1787701830261992746 On Wed, Jan 10, 2024 at 10:32:56AM +0100, Rainer Orth wrote: > > When flock program doesn't exist, libgomp configure attempts to > > offer a fallback version using a perl script, but we weren't using > > absolute filename to that, so it apparently failed to work correctly. > > > > The following patch arranges for it to get the absolute filename. > > > > Tested by John David in the PR. > > This patch completely broke parallel libgomp testing on Solaris: > > ERROR: couldn't execute "\$(abs_top_srcdir)/testsuite/flock": no such file or directory Sorry for that. > FLOCK is also substituted into testsuite/libgomp-site-extra.exp.in, > which gets included into site.exp. That one has > > ## Begin content included from file libgomp-site-extra.exp. Do not modify. ## > set FLOCK {$(abs_top_srcdir)/testsuite/flock} > > So expect tries to literally execute '$(abs_top_srcdir)/testsuite/flock' > which cannot work. Does the following work then? Using autoconf's internal _AC_SRCDIRS macro doesn't seem to be a good idea to me, so I've copied what e.g. libobjc configure does instead. 2024-01-10 Jakub Jelinek PR libgomp/113192 * configure.ac (FLOCK): Use $libgomp_abs_srcdir/testsuite/flock instead of \$(abs_top_srcdir)/testsuite/flock. * configure: Regenerated. Jakub --- libgomp/configure.ac.jj 2024-01-09 09:54:03.398011788 +0100 +++ libgomp/configure.ac 2024-01-10 12:09:05.558162522 +0100 @@ -343,7 +343,16 @@ AC_MSG_NOTICE([checking for flock implem AC_CHECK_PROGS(FLOCK, flock) # Fallback if 'perl' is available. if test -z "$FLOCK"; then - AC_CHECK_PROG(FLOCK, perl, \$(abs_top_srcdir)/testsuite/flock) + # These need to be absolute paths, yet at the same time need to + # canonicalize only relative paths, because then amd will not unmount + # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd. + case $srcdir in +changequote(,)dnl + [\\/$]* | ?:[\\/]*) libgomp_abs_srcdir=${srcdir} ;; +changequote([,])dnl + *) libgomp_abs_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; + esac + AC_CHECK_PROG(FLOCK, perl, $libgomp_abs_srcdir/testsuite/flock) fi AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) --- libgomp/configure.jj 2024-01-09 09:54:03.486010551 +0100 +++ libgomp/configure 2024-01-10 12:09:15.960016006 +0100 @@ -16638,6 +16638,13 @@ done # Fallback if 'perl' is available. if test -z "$FLOCK"; then + # These need to be absolute paths, yet at the same time need to + # canonicalize only relative paths, because then amd will not unmount + # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd. + case $srcdir in + [\\/$]* | ?:[\\/]*) libgomp_abs_srcdir=${srcdir} ;; + *) libgomp_abs_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; + esac # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -16655,7 +16662,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FLOCK="\$(abs_top_srcdir)/testsuite/flock" + ac_cv_prog_FLOCK="$libgomp_abs_srcdir/testsuite/flock" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi