Skip to content

Commit

Permalink
linkers: include linker detection output in the debug logs
Browse files Browse the repository at this point in the history
We do something similar when running get_compiler() method checks from
the DSL. This ensures that if errors happen, the log file we tell people
to check actually works.
  • Loading branch information
eli-schwartz authored and nirbheek committed Aug 8, 2022
1 parent fa22cee commit df5596e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mesonbuild/linkers/detect.py
Expand Up @@ -14,6 +14,7 @@

from __future__ import annotations

from .. import mlog
from ..mesonlib import (
EnvironmentException, OptionKey,
Popen_safe, join_args, search_version
Expand Down Expand Up @@ -152,7 +153,13 @@ def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
override = comp_class.use_linker_args(value[0], comp_version)
check_args += override

_, o, e = Popen_safe(compiler + check_args)
mlog.debug('-----')
mlog.debug(f'Detecting linker via: {join_args(compiler + check_args)}')
p, o, e = Popen_safe(compiler + check_args)
mlog.debug(f'linker returned {p}')
mlog.debug(f'linker stdout:\n{o}')
mlog.debug(f'linker stderr:\n{e}')

v = search_version(o + e)
linker: DynamicLinker
if 'LLD' in o.split('\n')[0]:
Expand Down

0 comments on commit df5596e

Please sign in to comment.