winegc: Support overriding the default PE file alignment.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-07-23 20:33:16 +02:00
parent e36bed4f37
commit 0e4d22bd8d
1 changed files with 8 additions and 1 deletions

View File

@ -223,6 +223,7 @@ struct options
const char* output_name;
const char* image_base;
const char* section_align;
const char* file_align;
const char* sysroot;
const char* isysroot;
const char* lib_suffix;
@ -522,7 +523,8 @@ static strarray *get_link_args( struct options *opts, const char *output_name )
strarray_add(link_args, strmake("-Wl,-pdb,%s", opts->debug_file));
if (!try_link( opts->prefix, link_args, "-Wl,--file-alignment,0x1000" ))
strarray_add( link_args, "-Wl,--file-alignment,0x1000" );
strarray_add( link_args, strmake( "-Wl,--file-alignment,%s",
opts->file_align ? opts->file_align : "0x1000" ));
strarray_addall( link_args, flags );
return link_args;
@ -1918,6 +1920,11 @@ int main(int argc, char **argv)
opts.section_align = strdup( Wl->base[++j] );
continue;
}
if (!strcmp(Wl->base[j], "--file-alignment") && j < Wl->size - 1)
{
opts.file_align = strdup( Wl->base[++j] );
continue;
}
if (!strcmp(Wl->base[j], "--large-address-aware"))
{
opts.large_address_aware = 1;