summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains/BareMetal.cpp
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2017-09-28 21:57:43 +0000
committerTom Stellard <tstellar@redhat.com>2017-09-28 21:57:43 +0000
commitbe92019b237e5428f170aeba09b4bcaa1178a80f (patch)
treed0c57d6fe793b515a4f3af62983da25b32786ed4 /lib/Driver/ToolChains/BareMetal.cpp
parent77f008b3fc024a2b542f2fe95823234afd65e34c (diff)
Merging r312651:
------------------------------------------------------------------------ r312651 | jroelofs | 2017-09-06 10:09:25 -0700 (Wed, 06 Sep 2017) | 23 lines Fix ARM bare metal driver to support atomics The new bare metal support only supports the single thread model. This causes the builtin atomic functions (e.g.: __atomic_fetch_add) to not generate thread-safe assembly for these operations, which breaks our firmware. We target bare metal, and need to atomically modify variables in our interrupt routines, and task threads. Internally, the -mthread-model flag determines whether to lower or expand atomic operations (see D4984). This change removes the overridden thread model methods, and instead relies on the base ToolChain class to validate the thread model (which already includes logic to validate single thread model support). If the single thread model is required, the -mthread-model flag will have to be provided. As a workaround "-mthread-model posix" could be provided, but it only works due to a bug in the validation of the -mthread-model flag (separate patch coming to fix this). https://reviews.llvm.org/D37493 Patch by: Ian Tessier! ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@314464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/BareMetal.cpp')
-rw-r--r--lib/Driver/ToolChains/BareMetal.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/Driver/ToolChains/BareMetal.cpp b/lib/Driver/ToolChains/BareMetal.cpp
index 5dc6dfad92..28e4f5b0e5 100644
--- a/lib/Driver/ToolChains/BareMetal.cpp
+++ b/lib/Driver/ToolChains/BareMetal.cpp
@@ -65,14 +65,6 @@ Tool *BareMetal::buildLinker() const {
return new tools::baremetal::Linker(*this);
}
-std::string BareMetal::getThreadModel() const {
- return "single";
-}
-
-bool BareMetal::isThreadModelSupported(const StringRef Model) const {
- return Model == "single";
-}
-
std::string BareMetal::getRuntimesDir() const {
SmallString<128> Dir(getDriver().ResourceDir);
llvm::sys::path::append(Dir, "lib", "baremetal");