Skip to content

Commit

Permalink
linkers: basic support for the 'zig cc' linker
Browse files Browse the repository at this point in the history
  • Loading branch information
Akaricchi committed Sep 27, 2023
1 parent a843a99 commit 4d74d9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mesonbuild/linkers/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
linker = linkers.AIXDynamicLinker(
compiler, for_machine, comp_class.LINKER_PREFIX, override,
version=search_version(e))
elif o.startswith('zig ld'):
linker = linkers.ZigDynamicLinker(
compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
else:
__failed_to_detect_linker(compiler, check_args, o, e)
return linker
7 changes: 7 additions & 0 deletions mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,13 @@ def get_win_subsystem_args(self, value: str) -> T.List[str]:
raise mesonlib.MesonBugException(f'win_subsystem: {value} not handled in lld linker. This should not be possible.')


class ZigDynamicLinker(LLVMDynamicLinker):
id = 'zig'

def get_thinlto_cache_args(self, path: str) -> T.List[str]:
return []


class WASMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker):

"""Emscripten's wasm-ld."""
Expand Down

0 comments on commit 4d74d9b

Please sign in to comment.