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]
Message-ID: <20250526085943.GQ39944@noisy.programming.kicks-ass.net>
Date: Mon, 26 May 2025 10:59:43 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: mingo@...hat.com, juri.lelli@...hat.com, vincent.guittot@...aro.org,
	dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
	mgorman@...e.de, vschneid@...hat.com, rafael@...nel.org,
	viresh.kumar@...aro.org, mathieu.desnoyers@...icios.com,
	paulmck@...nel.org, hannes@...xchg.org, surenb@...gle.com
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org, tj@...nel.org,
	masahiroy@...nel.org
Subject: Re: [PATCH] sched: Make clangd usable

On Fri, May 23, 2025 at 06:43:48PM +0200, Peter Zijlstra wrote:

> Setting up clangd on the kernel source is a giant pain in the arse
> (this really should be improved), but once you do manage, you run into
> dumb stuff like the above.

Given Steve asked for an emacs lsp plugin, I'm guessing he's going to be
wanting this part too.

The way I got clangd working is something like:


$ mkdir clangd-build
$ make O=clangd-build allmodconfig
$ make O=clangd-build LLVM=-19 -j128
$ cd clangd-build
$ ../scripts/clang-tools/gen_compile_commands.py
$ sed -i "s'randomize-layout-seed-file=\.'randomize-layout-seed-file=$PWD'g" compile_commands.json
$ cd -
$ ln -s clang-build/compile_commands.json 

I then also have:

$ cat .clangd
# https://clangd.llvm.org/config
CompileFlags:
  Add: -ferror-limit=0
Diagnostics:
  ClangTidy:
    Remove: bugprone-sizeof-expression
  UnusedIncludes: None
Completion:
  HeaderInsertion: Never
$


This has you sit on about 10G of build output, and while it is very
tempting to do make clean on clangd-build, this will in fact ruin
things. You can however manually delete all the compiler output, just
not the various generated files.

I've not been annoyed enough to (or out of diskspace enough) to go stare
at fixing the Makefiles to make all this easier. But ideally it would be
possible to do a no-op build to just generate the .cmd files without
doing any actual compiling -- building allmodconfig is slow, doubly so
with allmodconfig.

Or maybe this is already possible and I just didn't find the magic
incantations.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ