Kevin Puetz : winebuild: Select all __wine_spec_exe* entry inside winebuild.

Alexandre Julliard julliard at winehq.org
Mon Nov 30 16:13:47 CST 2020


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

Author: Kevin Puetz <PuetzKevinA at JohnDeere.com>
Date:   Wed Nov 25 13:00:26 2020 -0600

winebuild: Select all __wine_spec_exe* entry inside winebuild.

Override --entry in winegcc only when it applies to any compiler
(e.g. kernel drivers or msvcrt) but leave spec details to winebuild.

Forward -municode so winebuild will know which to use.

Signed-off-by: Kevin Puetz <PuetzKevinA at JohnDeere.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winebuild/build.h | 1 +
 tools/winebuild/main.c  | 9 +++++++--
 tools/winegcc/winegcc.c | 4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 03715af9563..26a0539c500 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -136,6 +136,7 @@ typedef struct
     int              subsystem;          /* subsystem id */
     int              subsystem_major;    /* subsystem version major number */
     int              subsystem_minor;    /* subsystem version minor number */
+    int              unicode_app;        /* default to unicode entry point */
     ORDDEF          *entry_points;       /* dll entry points */
     ORDDEF         **names;              /* array of entry point names (points into entry_points) */
     ORDDEF         **ordinals;           /* array of dll ordinals (points into entry_points) */
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 0e5e1627dda..b1e6d115717 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -396,8 +396,12 @@ static const char *get_default_entry_point( const DLLSPEC *spec )
 {
     if (spec->characteristics & IMAGE_FILE_DLL) return "DllMain";
     if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "DriverEntry";
-    if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry";
-    return "__wine_spec_exe_entry";
+    if (spec->type == SPEC_WIN16)
+        return "__wine_spec_exe16_entry";
+    else if (spec->unicode_app)
+        return "__wine_spec_exe_wentry";
+    else
+        return "__wine_spec_exe_entry";
 }
 
 /* parse options from the argv array and remove all the recognized ones */
@@ -448,6 +452,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
             else if (!strcmp( optarg, "thumb" )) thumb_mode = 1;
             else if (!strcmp( optarg, "no-cygwin" )) use_msvcrt = 1;
             else if (!strcmp( optarg, "unix" )) unix_lib = 1;
+            else if (!strcmp( optarg, "unicode" )) spec->unicode_app = 1;
             else if (!strncmp( optarg, "cpu=", 4 )) cpu_option = xstrdup( optarg + 4 );
             else if (!strncmp( optarg, "fpu=", 4 )) fpu_option = xstrdup( optarg + 4 );
             else if (!strncmp( optarg, "arch=", 5 )) arch_option = xstrdup( optarg + 5 );
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index e9707a73774..6decb02ee04 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -1255,8 +1255,6 @@ static void build(struct options* opts)
             entry_point = (is_pe && opts->target_cpu == CPU_x86) ? "DriverEntry at 8" : "DriverEntry";
         else if (opts->use_msvcrt && !opts->shared && !opts->win16_app)
             entry_point = opts->unicode_app ? "wmainCRTStartup" : "mainCRTStartup";
-        else if (!is_pe && !opts->shared && opts->unicode_app)
-            entry_point = "__wine_spec_exe_wentry";
     }
     else entry_point = opts->entry_point;
 
@@ -1268,6 +1266,8 @@ static void build(struct options* opts)
     spec_o_name = get_temp_file(output_name, ".spec.o");
     if (opts->force_pointer_size)
         strarray_add(spec_args, strmake("-m%u", 8 * opts->force_pointer_size ));
+    if(opts->unicode_app)
+        strarray_add(spec_args, "-municode");
     strarray_add(spec_args, "-D_REENTRANT");
     if (opts->pic && !is_pe) strarray_add(spec_args, "-fPIC");
     strarray_add(spec_args, opts->shared ? "--dll" : "--exe");




More information about the wine-cvs mailing list