Skip to content

Commit

Permalink
[MinGW] Add an --appcontainer flag, passed through to lld-link
Browse files Browse the repository at this point in the history
GNU ld doesn't have such a flag though, so this is a lld specific
option.

Differential Revision: https://reviews.llvm.org/D60860

llvm-svn: 358759
  • Loading branch information
mstorsjo committed Apr 19, 2019
1 parent 5505ad3 commit 2c1f3ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lld/MinGW/Driver.cpp
Expand Up @@ -184,6 +184,8 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
Add("-largeaddressaware");
if (Args.hasArg(OPT_kill_at))
Add("-kill-at");
if (Args.hasArg(OPT_appcontainer))
Add("-appcontainer");

if (Args.getLastArgValue(OPT_m) != "thumb2pe" &&
Args.getLastArgValue(OPT_m) != "arm64pe" && !Args.hasArg(OPT_dynamicbase))
Expand Down
1 change: 1 addition & 0 deletions lld/MinGW/Options.td
Expand Up @@ -55,6 +55,7 @@ def require_defined_eq: J<"require-defined=">, Alias<require_defined>;
// LLD specific options
def _HASH_HASH_HASH : Flag<["-"], "###">,
HelpText<"Print (but do not run) the commands to run for this compilation">;
def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">;
def mllvm: S<"mllvm">;
def pdb: S<"pdb">, HelpText<"Specify output PDB debug information file">;
def Xlink : J<"Xlink=">, MetaVarName<"<arg>">,
Expand Down
4 changes: 4 additions & 0 deletions lld/test/MinGW/driver.test
Expand Up @@ -160,3 +160,7 @@ RUN: ld.lld -### -m i386pep foo.o --insert-timestamp --no-insert-timestamp | Fil
NOTIMESTAMP: -timestamp:0
RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp --insert-timestamp | FileCheck -check-prefix TIMESTAMP %s
TIMESTAMP-NOT: -timestamp:0

RUN: ld.lld -### -m i386pep foo.o -appcontainer | FileCheck -check-prefix APPCONTAINER %s
RUN: ld.lld -### -m i386pep foo.o --appcontainer | FileCheck -check-prefix APPCONTAINER %s
APPCONTAINER: -appcontainer

0 comments on commit 2c1f3ea

Please sign in to comment.