summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2020-12-01 13:30:13 +0000
committervisa <visa@openbsd.org>2020-12-01 13:30:13 +0000
commite73ff4e669dda94395f3f3df1c98f51838c775d0 (patch)
tree5ba958fe3033c8bdea01c4ce5c58d53a4f318d43 /gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp
parentbzero the antireplay counter rwlock before rw_init'ing it, not after. (diff)
downloadwireguard-openbsd-e73ff4e669dda94395f3f3df1c98f51838c775d0.tar.xz
wireguard-openbsd-e73ff4e669dda94395f3f3df1c98f51838c775d0.zip
Implement Loongson 2F BTB bug workaround in clang
This adapts the -mfix-loongson2f-btb workaround from as(1) to LLVM/clang. Because LLVM emits machine code directly without using assembly as intermediary form, the workaround has to be applied in the compiler backend in addition to the integrated assembler. Discussed with miod@ OK mortimer@
Diffstat (limited to 'gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp')
-rw-r--r--gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp
index c8e4003875a..03f637113d1 100644
--- a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2366,6 +2366,11 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
CmdArgs.push_back("-soft-float");
continue;
}
+ if (Value.startswith("-mfix-loongson2f-btb")) {
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-fix-loongson2f-btb");
+ continue;
+ }
MipsTargetFeature = llvm::StringSwitch<const char *>(Value)
.Case("-mips1", "+mips1")