mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +03:00
AVR: Add predefined version AVR and emit TLS globals as regular ones (#3420)
The AVR target on LLVM and AVR-GCC does not have support for TLS, so it is necessary to emit global variables as NotThreadLocal.
This commit is contained in:
parent
920fe2cff7
commit
c40bbbc320
3 changed files with 21 additions and 3 deletions
|
@ -1755,10 +1755,11 @@ llvm::GlobalVariable *declareGlobal(const Loc &loc, llvm::Module &module,
|
|||
llvm::Type *type,
|
||||
llvm::StringRef mangledName,
|
||||
bool isConstant, bool isThreadLocal) {
|
||||
// No TLS support for WebAssembly; spare users from having to add __gshared
|
||||
// everywhere.
|
||||
// No TLS support for WebAssembly and AVR; spare users from having to add
|
||||
// __gshared everywhere.
|
||||
const auto arch = global.params.targetTriple->getArch();
|
||||
if (arch == llvm::Triple::wasm32 || arch == llvm::Triple::wasm64)
|
||||
if (arch == llvm::Triple::wasm32 || arch == llvm::Triple::wasm64 ||
|
||||
arch == llvm::Triple::avr)
|
||||
isThreadLocal = false;
|
||||
|
||||
llvm::GlobalVariable *existing =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue