Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp186894lqp; Thu, 4 Apr 2024 10:08:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJm1VfMHNfrg/2vBn3SfvW1LRnms+rquLNpahOwbm3ihaYvQjrWelztsmWWzBYnkOLEEOXci5Ip21/BUCZfwaoIYA2KyPKu+0Rqvyamg== X-Google-Smtp-Source: AGHT+IFhSOpXx2aqeZ/7nnSTcJYjd5j7+hTiPfF0yWl/WURYFoddlI/sEd5mFC88hCT4cOlwTExh X-Received: by 2002:a92:c244:0:b0:369:f8b7:f5bf with SMTP id k4-20020a92c244000000b00369f8b7f5bfmr3365189ilo.8.1712250493813; Thu, 04 Apr 2024 10:08:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712250493; cv=pass; d=google.com; s=arc-20160816; b=MPG0bBpjRZzjhjjvasWD5I7IIKhWhEA2MjJ5vBhkUSmxmBtEa4uIE+MZtl+WqqdTiz 6LVarZXpdoa9RAZKzBmwnhjbCAh4Ro6W18YanUILpdsvNCqvcy0UMnIx8H8FEPrFYIhN Oy07/2+QfCnQGTJEsitt3mHgRhpmPjM3Kj3doBCdCPnFXrvt/zrUbCMbnREs+Fvqqj+K rEL9LajHrFoDc8gvdN2ZXIf5wslV1o4t6cazHVdJh+V1RDfFjNDzB3jZDtzF6EgwIsRg g3ATd6vBvQLjnjjT15qm5Akkixf996qx/MvojZPvVU1UDnffbl0KnyKcydoohZc4ssVA 3OAg== 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:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=O1lHp+OkDVz4M/u4JQhfwxqw91sDKLwvBIfOpOSX1Dg=; fh=2cgtDoiIKmnWuYNOtmBMSgAZ4N7fKgNvQEXMRHPfgro=; b=U2fRjaekel5QgJ0FR2nlqfht4G6khVe6SdAhtdR1nqza8fQ9tAv4n28wT8hAHZU/fn mH4gq9/co9sf74ZrPWKalYvkfO3IJtqX1nKRruUJG44wpiaFF3qR3c4slloeUyXsQoSZ bbmmJzruk7hvUXSG12zCwRc6kjTeIKkYNDZ0mGkncB8q4nQSrPVQSzooqcuGg8H/wjr0 Okse2yJe271CRP+6xxfi7iRjdpnvOTAZe2EILWKm8FUuXCT67UmIuj5KQZx0eqQVuNly KV0PR7lxc6fSxMEb7WsR3eW80xjE5O6y4xr9hdfz0DQ0co/58mtNDvEuYmuqfRJj4Nao 1r7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=C+hc2xS8; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-131837-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d15-20020a63f24f000000b005dc785e4a28si15309127pgk.30.2024.04.04.10.08.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 10:08:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131837-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=C+hc2xS8; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-131837-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 71433B22486 for ; Thu, 4 Apr 2024 16:40:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A82DB12D20F; Thu, 4 Apr 2024 16:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C+hc2xS8" Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E96C112CDA8 for ; Thu, 4 Apr 2024 16:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712248697; cv=none; b=NDJ/xDLWlqj6sqjI9XvOJq2BmVHtY1UvayT8QJCI44pLplCMmXEhLc9u9rpxk6mLcAhN712mxZPDILSjd3Alh/WaITbh2DjtGw7ORhdSHyS3hWbK1V6pCASao/nZlhDTpI/T1nahrYcQnEI/i4UC5hTJ43N/ppssewVdRABYg9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712248697; c=relaxed/simple; bh=YBwK7BNdkJWP3oyNHpQfdPDIsnxbAs2+1nrrXIvCyGk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GL3Ssq8BPWemYJPkqa/mxOvr41gbLcG7VDD4tWyy2mtWV4gcwaq07tRkzfGcpIHVmy7zxc+cWiRGET+Jcn03BT9ORpdNOXWy4Tohsjo2Gh94cjfmkhoRu6QKw+pkO2cmegkK8dHYhF8dnwIBVIKYKfhPiOd7DuJUXSDfwMZf43w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C+hc2xS8; arc=none smtp.client-ip=209.85.166.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7cc0e831e11so22710639f.1 for ; Thu, 04 Apr 2024 09:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1712248695; x=1712853495; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=O1lHp+OkDVz4M/u4JQhfwxqw91sDKLwvBIfOpOSX1Dg=; b=C+hc2xS84zsaa95zf32WXlb9yNW/h3zvmnxmtWPaJT3nQcirZ0qsX81LVrCbdeElkp 57y0yq+G8ERUzzEhrTAPgWErlS1jN6tjByyIWfZb2oIsJLExlOMsr6qAf/4/FH0WE738 vGSo7+blJG3AWabJSM0Y6TAnCV2jtyRgNBPpQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712248695; x=1712853495; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O1lHp+OkDVz4M/u4JQhfwxqw91sDKLwvBIfOpOSX1Dg=; b=AlYLH7vsd16ACuNWbCbLlRojxeohP2dNl/LgPswXQlM9KUEqITKra8Y/tY3jyLNBps QFHNku7qPSxZtbfOu+iWCZD2SyIoHUxJ4rEVW2JP2TMnojsg6JGr6mhzH/EMwXZRn+pd t8fl/3O+H896GaI/0W5Q/NmV86o94Xl1PffG5Ucxpmucy0Nb5yOzAAU9iqTdks4Sxnd/ BAC2WTv3ZHlhanm2VZXcwjEG/2iF3FK6Sa0xQnH28tktReDaPbQhOOJMNhdWM1Ji5Uwv UrDAsoE2o+wjldxT86+DizFjGfvPrK8/QPdcCt1Ck73UaClAGiJ+rJ7JRkw4YBo+hIi6 8ZEg== X-Forwarded-Encrypted: i=1; AJvYcCU/atxXjuCI8Uq450Y5FapDh9/DATMQVjOmT7eLM/YNSimomA3Z/roenlrbC8esAkRSEkVXAz6yPsRzbdLM5ia11Ip6aK/N12VkO1fz X-Gm-Message-State: AOJu0YwiIBI2pH5twTdOu+wBtKPQBMNVBLffR9/FZEjyi/n9axFcxQr/ nUbTfiF7jQ8+ztaKc11auZDDfB95BcBcoCbP/ZXYvwwAzJjSlDG6UNSfQj1GEsI= X-Received: by 2002:a5e:8b45:0:b0:7d0:c0e7:b577 with SMTP id z5-20020a5e8b45000000b007d0c0e7b577mr3031325iom.2.1712248695143; Thu, 04 Apr 2024 09:38:15 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id r22-20020a056638131600b0047ed8c3e578sm4146726jad.134.2024.04.04.09.38.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 09:38:14 -0700 (PDT) Message-ID: Date: Thu, 4 Apr 2024 10:38:14 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Bug Report] selftests: Clang: kselftests build errors in KernelCI To: Nick Desaulniers , Muhammad Usama Anjum Cc: Gustavo Padovan , llvm@lists.linux.dev, kernelci@lists.linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Mark Brown , Justin Stitt , Nathan Chancellor , Kees Cook , Bill Wendling , Shuah Khan References: <0c6d4f0d-2064-4444-986b-1d1ed782135f@collabora.com> Content-Language: en-US From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/4/24 10:34, Nick Desaulniers wrote: > Thanks for the report. We've been tracking getting this working for a > while: https://github.com/ClangBuiltLinux/linux/issues/1698. Other > fires have continued to take priority. > > On Thu, Apr 4, 2024 at 9:30 AM Muhammad Usama Anjum > wrote: >> >> Hi, >> >> We have caught bugs in kselftest suites on linux-next and on stable-RCs etc >> when using clang. There are two types of bugs (logs with clang-17 are >> attached.): >> As usually people use GCC, there are GCC-specific flags added to the >> Makefiles that clang doesn't recognize. For example: >> * clang: error: argument unused during compilation: '-pie' >> [-Werror,-Wunused-command-line-argument] >> * clang: error: unknown argument '-static-libasan'; did you mean >> '-static-libsan'? >> * clang: error: cannot specify -o when generating multiple output files >> >> Clang has best static analysis tools. It is reporting static errors. For >> example: >> * test_execve.c:121:13: warning: variable 'have_outer_privilege' is used >> uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] >> * test_execve.c:121:9: note: remove the 'if' if its condition is always true >> * test_memcontrol.c:727:6: warning: variable 'fd' is used uninitialized >> whenever 'if' condition is true [-Wsometimes-uninitialized] >> >> We have found these issues through our new KernelCI system when enabling >> kselftest and clang there. The new system dashboard is a WIP, so It is not >> the web dashboard you are used-to with in KernelCI. We can show you ways of >> pulling the data if you are interest into. >> >> Unless the above is some sort of false-positive or misconfiguration, it >> would be great to support clang for kselftests. What we can do from our >> side is that clang kselftests builds should be enabled on KernelCI to find >> and fix the errors. What is your stance about this? > > As with anything kernel related; help send patches for obvious fixes. > Or provide steps to reproduce in > https://github.com/ClangBuiltLinux/linux/issues/1698. > +1 on this. Please send patches to fixes as you find them. We have been taking fixes found by clang and -Wformat-security, -Werror checks. thanks, -- Shuah