Support external toolchain on Windows for aot compiler (#3911)
allowing custom ARC toolchain on Windows
This commit is contained in:
@ -102,12 +102,27 @@ def build_llvm(llvm_dir, platform, backends, projects, use_clang=False, extra_fl
|
||||
"default": [],
|
||||
}
|
||||
|
||||
experimental_backends = ["ARC", "Xtensa"]
|
||||
normal_backends = [s for s in backends if s not in experimental_backends]
|
||||
|
||||
LLVM_TARGETS_TO_BUILD = [
|
||||
'-DLLVM_TARGETS_TO_BUILD:STRING="' + ";".join(backends) + '"'
|
||||
if backends
|
||||
'-DLLVM_TARGETS_TO_BUILD:STRING="' + ";".join(normal_backends) + '"'
|
||||
if normal_backends
|
||||
else '-DLLVM_TARGETS_TO_BUILD:STRING="AArch64;ARM;Mips;RISCV;X86"'
|
||||
]
|
||||
|
||||
# if not on ARC platform, but want to add expeirmental backend ARC as target
|
||||
if platform != "ARC" and "ARC" in backends:
|
||||
LLVM_TARGETS_TO_BUILD.extend(
|
||||
LLVM_EXTRA_COMPILE_OPTIONS["arc"]
|
||||
)
|
||||
|
||||
if platform != "Xtensa" and "Xtensa" in backends:
|
||||
print(
|
||||
"Currently it's not supported to build Xtensa backend on non-Xtensa platform"
|
||||
)
|
||||
return None
|
||||
|
||||
LLVM_PROJECTS_TO_BUILD = [
|
||||
'-DLLVM_ENABLE_PROJECTS:STRING="' + ";".join(projects) + '"' if projects else ""
|
||||
]
|
||||
@ -240,6 +255,7 @@ def main():
|
||||
"X86",
|
||||
"Xtensa",
|
||||
],
|
||||
default=[],
|
||||
help="identify LLVM supported backends, separate by space, like '--arch ARM Mips X86'",
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
Reference in New Issue
Block a user