| host_triple = config.target_triple |
| |
| # Force triple on non-linux hosts to get ELF binaries on all platforms. |
| if not "linux" in host_triple: |
| host_triple = host_triple.split("-")[0] + "-unknown-linux-gnu" |
| |
| common_linker_flags = "-fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -Wl,--build-id=none -pie" |
| flags = f"--target={host_triple} -fPIE {common_linker_flags}" |
| |
| # Our files use x86 AT&T assembly throughout. |
| # Enable it explicitly so any local Clang preference for Intel syntax gets overriden. |
| if "x86-registered-target" in config.available_features: |
| flags += " -mllvm -x86-asm-syntax=att" |
| |
| config.substitutions.insert(0, ("%cflags", f"%cflags {flags}")) |
| config.substitutions.insert(0, ("%cxxflags", f"%cxxflags {flags}")) |