From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C+hc2xS8" 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-Google-Smtp-Source: AGHT+IEA8Ot5VjOmH74kiKn6+rvyxZEZ0N/0e2VKSGgMgVavV4DwpFIgcNyVzFCXgCqx/llLPTQifw== 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