diff options
author | Yifan Hong <elsk@google.com> | 2024-02-08 16:45:21 -0800 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2024-02-15 14:26:36 -0800 |
commit | 5234538c6e60af59d061879e289c74bf5453815a (patch) | |
tree | f538f15f68462e952468a5c1d49115c7bc112cc3 /kleaf/common.bzl | |
parent | 321e2de05fcdce6f0a00bb9d320487ccb2b94ff2 (diff) | |
download | linux-x86-5234538c6e60af59d061879e289c74bf5453815a.tar.gz |
kleaf: Disable --rtlib=compiler-rt for host linker for cc_* rules
This resolves the error about libgcc_s not being found.
-fuse-ld=lld is kept.
This does not affect Kbuild. Kbuild continues to
use --rtlib=compiler-rt without -B / -L flags.
Test: TH
Bug: 324206397
Change-Id: I194764ef6f4820ac912426917a0dadd81de16042
Merged-In: I194764ef6f4820ac912426917a0dadd81de16042
Diffstat (limited to 'kleaf/common.bzl')
-rw-r--r-- | kleaf/common.bzl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/kleaf/common.bzl b/kleaf/common.bzl index a554bb6a6..9a570f799 100644 --- a/kleaf/common.bzl +++ b/kleaf/common.bzl @@ -127,8 +127,25 @@ def _common_cflags(): ], ) +def _lld(): + return feature( + name = "kleaf-lld", + enabled = False, # Not enabled unless implied by individual os + flag_sets = [ + flag_set( + actions = ALL_CC_LINK_ACTION_NAMES, + flag_groups = [ + flag_group( + flags = [ + "-fuse-ld=lld", + ], + ), + ], + ), + ], + ) + def _lld_compiler_rt(): - # From _setup_env.sh return feature( name = "kleaf-lld-compiler-rt", enabled = False, # Not enabled unless implied by individual os @@ -138,19 +155,22 @@ def _lld_compiler_rt(): flag_groups = [ flag_group( flags = [ - "-fuse-ld=lld", "--rtlib=compiler-rt", ], ), ], ), ], + implies = [ + "kleaf-lld", + ], ) def _common_features(_ctx): """Features that applies to both android and linux toolchain.""" return [ _common_cflags(), + _lld(), _lld_compiler_rt(), ] |