Module: Mesa
Branch: staging/22.3
Commit: df2bfda882a286435f7e585d50d887d4d3198835
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=df2bfda882a286435f7e585d50d887d4d3198835

Author: Yonggang Luo <[email protected]>
Date:   Tue Nov  8 20:48:30 2022 +0800

meson: fixes mingw-clang32 building

Cc: mesa-stable

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Jesse Natalie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit ab20ec9da76d77ae3942ecf1031366d29a4dff7b)

---

 .pick_status.json         |  2 +-
 bin/gen_vs_module_defs.py | 27 ++++++++++++++-------------
 bin/meson.build           |  3 ++-
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 9770c40ad44..4a0be70ddef 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -184,7 +184,7 @@
         "description": "meson: fixes mingw-clang32 building",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/bin/gen_vs_module_defs.py b/bin/gen_vs_module_defs.py
index dff8ab36f92..b2cf2125dbb 100644
--- a/bin/gen_vs_module_defs.py
+++ b/bin/gen_vs_module_defs.py
@@ -35,7 +35,7 @@ For gcc/x86,gcc/arm
 `stw_get_device` => `stw_get_device`
 
 """
-def gen_vs_module_def(in_file: str, out_file: str, compiler_id: str, 
cpu_family: str) -> None:
+def gen_vs_module_def(in_file: str, out_file: str, compiler_abi: str, 
compiler_id: str, cpu_family: str) -> None:
     out_file_lines = ['EXPORTS']
     with open(in_file, 'r', encoding='utf-8') as f:
         lines = f.readlines()
@@ -57,7 +57,7 @@ def gen_vs_module_def(in_file: str, out_file: str, 
compiler_id: str, cpu_family:
                 continue
             order_info = '' if len(def_infos) <= 1 else def_infos[1]
             if def_infos[0] != name_infos[0] and \
-                (compiler_id == 'gcc') and (cpu_family not in {'x86_64', 
'aarch64'}):
+                (compiler_abi == 'gcc' and compiler_id != 'clang') and 
(cpu_family not in {'x86_64', 'aarch64'}):
                 if order_info:
                     out_file_lines.append('\t' + def_infos[0] + ' ' + 
order_info + ' == ' + name_infos[0])
                 else:
@@ -71,28 +71,29 @@ def gen_vs_module_def(in_file: str, out_file: str, 
compiler_id: str, cpu_family:
         out_file_content = '\n'.join(out_file_lines) + '\n'
         f.write(out_file_content.encode('utf-8'))
 '''
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/libgl-gdi/opengl32.def.in --out_file 
src/gallium/targets/libgl-gdi/opengl32.def --compiler_id gcc --cpu_family x86_64
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/libgl-gdi/opengl32.def.in --out_file 
src/gallium/targets/libgl-gdi/opengl32.mingw.def --compiler_id gcc --cpu_family 
x86
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/libgl-gdi/opengl32.def.in --out_file 
src/gallium/targets/libgl-gdi/opengl32.def --compiler_abi gcc --cpu_family 
x86_64
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/libgl-gdi/opengl32.def.in --out_file 
src/gallium/targets/libgl-gdi/opengl32.mingw.def --compiler_abi gcc 
--cpu_family x86
 
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/osmesa/osmesa.def.in --out_file 
src/gallium/targets/osmesa/osmesa.def --compiler_id gcc --cpu_family x86_64
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/osmesa/osmesa.def.in --out_file 
src/gallium/targets/osmesa/osmesa.mingw.def --compiler_id gcc --cpu_family x86
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/osmesa/osmesa.def.in --out_file 
src/gallium/targets/osmesa/osmesa.def --compiler_abi gcc --cpu_family x86_64
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/osmesa/osmesa.def.in --out_file 
src/gallium/targets/osmesa/osmesa.mingw.def --compiler_abi gcc --cpu_family x86
 
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/wgl/gallium_wgl.def.in --out_file 
src/gallium/targets/wgl/gallium_wgl.def --compiler_id gcc --cpu_family x86_64
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/wgl/gallium_wgl.def.in --out_file 
src/gallium/targets/wgl/gallium_wgl.mingw.def --compiler_id gcc --cpu_family x86
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/wgl/gallium_wgl.def.in --out_file 
src/gallium/targets/wgl/gallium_wgl.def --compiler_abi gcc --cpu_family x86_64
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/wgl/gallium_wgl.def.in --out_file 
src/gallium/targets/wgl/gallium_wgl.mingw.def --compiler_abi gcc --cpu_family 
x86
 
-python ./bin/gen_vs_module_defs.py --in_file src/egl/main/egl.def.in 
--out_file src/egl/main/egl.def --compiler_id gcc --cpu_family x86_64
-python ./bin/gen_vs_module_defs.py --in_file src/egl/main/egl.def.in 
--out_file src/egl/main/egl.mingw.def --compiler_id gcc --cpu_family x86
+python ./bin/gen_vs_module_defs.py --in_file src/egl/main/egl.def.in 
--out_file src/egl/main/egl.def --compiler_abi gcc --cpu_family x86_64
+python ./bin/gen_vs_module_defs.py --in_file src/egl/main/egl.def.in 
--out_file src/egl/main/egl.mingw.def --compiler_abi gcc --cpu_family x86
 
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/lavapipe/vulkan_lvp.def.in --out_file 
src/gallium/targets/lavapipe/vulkan_lvp.def --compiler_id gcc --cpu_family 
x86_64
-python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/lavapipe/vulkan_lvp.def.in --out_file 
src/gallium/targets/lavapipe/vulkan_lvp.mingw.def --compiler_id gcc 
--cpu_family x86
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/lavapipe/vulkan_lvp.def.in --out_file 
src/gallium/targets/lavapipe/vulkan_lvp.def --compiler_abi gcc --cpu_family 
x86_64
+python ./bin/gen_vs_module_defs.py --in_file 
src/gallium/targets/lavapipe/vulkan_lvp.def.in --out_file 
src/gallium/targets/lavapipe/vulkan_lvp.mingw.def --compiler_abi gcc 
--cpu_family x86
 
 '''
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(description=gen_help)
     parser.add_argument('--in_file', help='input template moudle definition 
file')
     parser.add_argument('--out_file', help='output moudle definition file')
+    parser.add_argument('--compiler_abi', help='compiler abi')
     parser.add_argument('--compiler_id', help='compiler id')
     parser.add_argument('--cpu_family', help='cpu family')
     args = parser.parse_args()
     # print(args)
-    gen_vs_module_def(args.in_file, args.out_file, args.compiler_id, 
args.cpu_family)
+    gen_vs_module_def(args.in_file, args.out_file, args.compiler_abi, 
args.compiler_id, args.cpu_family)
diff --git a/bin/meson.build b/bin/meson.build
index a70f83bbf8b..ef28adf34d9 100644
--- a/bin/meson.build
+++ b/bin/meson.build
@@ -23,7 +23,8 @@ gen_vs_module_defs_py = files('gen_vs_module_defs.py')
 gen_vs_module_defs_normal_command = [
   prog_python, gen_vs_module_defs_py,
   '--in_file', '@INPUT@', '--out_file', '@OUTPUT@',
-  '--compiler_id', cc.get_argument_syntax(), '--cpu_family', 
host_machine.cpu_family()
+  '--compiler_abi', cc.get_argument_syntax(),
+  '--compiler_id', cc.get_id(), '--cpu_family', host_machine.cpu_family()
 ]
 symbols_check = find_program('symbols-check.py')
 install_megadrivers_py = find_program('install_megadrivers.py')

Reply via email to