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: 83738 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 EFAD73857706 for ; Wed, 10 Jan 2024 11:15:02 +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+patchwork=sourceware.org@gcc.gnu.org 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