meson/mesonbuild
Patrick Steinhardt 42a8cfc32b compilers/cuda: fix checking for multiple linker args
When checking for multiple linker args we convert the supplied args to
flags that the compiler understands. But besides these supplied args, we
also try to convert linker flags that convert warnings into errors. This
mechanism causes an error though because we don't know to convert these
flags to linker flags:

    gcc: error: unrecognized command-line option '--warning-as-error'; did you mean '--warn-no-error'?
    -----------

    ERROR: Linker nvcc does not support sanitizer arguments ['-Xcompiler=-fsanitize=address\\,undefined']

As you can see, the flag is passed to the underlying compiler, not to
the underlying linker.

The obvious fix would be to convert them to linker flags, which we can
do by using `-Xlinker=` instead of `-Xcompiler=`. But that is incorrect,
too:

    /nix/store/j7p46r8v9gcpbxx89pbqlh61zhd33gzv-binutils-2.43.1/bin/ld: unrecognized option '--warning-as-error'
    /nix/store/j7p46r8v9gcpbxx89pbqlh61zhd33gzv-binutils-2.43.1/bin/ld: use the --help option for usage information
    collect2: error: ld returned 1 exit status
    -----------

    ERROR: Linker nvcc does not support sanitizer arguments ['-Xcompiler=-fsanitize=address\\,undefined']

Now we ended up passing the flag to the underlying linker, but the
`--warning-as-error` flag isn't known by it. What we really ought to do
is to pass on the flag to nvlink, which is the linker driver that
controls the underlying linker.

Do so by using `-Xnvlink=`, which fixes the bug.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-03-09 18:06:14 -04:00
..
ast Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
backend Optimize canonicalize_filename 2025-03-09 15:29:42 -04:00
cargo rust: add warning_level=0 to downloaded Cargo subprojects 2025-01-08 12:07:31 +02:00
cmake Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
compilers compilers/cuda: fix checking for multiple linker args 2025-03-09 18:06:14 -04:00
dependencies dependencies/dub: First try to describe local project 2025-03-05 02:34:07 -05:00
interpreter interpreter: do not use pathlib in validate_within_subproject 2025-03-09 13:05:08 -04:00
interpreterbase Revert "interpreterbase: Add disabler exception for `get_variable` method" 2025-01-21 15:08:01 +02:00
linkers Make all Meson level options overridable per subproject. 2025-02-13 23:57:48 +02:00
modules modules/gnome: Allow to specify the doc-format argument 2025-03-01 13:37:09 +02:00
scripts mesonlib: extract and optimize is_parent_path 2025-03-09 13:05:08 -04:00
templates templates: use library() instead of shared_library() 2025-01-08 10:05:02 -08:00
utils mesonlib: extract and optimize is_parent_path 2025-03-09 13:05:08 -04:00
wrap Fix wrap.py to avoid following symlinks 2025-01-06 21:58:11 +02:00
__init__.py
_pathlib.py Use SPDX-License-Identifier consistently 2023-12-13 15:19:21 -05:00
_typing.py compilers: Add support for OpenMP from homebrew with AppleClang 2024-06-26 16:15:47 -04:00
arglist.py arglist: post is only appended to, make it a list 2025-03-01 16:40:58 +02:00
build.py mesonlib: extract and optimize is_parent_path 2025-03-09 13:05:08 -04:00
coredata.py Add cache to coredata.get_external_link_args 2025-03-09 15:29:42 -04:00
depfile.py Use SPDX-License-Identifier consistently 2023-12-13 15:19:21 -05:00
envconfig.py environment: make fully type safe 2025-03-01 13:30:06 +02:00
environment.py environment: fix nullability of function parameter 2025-03-06 23:02:04 -05:00
machinefile.py machinefile: ensure that arrays are single deep arrays for strings 2025-03-01 13:30:06 +02:00
mcompile.py Move OptionKey in the option source file. 2024-07-11 11:53:39 +03:00
mconf.py coredata: delete a bunch of unused methods 2025-03-04 13:37:57 -05:00
mdevenv.py mdevenv: exec directly into the program to run 2024-11-17 00:29:09 -05:00
mdist.py mdist: correctly detect dirty hg repos with non-English locale, redux 2024-09-20 00:49:00 -04:00
mesondata.py Use SPDX-License-Identifier consistently 2023-12-13 15:19:21 -05:00
mesonlib.py Use SPDX-License-Identifier consistently 2023-12-13 15:19:21 -05:00
mesonmain.py options: split UserOption -> Argparse conversion out of BuiltinOption 2025-03-05 18:06:11 +02:00
mformat.py mformat: try to detect meson.format in source files' parent directories 2025-01-31 08:53:35 -08:00
minit.py Move OptionKey in the option source file. 2024-07-11 11:53:39 +03:00
minstall.py minstall: help mypy out with our chown overriding 2025-02-03 21:49:53 -08:00
mintro.py coredata: delete the OptionsView 2025-02-27 23:33:39 +02:00
mlog.py mlog: Log once should not take location into account 2024-10-11 17:16:30 -04:00
mparser.py Fix typos in comments 2025-03-08 08:09:58 -08:00
msetup.py msetup: remove bad warning about unused options 2025-03-04 12:26:18 -05:00
msubprojects.py Check for uppercase 'head' when updating subprojects 2024-11-06 18:03:26 +02:00
mtest.py test: fix hang when running tests that need parsing with `--interactive` 2025-02-27 15:25:57 -05:00
munstable_coredata.py Move OptionKey in the option source file. 2024-07-11 11:53:39 +03:00
optinterpreter.py options: allow readonly to be set in the initializer 2025-03-05 18:06:11 +02:00
options.py options: delete unused set_subproject_options 2025-03-06 23:02:18 -05:00
programs.py programs: fix regex to match multi-digit major version 2025-01-08 13:45:40 -05:00
rewriter.py rewriter: don't output target info to stderr 2024-09-20 19:57:40 -07:00