[lld] [lld][WebAssembly] Work around limited architecture detection for wasm64 shared libraries (PR #98961)
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 07:57:22 PDT 2024
================
@@ -408,6 +408,12 @@ ObjFile::ObjFile(MemoryBufferRef m, StringRef archiveName, bool lazy)
this->lazy = lazy;
this->archiveName = std::string(archiveName);
+ // Currently we only do this check for regular object file, and not for shared
+ // object files. This is because architecture detection for shared objects is
+ // currently based on a heuristic, which is fallable:
+ // https://github.com/llvm/llvm-project/issues/98778
+ checkArch(wasmObj->getArch());
----------------
sbc100 wrote:
Yes, non-shared objects, produced by llvm always import the memory. We just get lucky that is the case.
In fact even shared object do, just not once they have been though wasm-opt, which will eliminate the memory completely if its unused.
https://github.com/llvm/llvm-project/pull/98961
More information about the llvm-commits
mailing list