Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
48a90dd
Initial work
TartanLlama Jan 5, 2026
540d785
Get wasip3 into working state
TartanLlama Jan 9, 2026
8f222c9
Don't disable threads on WASIP3 if no atomics, and don't set the TLS …
TartanLlama Feb 17, 2026
e9775de
Merge branch 'main' into sy/wasip3
TartanLlama Feb 17, 2026
6d2b464
Factor out WASIP3 into options and features
TartanLlama Feb 17, 2026
0bf29ae
Merge branch 'sy/wasip3' of github.com:TartanLlama/llvm-project into …
TartanLlama Feb 17, 2026
4a18333
Tighten up features
TartanLlama Feb 17, 2026
927daeb
Make feature detection work properly
TartanLlama Feb 17, 2026
e632709
Fix TLS relocations for non WASIP3
TartanLlama Feb 17, 2026
f44bf29
Add stack pointer ABI test
TartanLlama Feb 17, 2026
18a1ee3
Add tests for component model threading feature
TartanLlama Feb 17, 2026
8980e38
Add wasm-features test
TartanLlama Feb 17, 2026
08a3a16
wasm-toolchain tests
TartanLlama Feb 17, 2026
9092b93
Formatting
TartanLlama Feb 17, 2026
81ffb2b
Formatting
TartanLlama Feb 17, 2026
a9e7310
Revert arch change
TartanLlama Feb 17, 2026
c369bb2
Formatting
TartanLlama Feb 17, 2026
d368838
Revert formatting change
TartanLlama Feb 17, 2026
61f03e5
Revert formatting change
TartanLlama Feb 17, 2026
c9665c1
Revert formatting changes
TartanLlama Feb 17, 2026
07e122d
Revert formatting changes
TartanLlama Feb 17, 2026
651c362
Revert formatting changes
TartanLlama Feb 17, 2026
0175bd5
Revert formatting changes
TartanLlama Feb 17, 2026
9a93078
Revert formatting changes
TartanLlama Feb 17, 2026
85fab66
Revert formatting changes
TartanLlama Feb 17, 2026
e577185
Revert formatting changes
TartanLlama Feb 17, 2026
446d56d
Revert formatting changes
TartanLlama Feb 17, 2026
3f10fe8
Remove linker flag
TartanLlama Feb 18, 2026
dbae3ef
Determine thread context ABI automatically
TartanLlama Feb 18, 2026
e0dcb2a
Merge branch 'main' into sy/wasip3
TartanLlama Feb 18, 2026
e8babc7
Fix comment
TartanLlama Feb 18, 2026
822ea98
Test updates
TartanLlama Feb 18, 2026
cb2fb8d
TLS fixes
TartanLlama Feb 18, 2026
6cf7c2a
TLS test
TartanLlama Feb 18, 2026
fa7eea8
Continue rather than break when determiting thread context ABI
TartanLlama Feb 18, 2026
cc1ea2f
Only consider the current object file's symbols for determining threa…
TartanLlama Feb 18, 2026
b9039eb
Typo
TartanLlama Feb 18, 2026
1b490cd
Formatting
TartanLlama Feb 18, 2026
b55ae63
TLS fixes
TartanLlama Feb 18, 2026
a1c563b
Tighten up Toolchain driver
TartanLlama Feb 18, 2026
69654ef
Fix clang test
TartanLlama Feb 18, 2026
b98b9ab
Add wasm-target-features test for preprocessor defines
TartanLlama Feb 18, 2026
7121ea5
Remove debug code
TartanLlama Feb 18, 2026
70b3b93
Complete asm printing/parsing changes
TartanLlama Feb 18, 2026
43f756f
Clean up target feature decision
TartanLlama Feb 20, 2026
4ffe623
Use llvm::Triple::WASIp3 rather than a string
TartanLlama Feb 20, 2026
36c39bf
More driver tests
TartanLlama Feb 20, 2026
d953510
Fix tests
TartanLlama Feb 20, 2026
0656bbf
Strip thread locals if no bulk memory
TartanLlama Feb 20, 2026
c5190ff
Thread pointer test
TartanLlama Feb 20, 2026
6e0c9c0
TLS local exec test
TartanLlama Feb 20, 2026
3386a11
Add stack abi test
TartanLlama Feb 20, 2026
5775592
Shared memory fixes
TartanLlama Feb 20, 2026
4d7a81e
Enable component model context in WASIP3 in LLVM
TartanLlama Feb 20, 2026
1001e65
Merge branch 'main' into sy/wasip3
TartanLlama Feb 20, 2026
7a44741
Tighten up linker changes
TartanLlama Feb 20, 2026
4c62c81
Fix LLVM tests
TartanLlama Feb 20, 2026
5bebe2a
Merge branch 'main' into sy/wasip3
TartanLlama Feb 20, 2026
e9fa9fc
Remove unused code
TartanLlama Feb 23, 2026
10ed134
Change asserts for symbol creation
TartanLlama Feb 23, 2026
2ee9845
Fix frame debug info
TartanLlama Feb 23, 2026
c6ddead
Merge branch 'main' into sy/wasip3
TartanLlama Feb 23, 2026
2bae426
Merge branch 'sy/wasip3' of github.com:TartanLlama/llvm-project into …
TartanLlama Feb 23, 2026
557bfac
Tighten up linker changes
TartanLlama Feb 23, 2026
61c25c8
Typo
TartanLlama Feb 23, 2026
0fe07f0
Improve TLS test
TartanLlama Feb 23, 2026
7a58fce
Fix TLS in shared objects
TartanLlama Feb 23, 2026
8047c76
Update comment
TartanLlama Feb 23, 2026
24cb457
Remove symbol file changes for now
TartanLlama Feb 23, 2026
ff172dc
Merge branch 'main' into sy/wasip3
TartanLlama Mar 3, 2026
d11664a
Clang format
TartanLlama Mar 3, 2026
f04b74a
Format
TartanLlama Mar 3, 2026
6bdff2c
Fix tests
TartanLlama Mar 3, 2026
a637ae1
fmt
TartanLlama Mar 3, 2026
0bf18a6
Add chain to TLS base
TartanLlama Mar 3, 2026
6c9c276
fmt
TartanLlama Mar 3, 2026
f019ea9
Change chain impl
TartanLlama Mar 3, 2026
de9424c
Correct chain
TartanLlama Mar 3, 2026
5954755
fmt
TartanLlama Mar 3, 2026
1f9e903
Simplify getTLSBase
TartanLlama Mar 3, 2026
f61837a
fmt
TartanLlama Mar 3, 2026
bde41fc
Add missing include
TartanLlama Mar 3, 2026
daf5b03
fmt
TartanLlama Mar 4, 2026
36ea1df
Merge branch 'main' into sy/wasip3
TartanLlama Mar 4, 2026
41f8893
Revert archive-export changes
TartanLlama Mar 4, 2026
0a8c6ec
Merge branch 'main' into sy/wasip3
TartanLlama Mar 4, 2026
90c342f
Revert archive-export changes
TartanLlama Mar 4, 2026
a42942c
Merge branch 'sy/wasip3' of github.com:TartanLlama/llvm-project into …
TartanLlama Mar 4, 2026
13d3870
Revert tailcail changes
TartanLlama Mar 4, 2026
f75cb64
Revert tail call change
TartanLlama Mar 4, 2026
e1992e8
Review comments
TartanLlama Mar 4, 2026
c3d46dc
Newlines
TartanLlama Mar 5, 2026
9ecceef
Newlines
TartanLlama Mar 5, 2026
9d296ec
Remove changes from other PR
TartanLlama Mar 5, 2026
95fc53a
Comments
TartanLlama Mar 5, 2026
ae859d0
split-file
TartanLlama Mar 5, 2026
abc859d
Don't disable feature for MVP cpu
TartanLlama Mar 5, 2026
3749d9e
Don't disable feature for MVP cpu
TartanLlama Mar 5, 2026
0028170
fmt
TartanLlama Mar 5, 2026
f9f40b7
Revert test changes
TartanLlama Mar 5, 2026
c8d5420
Merge branch 'main' into sy/wasip3
TartanLlama Mar 9, 2026
9908d72
Remove merge artifact
TartanLlama Mar 9, 2026
0e1a5a9
Move writer utils
TartanLlama Mar 9, 2026
e187d8e
Revert WriterUtils changes
TartanLlama Mar 9, 2026
a2e3a85
Merge branch 'main' into sy/wasip3
TartanLlama Mar 11, 2026
b7bc6a3
Merge branch 'main' into sy/wasip3
TartanLlama Mar 16, 2026
a79dc2f
Merge branch 'main' into sy/wasip3
TartanLlama Mar 20, 2026
09f0fe3
Merge branch 'main' into sy/wasip3
TartanLlama Mar 23, 2026
1ee14c4
Abstract out context.get/set builtins
TartanLlama Mar 23, 2026
af1eb70
fmt
TartanLlama Mar 23, 2026
c661e66
fmt
TartanLlama Mar 23, 2026
e00d35f
Merge branch 'main' into sy/wasip3
TartanLlama Mar 23, 2026
742ae7c
Add comment
TartanLlama Mar 24, 2026
9b688ca
Remove option
TartanLlama Mar 24, 2026
3570777
Refactor into two config options
TartanLlama Mar 24, 2026
45ff0f0
Merge branch 'main' into sy/wasip3
TartanLlama Mar 24, 2026
e841994
Refactor
TartanLlama Apr 1, 2026
da1949c
Merge branch 'sy/wasip3' of github.com:TartanLlama/llvm-project into …
TartanLlama Apr 1, 2026
8dfc97c
Cleanup
TartanLlama Apr 1, 2026
cdca5aa
fmt
TartanLlama Apr 1, 2026
7559ec5
Flag for libcall thread context
TartanLlama Apr 1, 2026
4135d3d
Test fixes
TartanLlama Apr 1, 2026
a1cacc9
fmt
TartanLlama Apr 1, 2026
a2367c8
Merge branch 'main' into sy/wasip3
TartanLlama Apr 2, 2026
dfbfcd9
Cleanup
TartanLlama Apr 2, 2026
5c04563
newline
TartanLlama Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions clang/lib/Driver/ToolChains/WebAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ using namespace llvm::opt;
std::string WebAssembly::getMultiarchTriple(const Driver &D,
const llvm::Triple &TargetTriple,
StringRef SysRoot) const {
return (TargetTriple.getArchName() + "-" +
TargetTriple.getOSAndEnvironmentName()).str();
return (TargetTriple.getArchName() + "-" +
TargetTriple.getOSAndEnvironmentName())
.str();
}

std::string wasm::Linker::getLinkerPath(const ArgList &Args) const {
const ToolChain &ToolChain = getToolChain();
if (const Arg* A = Args.getLastArg(options::OPT_fuse_ld_EQ)) {
if (const Arg *A = Args.getLastArg(options::OPT_fuse_ld_EQ)) {
StringRef UseLinker = A->getValue();
if (!UseLinker.empty()) {
if (llvm::sys::path::is_absolute(UseLinker) &&
Expand Down Expand Up @@ -79,6 +80,10 @@ static bool WantsPthread(const llvm::Triple &Triple, const ArgList &Args) {
return WantsPthread;
}

static bool WantsSharedMemory(const llvm::Triple &Triple, const ArgList &Args) {
return WantsPthread(Triple, Args) && !TargetBuildsComponents(Triple);
}

void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
Expand All @@ -90,10 +95,14 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
ArgStringList CmdArgs;

CmdArgs.push_back("-m");
std::string arch;
if (ToolChain.getTriple().isArch64Bit())
CmdArgs.push_back("wasm64");
arch = "wasm64";
else
CmdArgs.push_back("wasm32");
arch = "wasm32";
if (ToolChain.getTriple().getOSName() == "wasip3")
arch += "-wasip3";
CmdArgs.push_back(Args.MakeArgString(arch));

if (Args.hasArg(options::OPT_s))
CmdArgs.push_back("--strip-all");
Expand Down Expand Up @@ -160,7 +169,7 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,

AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);

if (WantsPthread(ToolChain.getTriple(), Args))
if (WantsSharedMemory(ToolChain.getTriple(), Args))
CmdArgs.push_back("--shared-memory");

if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
Expand Down Expand Up @@ -233,9 +242,9 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
/// Given a base library directory, append path components to form the
/// LTO directory.
static std::string AppendLTOLibDir(const std::string &Dir) {
// The version allows the path to be keyed to the specific version of
// LLVM in used, as the bitcode format is not stable.
return Dir + "/llvm-lto/" LLVM_VERSION_STRING;
// The version allows the path to be keyed to the specific version of
// LLVM in used, as the bitcode format is not stable.
return Dir + "/llvm-lto/" LLVM_VERSION_STRING;
}

WebAssembly::WebAssembly(const Driver &D, const llvm::Triple &Triple,
Expand Down Expand Up @@ -502,7 +511,8 @@ void WebAssembly::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
if (getTriple().getOS() != llvm::Triple::UnknownOS) {
const std::string MultiarchTriple =
getMultiarchTriple(D, getTriple(), D.SysRoot);
addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include/" + MultiarchTriple);
addSystemInclude(DriverArgs, CC1Args,
D.SysRoot + "/include/" + MultiarchTriple);
}
addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
}
Expand Down Expand Up @@ -631,5 +641,6 @@ void WebAssembly::addLibStdCXXIncludePaths(
// Second add the generic one.
addSystemInclude(DriverArgs, CC1Args, LibPath + "/c++/" + Version);
// Third the backward one.
addSystemInclude(DriverArgs, CC1Args, LibPath + "/c++/" + Version + "/backward");
addSystemInclude(DriverArgs, CC1Args,
LibPath + "/c++/" + Version + "/backward");
}
12 changes: 12 additions & 0 deletions lld/wasm/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Symbol;
class DefinedData;
class GlobalSymbol;
class DefinedFunction;
class UndefinedFunction;
class UndefinedGlobal;
class TableSymbol;

Expand All @@ -49,6 +50,8 @@ enum class BuildIdKind { None, Fast, Sha1, Hexstring, Uuid };
// and such fields have the same name as the corresponding options.
// Most fields are initialized by the driver.
struct Config {
bool isMultithreaded() const { return sharedMemory || isWasip3; }

bool allowMultipleDefinition;
bool bsymbolic;
bool checkFeatures;
Expand All @@ -70,6 +73,7 @@ struct Config {
bool importTable;
bool importUndefined;
std::optional<bool> is64;
bool isWasip3;
bool mergeDataSegments;
bool noinhibitExec;
bool pie;
Expand Down Expand Up @@ -248,6 +252,14 @@ struct Ctx {
// Used as an address space for function pointers, with each function that
// is used as a function pointer being allocated a slot.
TableSymbol *indirectFunctionTable;

// __wasm_component_model_builtin_context_set_1
// Function used to set TLS base in component model modules.
UndefinedFunction *contextSet1;

// __wasm_component_model_builtin_context_get_1
// Function used to get TLS base in component model modules.
UndefinedFunction *contextGet1;
};
WasmSym sym;

Expand Down
71 changes: 53 additions & 18 deletions lld/wasm/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,16 @@ static void readConfigs(opt::InputArgList &args) {
ctx.arg.exportDynamic =
args.hasFlag(OPT_export_dynamic, OPT_no_export_dynamic, ctx.arg.shared);

// Parse wasm32/64.
// Parse wasm32/64 and maybe -wasip3.
if (auto *arg = args.getLastArg(OPT_m)) {
StringRef s = arg->getValue();
if (s == "wasm32")
if (s.starts_with("wasm32"))
ctx.arg.is64 = false;
else if (s == "wasm64")
else if (s.starts_with("wasm64"))
ctx.arg.is64 = true;
else
error("invalid target architecture: " + s);
ctx.arg.isWasip3 = s.ends_with("-wasip3");
}

// --threads= takes a positive integer and provides the default value for
Expand Down Expand Up @@ -827,6 +828,10 @@ static void checkOptions(opt::InputArgList &args) {
if (ctx.arg.tableBase)
error("--table-base may not be used with -shared/-pie");
}

if (ctx.arg.sharedMemory && ctx.arg.isWasip3) {
error("--shared-memory is incompatible with the wasip3 target");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? Is there no way to experiment with shared memories and wasmip3? (like there is with wasip1?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've since changed this to an incompatibility between sharedMemory and componentModelThreadContext, but since the question is much the same: it could be supported, but I think there's more logic I would need to add to deal with the case of them both being enabled, and I'm trying to focus on what's needed to support the common co-op threading use case right now, so haven't addressed that in this PR.

}
}

static const char *getReproduceOption(opt::InputArgList &args) {
Expand Down Expand Up @@ -885,7 +890,7 @@ static void writeWhyExtract() {
// Equivalent of demote demoteSharedAndLazySymbols() in the ELF linker
static void demoteLazySymbols() {
for (Symbol *sym : symtab->symbols()) {
if (auto* s = dyn_cast<LazySymbol>(sym)) {
if (auto *s = dyn_cast<LazySymbol>(sym)) {
if (s->signature) {
LLVM_DEBUG(llvm::dbgs()
<< "demoting lazy func: " << s->getName() << "\n");
Expand All @@ -906,6 +911,18 @@ createUndefinedGlobal(StringRef name, llvm::wasm::WasmGlobalType *type) {
return sym;
}

static UndefinedFunction *
createUndefinedFunction(StringRef name, std::optional<StringRef> importName,
std::optional<StringRef> importModule,
WasmSignature *signature) {
auto *sym = cast<UndefinedFunction>(symtab->addUndefinedFunction(
name, importName, importModule, WASM_SYMBOL_UNDEFINED, nullptr, signature,
true));
ctx.arg.allowUndefinedSymbols.insert(sym->getName());
sym->isUsedInRegularObj = true;
return sym;
}

static InputGlobal *createGlobal(StringRef name, bool isMutable) {
llvm::wasm::WasmGlobal wasmGlobal;
bool is64 = ctx.arg.is64.value_or(false);
Expand Down Expand Up @@ -946,11 +963,13 @@ static void createSyntheticSymbols() {

bool is64 = ctx.arg.is64.value_or(false);

auto stack_pointer_name =
ctx.arg.isWasip3 ? "__init_stack_pointer" : "__stack_pointer";
if (ctx.isPic) {
ctx.sym.stackPointer =
createUndefinedGlobal("__stack_pointer", ctx.arg.is64.value_or(false)
? &mutableGlobalTypeI64
: &mutableGlobalTypeI32);
createUndefinedGlobal(stack_pointer_name, ctx.arg.is64.value_or(false)
? &mutableGlobalTypeI64
: &mutableGlobalTypeI32);
// For PIC code, we import two global variables (__memory_base and
// __table_base) from the environment and use these as the offset at
// which to load our static data and function table.
Expand All @@ -963,14 +982,15 @@ static void createSyntheticSymbols() {
ctx.sym.tableBase->markLive();
} else {
// For non-PIC code
ctx.sym.stackPointer = createGlobalVariable("__stack_pointer", true);
ctx.sym.stackPointer = createGlobalVariable(stack_pointer_name, true);
ctx.sym.stackPointer->markLive();
}

if (ctx.arg.sharedMemory) {
if (ctx.arg.isMultithreaded()) {
// TLS symbols are all hidden/dso-local
ctx.sym.tlsBase =
createGlobalVariable("__tls_base", true, WASM_SYMBOL_VISIBILITY_HIDDEN);
auto tls_base_name = ctx.arg.isWasip3 ? "__init_tls_base" : "__tls_base";
ctx.sym.tlsBase = createGlobalVariable(tls_base_name, true,
WASM_SYMBOL_VISIBILITY_HIDDEN);
ctx.sym.tlsSize = createGlobalVariable("__tls_size", false,
WASM_SYMBOL_VISIBILITY_HIDDEN);
ctx.sym.tlsAlign = createGlobalVariable("__tls_align", false,
Expand All @@ -979,6 +999,21 @@ static void createSyntheticSymbols() {
"__wasm_init_tls", WASM_SYMBOL_VISIBILITY_HIDDEN,
make<SyntheticFunction>(is64 ? i64ArgSignature : i32ArgSignature,
"__wasm_init_tls"));
if (ctx.arg.isWasip3) {
ctx.sym.tlsBase->markLive();
ctx.sym.tlsSize->markLive();
ctx.sym.tlsAlign->markLive();
static WasmSignature contextSet1Signature{{}, {ValType::I32}};
ctx.sym.contextSet1 = createUndefinedFunction(
"__wasm_component_model_builtin_context_set_1", "[context-set-1]",
"$root", &contextSet1Signature);
ctx.sym.contextSet1->markLive();
static WasmSignature contextGet1Signature{{ValType::I32}, {}};
ctx.sym.contextGet1 = createUndefinedFunction(
"__wasm_component_model_builtin_context_get_1", "[context-get-1]",
"$root", &contextGet1Signature);
ctx.sym.contextGet1->markLive();
}
}
}

Expand Down Expand Up @@ -1014,7 +1049,7 @@ static void createOptionalSymbols() {
//
// __tls_size and __tls_align are not needed in this case since they are only
// needed for __wasm_init_tls (which we do not create in this case).
if (!ctx.arg.sharedMemory)
if (!ctx.arg.sharedMemory && !ctx.arg.isWasip3)
ctx.sym.tlsBase = createOptionalGlobal("__tls_base", false);
}

Expand All @@ -1023,15 +1058,15 @@ static void processStubLibrariesPreLTO() {
for (auto &stub_file : ctx.stubFiles) {
LLVM_DEBUG(llvm::dbgs()
<< "processing stub file: " << stub_file->getName() << "\n");
for (auto [name, deps]: stub_file->symbolDependencies) {
auto* sym = symtab->find(name);
for (auto [name, deps] : stub_file->symbolDependencies) {
auto *sym = symtab->find(name);
// If the symbol is not present at all (yet), or if it is present but
// undefined, then mark the dependent symbols as used by a regular
// object so they will be preserved and exported by the LTO process.
if (!sym || sym->isUndefined()) {
for (const auto dep : deps) {
auto* needed = symtab->find(dep);
if (needed ) {
auto *needed = symtab->find(dep);
if (needed) {
needed->isUsedInRegularObj = true;
// Like with handleLibcall we have to extract any LTO archive
// members that might need to be exported due to stub library
Expand Down Expand Up @@ -1103,8 +1138,8 @@ static void processStubLibraries() {

// First look for any imported symbols that directly match
// the names of the stub imports
for (auto [name, deps]: stub_file->symbolDependencies) {
auto* sym = symtab->find(name);
for (auto [name, deps] : stub_file->symbolDependencies) {
auto *sym = symtab->find(name);
if (sym && sym->isUndefined()) {
depsAdded |= addStubSymbolDeps(stub_file, sym, deps);
} else {
Expand Down
4 changes: 2 additions & 2 deletions lld/wasm/Relocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static bool requiresGOTAccess(const Symbol *sym) {
return true;
}

static bool allowUndefined(const Symbol* sym) {
static bool allowUndefined(const Symbol *sym) {
// Symbols that are explicitly imported are always allowed to be undefined at
// link time.
if (sym->isImported())
Expand Down Expand Up @@ -125,7 +125,7 @@ void scanRelocations(InputChunk *chunk) {
// In single-threaded builds TLS is lowered away and TLS data can be
// merged with normal data and allowing TLS relocation in non-TLS
// segments.
if (ctx.arg.sharedMemory) {
if (ctx.arg.isMultithreaded()) {
if (!sym->isTLS()) {
error(toString(file) + ": relocation " +
relocTypeToString(reloc.Type) +
Expand Down
8 changes: 3 additions & 5 deletions lld/wasm/Symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ WasmSymbolType Symbol::getWasmType() const {
}

const WasmSignature *Symbol::getSignature() const {
if (auto* f = dyn_cast<FunctionSymbol>(this))
if (auto *f = dyn_cast<FunctionSymbol>(this))
return f->signature;
if (auto *t = dyn_cast<TagSymbol>(this))
return t->signature;
Expand Down Expand Up @@ -223,9 +223,7 @@ bool Symbol::isExportedExplicit() const {
return forceExport || flags & WASM_SYMBOL_EXPORTED;
}

bool Symbol::isNoStrip() const {
return flags & WASM_SYMBOL_NO_STRIP;
}
bool Symbol::isNoStrip() const { return flags & WASM_SYMBOL_NO_STRIP; }

uint32_t FunctionSymbol::getFunctionIndex() const {
if (const auto *u = dyn_cast<UndefinedFunction>(this))
Expand Down Expand Up @@ -413,7 +411,7 @@ void LazySymbol::setWeak() {
flags |= (flags & ~WASM_SYMBOL_BINDING_MASK) | WASM_SYMBOL_BINDING_WEAK;
}

void printTraceSymbolUndefined(StringRef name, const InputFile* file) {
void printTraceSymbolUndefined(StringRef name, const InputFile *file) {
message(toString(file) + ": reference to " + name);
}

Expand Down
Loading