7 return getRoot(config
.parent
)
10 def is_gold_linker_available():
12 if not config
.gold_executable
:
15 ld_cmd
= subprocess
.Popen(
16 [config
.gold_executable
, "--help"], stdout
=subprocess
.PIPE
18 ld_out
= ld_cmd
.stdout
.read().decode()
23 if not "-plugin" in ld_out
:
26 # config.clang is not guaranteed to be just the executable!
27 clang_cmd
= subprocess
.Popen(
28 " ".join([config
.clang
, "-fuse-ld=gold", "-xc", "-"]),
30 universal_newlines
=True,
31 stdin
=subprocess
.PIPE
,
32 stdout
=subprocess
.PIPE
,
33 stderr
=subprocess
.PIPE
,
35 clang_err
= clang_cmd
.communicate("int main() { return 0; }")[1]
37 if not "invalid linker" in clang_err
:
43 root
= getRoot(config
)
45 if root
.host_os
not in ["Linux"] or not is_gold_linker_available():
46 config
.unsupported
= True
49 config
.available_features
.add("curl")