lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 3 Jun 2024 13:11:47 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Mark Brown <broonie@...nel.org>
CC: Shuah Khan <shuah@...nel.org>, Muhammad Usama Anjum
	<usama.anjum@...labora.com>, Beau Belgrave <beaub@...ux.microsoft.com>,
	Steven Rostedt <rostedt@...dmis.org>, Naresh Kamboju
	<naresh.kamboju@...aro.org>, Nick Desaulniers <ndesaulniers@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>, Bill Wendling <morbo@...gle.com>,
	sunliming <sunliming@...inos.cn>, Masami Hiramatsu <mhiramat@...nel.org>,
	Valentin Obst <kernel@...entinobst.de>, <linux-kselftest@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>, "Nathan
 Chancellor" <nathan@...nel.org>, Ryan Roberts <ryan.roberts@....com>
Subject: Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang
 builds

On 6/3/24 10:09 AM, John Hubbard wrote:
> On 6/3/24 8:32 AM, Mark Brown wrote:
>> On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote:
>>> The kselftests may be built in a couple different ways:
>>>      make LLVM=1
>>>      make CC=clang
>>>
>>> In order to handle both cases, set LLVM=1 if CC=clang. That way,the rest
>>> of lib.mk, and any Makefiles that include lib.mk, can base decisions
>>> solely on whether or not LLVM is set.
>>
>> ICBW but I believe there are still some architectures with clang but not
>> lld support where there's a use case for using CC=clang.
> 
> I'm inclined to wait for those to make themselves known... :)
> 

...but thinking about this some more, maybe this patch is actually
a Bad Idea. Because it is encouraging weirdness and divergence from
how kbuild does it. And kbuild is very clear [1]:


Building with LLVM

Invoke make via:

make LLVM=1

to compile for the host target. For cross compiling:

make LLVM=1 ARCH=arm64

The LLVM= argument

LLVM has substitutes for GNU binutils utilities. They can be enabled individually. The full list of supported make variables:

make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \
   OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \
   HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld

LLVM=1 expands to the above.

[1] https://docs.kernel.org/kbuild/llvm.html

thanks,
-- 
John Hubbard
NVIDIA


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ