Module: wine Branch: master Commit: 9180dec0b7490457c902e4b9650a68ab36d8ce96 URL: https://source.winehq.org/git/wine.git/?a=commit;h=9180dec0b7490457c902e4b96...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Nov 11 19:56:49 2019 +0100
winegcc: Add support for -Wl,-delayload argument.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tools/winegcc/winegcc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index fa4407f913..140ca07822 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -226,6 +226,7 @@ struct options strarray* compiler_args; strarray* winebuild_args; strarray* files; + strarray* delayimports; };
#ifdef __i386__ @@ -1164,6 +1165,12 @@ static void build(struct options* opts) for ( j = 0 ; j < opts->winebuild_args->size ; j++ ) strarray_add(spec_args, opts->winebuild_args->base[j]);
+ if (!is_pe) + { + for (j = 0; j < opts->delayimports->size; j++) + strarray_add(spec_args, strmake("-d%s", opts->delayimports->base[j])); + } + /* add resource files */ for ( j = 0; j < files->size; j++ ) if (files->base[j][1] == 'r') strarray_add(spec_args, files->base[j]); @@ -1203,6 +1210,12 @@ static void build(struct options* opts)
strarray_add(link_args, spec_o_name);
+ if (is_pe) + { + for (j = 0; j < opts->delayimports->size; j++) + strarray_add(spec_args, strmake("-Wl,-delayload,%s", opts->delayimports->base[j])); + } + for ( j = 0; j < files->size; j++ ) { const char* name = files->base[j] + 2; @@ -1423,6 +1436,7 @@ int main(int argc, char **argv) opts.linker_args = strarray_alloc(); opts.compiler_args = strarray_alloc(); opts.winebuild_args = strarray_alloc(); + opts.delayimports = strarray_alloc(); opts.pic = 1;
/* determine the processor type */ @@ -1672,6 +1686,11 @@ int main(int argc, char **argv) opts.subsystem = strdup( Wl->base[++j] ); continue; } + if (!strcmp(Wl->base[j], "-delayload") && j < Wl->size - 1) + { + strarray_add( opts.delayimports, Wl->base[++j] ); + continue; + } if (!strcmp(Wl->base[j], "-static")) linking = -1; strarray_add(opts.linker_args, strmake("-Wl,%s",Wl->base[j])); }