[PATCH] D118405: [LLD][MinGW] Add --heap argument support

Mateusz MikuĊ‚a via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 13:22:41 PST 2022


mati865 created this revision.
mati865 added a reviewer: mstorsjo.
mati865 added a project: lld.
Herald added a subscriber: dang.
mati865 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Noticed in https://github.com/msys2/MINGW-packages/pull/10567

Untested but should work fine judging by COFF driver code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118405

Files:
  lld/MinGW/Driver.cpp
  lld/MinGW/Options.td
  lld/test/MinGW/driver.test


Index: lld/test/MinGW/driver.test
===================================================================
--- lld/test/MinGW/driver.test
+++ lld/test/MinGW/driver.test
@@ -340,3 +340,8 @@
 
 RUN: ld.lld -### -m i386pep foo.o --disable-stdcall-fixup --enable-stdcall-fixup 2>&1 | FileCheck -check-prefix ENABLE-FIXUP %s
 ENABLE-FIXUP: -stdcall-fixup{{ }}
+
+RUN: ld.lld -### foo.o -m i386pep -heap 8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
+RUN: ld.lld -### foo.o -m i386pep --heap 8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
+RUN: ld.lld -### foo.o -m i386pep --heap=8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
+HEAP: -heap:8388608,16384
Index: lld/MinGW/Options.td
===================================================================
--- lld/MinGW/Options.td
+++ lld/MinGW/Options.td
@@ -66,6 +66,7 @@
 defm gc_sections: B<"gc-sections",
     "Remove unused sections",
     "Don't remove unused sections">;
+defm heap: Eq<"heap", "Set size of the initial heap">;
 def help: F<"help">, HelpText<"Print option help">;
 defm high_entropy_va: B_disable<"high-entropy-va",
     "Set the 'high entropy VA' flag", "Don't set the 'high entropy VA' flag">;
Index: lld/MinGW/Driver.cpp
===================================================================
--- lld/MinGW/Driver.cpp
+++ lld/MinGW/Driver.cpp
@@ -264,6 +264,8 @@
     add("-filealign:" + StringRef(a->getValue()));
   if (auto *a = args.getLastArg(OPT_section_alignment))
     add("-align:" + StringRef(a->getValue()));
+  if (auto *a = args.getLastArg(OPT_heap))
+    add("-heap:" + StringRef(a->getValue()));
 
   if (auto *a = args.getLastArg(OPT_o))
     add("-out:" + StringRef(a->getValue()));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118405.403774.patch
Type: text/x-patch
Size: 1676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/4c7b1be2/attachment.bin>


More information about the llvm-commits mailing list