Skip to content

Commit 149e3f3

Browse files
committed
Fix darwin build.
To fix darwin build, only use lld on linux. Bug: 171348143 Test: run build.py. Change-Id: Ica5a2ef86907406b2c0fe57ad7ddac81eb8fa705
1 parent bb66a3c commit 149e3f3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

config_toml.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,20 @@ def host_config(target):
6363
else:
6464
sysroot_flags = ""
6565

66+
ld_option = '-fuse-ld=lld' if build_platform.system() == 'linux' else ''
67+
6668
with open(wrapper_name, 'w') as f:
6769
f.write("""\
6870
#!/bin/sh
69-
{real_cc} $* -fuse-ld=lld --target={target} {sysroot_flags}
70-
""".format(real_cc=cc, target=target, sysroot_flags=sysroot_flags))
71+
{real_cc} $* {ld_option} --target={target} {sysroot_flags}
72+
""".format(real_cc=cc, ld_option=ld_option, target=target, sysroot_flags=sysroot_flags))
7173

7274
with open(cxx_wrapper_name, 'w') as f:
7375
f.write("""\
7476
#!/bin/sh
75-
{real_cxx} -I{cxxstd} $* -fuse-ld=lld --target={target} {sysroot_flags} {cxx_linker_flags} \
77+
{real_cxx} -I{cxxstd} $* {ld_option} --target={target} {sysroot_flags} {cxx_linker_flags} \
7678
-stdlib=libc++
77-
""".format(real_cxx=cxx, target=target, sysroot_flags=sysroot_flags,
79+
""".format(real_cxx=cxx, ld_option=ld_option, target=target, sysroot_flags=sysroot_flags,
7880
cxxstd=cxxstd,
7981
cxx_linker_flags=cxx_linker_flags))
8082

0 commit comments

Comments
 (0)