[PATCH] D92528: [lld][WebAssembly] Set memory limits correctly for PIC + shared memory

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 17:24:27 PST 2020


sbc100 created this revision.
Herald added subscribers: llvm-commits, wingo, ecnelises, jfb, sunfish, jgravelle-google, dschuff.
Herald added a project: LLVM.
sbc100 requested review of this revision.
Herald added a subscriber: aheejin.

Don't early return from layoutMemory in PIC mode before we have set the
memory limits.

This matters in particular with shared-memory + PIC because shared
memories require maximum size.

Secondly, when we need a maximum, but the user does not supply one,
default to MAX_INT rather than 0 (defaulting to zero is completely
useless and means that building with -shared didn't previously work at
all without --maximum-memory, because zero is never big enough).

This is part of an ongoing effort to enable dynamic linking with
threads in emscripten.

See https://github.com/emscripten-core/emscripten/issues/3494


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92528

Files:
  lld/test/wasm/shared-memory.yaml
  lld/test/wasm/shared.ll
  lld/wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92528.309113.patch
Type: text/x-patch
Size: 4199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201203/6d4cfffe/attachment.bin>


More information about the llvm-commits mailing list