Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1051294lqb; Wed, 29 May 2024 20:59:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEpxNOLDi2E+05fcvmzVuwZ85Fn/k4HRH9es+Lvi1+7f22oFrxzh18WOd8ppjdMTK7xwgEwSG2MNky8qkK9UTDt5R6ddxwpEHGQv2TlA== X-Google-Smtp-Source: AGHT+IEwyNe+Rpm9Cplev8tapPDuf+ITVP5bmXVbAb7kAO2CeOOLd8GWKy7vBI+Qz3VOAJjriBOk X-Received: by 2002:a05:6a20:2592:b0:1ad:7e4f:9564 with SMTP id adf61e73a8af0-1b264d0bbeemr1134971637.9.1717041586489; Wed, 29 May 2024 20:59:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717041586; cv=pass; d=google.com; s=arc-20160816; b=WiwzlL+0YbkBs+xwMvlVp2Go+vHWX79yb+LfdBnSka3x1fJfZlgSRxRlGAGZWBgogJ YU6uTJWIsR6KY98Qx0nVwZKMDrVelVRrRkK75+48JcBKmDN5P144vVE6PDBZz5FPq8De WKyYIzoVu6uk/EvBLMS6IHqE0lHM+QYh9khIqvnpVpL+X6tKEd5Z/9cYvrrEqS0Q+sEw k21WYo3/v+oFZHeCbFSGTNe7m502aSDQngkQt7aoCXSF9OWACRFho9XjJmvZDseS5Ob9 o9I63Bzy5KV8f/tMh04jUO6EkT0HHUNS/bwrnXRTeNh98YKa4RprqPEg86ay+8Qw+rE9 p5Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=rG0Pdb2Y7gIzMyafEIvOWx8ie2A7wE28m+fCJ4yksKY=; fh=UA1nYGVp3TAB9VjsH3VaAFO2yBqtbB8QrbRRN3I8RyY=; b=wRn4KGh8s/moWqqhvRCExSaqzvKKndbTKnaRkJRIugeecW9FINxeVdlpQ3J2sQf0f0 co26Lq2vMYktcf4PGvMfag2g2NDwAQSSDBCKtqXjHgA+N75AH2/CnnXHEgag2lY7pC6p IxFVygCQKiAQkNGN3kAb/mu2zEEWJcT01+cFaIDm2KL8Twytpf+vrJN4tbf+BUQk7/NN 0twpwPd4BM3dDSTfZ6oHxcQ026wZx/cdvSrr5Z2qI8Xr79hckANSyl4E6K5CiinHYOZ+ 46+l5irXHQS0zSW15t2Ra9+3HB0HPHtPjiaJkCBKRRl2iLlrrM/v5kGBMOt9fbAJpKUa ThTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WYSmuaTN; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-194928-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194928-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68227890311si211171a12.381.2024.05.29.20.59.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 20:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194928-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WYSmuaTN; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-194928-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194928-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4035EB22781 for ; Thu, 30 May 2024 03:59:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80A3A142E85; Thu, 30 May 2024 03:59:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="WYSmuaTN" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F08D8142E6F; Thu, 30 May 2024 03:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717041574; cv=none; b=HJDRK/0HN8WDxn8wZxYmBV+6BTAVdvUqMcKieVo3e+coxo0U5J1kxFJJpcZRizsh/f5ViPpfgZGOCKkaYWFER59GaJnvnpQOP3ZM0nRakTG95/n18YjTwHd7GZdFzT/iMnsr0OFrDya2za0CYcfPt5+PoqZu/8roI9jVcX6VGsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717041574; c=relaxed/simple; bh=9gLs7dItiedAyafKsMJMGtK8+Z2kcch88RTbxpGs1p8=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=hr9wAgj17I7bM3RCsfMAoD40UZoPJpIcpIGk7DYgFEFUqh2dHGPY+B7HzqDUJ/RFc7FyWv6nrlcj4VsOq9EPfacq/1ZEwLW+/D1HJ0WMyN37fCsbMC80Zai4R2J2tDwn0rA3aRRqVxUamwzhX0u7elI3bk8flq6gtMvnZlcMHN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=WYSmuaTN; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1717041565; bh=9gLs7dItiedAyafKsMJMGtK8+Z2kcch88RTbxpGs1p8=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=WYSmuaTNp9CC+ndkb/1rio4Ix4NnGx/LWZ/7oTnyfv74NEaC6CfSXm2jpCN6yTbFo DDogU6lcsqSfCU/7L/CiCAlzfqeAdThfqjkHytPMQghPSJAPBciZggMhxCL/VnMRdT sc/yGzRqxNQ78opzlDqnaAL/tbjWfIlqj1EN+VJ2dhCVfIE9T3vjOtwCqG/RXth53c 6xQUsf3lVI9jbekxKww5CYKj52soDRLt8kupKFnber3P6vYqYYHFOE+9uTpsXpkWqW QwTW3sQFNbW0F0TzjOIiw7BRjapmBOUyK3cSmV3hdaTvF7rqkfzWLafGlo/CYnqOVh WmkfgFYwztCQg== Received: from [100.113.15.66] (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D50B23781183; Thu, 30 May 2024 03:59:17 +0000 (UTC) Message-ID: <1aec9470-9af2-4113-9cbb-9930ccd92a0b@collabora.com> Date: Thu, 30 May 2024 08:58:46 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , Andrew Morton , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Maciej Wieczor-Retman , Christian Brauner , Alexey Gladkov , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev, Ryan Roberts , Shuah Khan Subject: Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS To: John Hubbard References: <20240504044336.14411-1-jhubbard@nvidia.com> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/10/24 10:56 PM, John Hubbard wrote: > On 5/10/24 4:52 AM, Ryan Roberts wrote: >> On 04/05/2024 05:43, John Hubbard wrote: > ... >> It just occured to me that the bug report I was fixing with my attempt was >> invoking make like this (see [1]): >> >> # tools/testing/selftests/fchmodat2$ make CC=clang >> # tools/testing/selftests/openat2$ make CC=clang >> >> So LLVM is not set in this case. Perhaps my approach [2] (suggested by >> Arnd) of >> using cc-option is more robust? (cc-option is alredy used by other >> selftests). >> > > Yes, I think that would better handle the two cases: setting LLVM, > and/or setting CC (!). > > For that, some nits, but only worth fussing over if the patch hasn't > gone in yet, or if you're changing it for some other reason: > > In Make, the arguments to functions include *all* spaces, so it's good > practice to not add spaces in most function calls, unless they are > definitely desired. > > Also, you only ever want one of those $(CC) options, so saying so is a > nice touch. Neither of these is a functional issue in [2], but you could > do this on top of the patch (I'm only showing the openat2 case): I was building with CC=clang and build was still failing. We should be able to build by CC=clang and LLVM=1 both. It seems like patches still haven't been accepted. Let's get a v2 out to fix this. > > diff --git a/tools/testing/selftests/openat2/Makefile > b/tools/testing/selftests/openat2/Makefile > index 02af9b6ca5eb..c894778874a5 100644 > --- a/tools/testing/selftests/openat2/Makefile > +++ b/tools/testing/selftests/openat2/Makefile > @@ -3,7 +3,7 @@ >  include ../../../build/Build.include > >  CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined > -CFLAGS += $(call cc-option, -static-libasan) $(call cc-option, > -static-libsan) > +CFLAGS += $(call cc-option,-static-libasan,$(call cc-option,-static-libsan)) >  TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test > >  include ../lib.mk > > >> >> [1] https://lore.kernel.org/all/202404141807.LgsqXPY5-lkp@intel.com/ >> [2] >> https://lore.kernel.org/linux-kselftest/20240417160740.2019530-1-ryan.roberts@arm.com/ >> >> >>> + >>> +LOCAL_HDRS += helpers.h >>> + >>>   include ../lib.mk >>>   -$(TEST_GEN_PROGS): helpers.c helpers.h >>> +$(TEST_GEN_PROGS): helpers.c >>> >>> base-commit: ddb4c3f25b7b95df3d6932db0b379d768a6ebdf7 >>> prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27 >> > > thanks, -- BR, Muhammad Usama Anjum