Alexandre Julliard : winebuild: Add support for excluding a specific CPU architecture.

Alexandre Julliard julliard at winehq.org
Wed Oct 16 16:59:29 CDT 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Oct 16 14:28:38 2019 +0200

winebuild: Add support for excluding a specific CPU architecture.

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

---

 tools/winebuild/parser.c         | 8 +++++---
 tools/winebuild/winebuild.man.in | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 3191efaf9e..be705c25f0 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -470,7 +470,7 @@ static int parse_spec_extern( ORDDEF *odp, DLLSPEC *spec )
  */
 static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
 {
-    unsigned int i;
+    unsigned int i, cpu_mask = 0;
     const char *token;
 
     do
@@ -493,13 +493,14 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
                     odp->flags |= FLAG_CPU_WIN64;
                 else
                 {
-                    int cpu = get_cpu_from_name( cpu_name );
+                    int cpu = get_cpu_from_name( cpu_name + (cpu_name[0] == '!') );
                     if (cpu == -1)
                     {
                         error( "Unknown architecture '%s'\n", cpu_name );
                         return NULL;
                     }
-                    odp->flags |= FLAG_CPU( cpu );
+                    if (cpu_name[0] == '!') cpu_mask |= FLAG_CPU( cpu );
+                    else odp->flags |= FLAG_CPU( cpu );
                 }
                 cpu_name = strtok( NULL, "," );
             }
@@ -537,6 +538,7 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
         token = GetToken(0);
     } while (token && *token == '-');
 
+    if (cpu_mask) odp->flags |= FLAG_CPU_MASK & ~cpu_mask;
     return token;
 }
 
diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in
index 12bafd72d3..367121544d 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -326,13 +326,14 @@ of a
 specification when an application expects to find the function's
 implementation inside the dll.
 .TP
-.RE
-.BI -arch= cpu\fR[\fB,\fIcpu\fR]
+.B -arch=\fR[\fB!\fR]\fIcpu\fR[\fB,\fIcpu\fR]
 The entry point is only available on the specified CPU
 architecture(s). The names \fBwin32\fR and \fBwin64\fR match all
 32-bit or 64-bit CPU architectures respectively. In 16-bit dlls,
 specifying \fB-arch=win32\fR causes the entry point to be exported
-from the 32-bit wrapper module.
+from the 32-bit wrapper module. A CPU name can be prefixed with
+\fB!\fR to exclude only that specific architecture.
+.RE
 .SS "Function ordinals"
 Syntax:
 .br




More information about the wine-cvs mailing list