Alexandre Julliard : winegc: Support overriding the default PE file alignment.

Alexandre Julliard julliard at winehq.org
Thu Jul 23 16:36:58 CDT 2020


Module: wine
Branch: master
Commit: 0e4d22bd8dcfd9af8ddd0e0e9f9c3873f91f13ae
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0e4d22bd8dcfd9af8ddd0e0e9f9c3873f91f13ae

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jul 23 20:33:16 2020 +0200

winegc: Support overriding the default PE file alignment.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winegcc/winegcc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 274f93f40f..90ef16aa1f 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -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;




More information about the wine-cvs mailing list