Filter out GCC only `--param=min-pagesize=0` in `clangd` mode. This
fixes compilation of rust applications, that now fails with:
thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("error: argument unused during compilation: '--param=min-pagesize=0' [-Wunused-command-line-argument]\n")', /home/maribu/.cargo/git/checkouts/rust-riot-sys-d12733b89271907c/b4bd4bd/build.rs:224:10
GCC supports localized outputs, depending on the currently set locale.
This broke the compile-commands target, as the regexes only match the
English output. By invoking the compiler explicitly with the C locale,
it ensures the expected English language output.
detect_includes_and_version_gcc() previously only detected the includes,
but has been extended to also return the version. This is done by
returning a tuple, with the first item being the list of include paths,
and the second being the version. In the error handling the script still
returns only an empty list of includes, but not an empty version. This
fixes the issue.
... instead of manual filtering
Some -Wwarning-type flags were removed because in combination with
-Werror they caused clang to fail when the warning type was unknown.
Rather than enumerating them (a manual process with the extra risk of
leaving warnings disabled longer than necessary), this adds
`-Wno-unknown-arning-option` which disables the warnings (that are
becoming erors through -Werror) raised when a warning's name is unknown.
By running make compile-commands a `compile_commands.json` in the RIOT base
directory. With the environment variable `COMPILE_COMMANDS` the path of
this file can be changed to a custom location.
The `compile_commands.json` will contain the exact compile command, but
as additional flag `-I/usr/$(TARGET)/include` is added to work around
`clangd` not being able to locate the newlib system headers. The
additional includes can be overwritten using the environment variable
`COMPILE_COMMANDS_EXTRA_INCLUDES`.