[PATCH xserver 4/4] meson: Fix linkage of loadable modules for PE/COFF

Jon Turney jon.turney at dronecode.org.uk
Mon Jun 26 13:54:07 UTC 2017


For the loadable modules it makes sense to build for PE/COFF targets, link
those loadable modules with the import library for the Xorg executable, so
that symbols provided by the executable can be satisfied at link time (as
required by PE/COFF).

This requires a meson with PR #1955.

Since this uses the implib: kwarg for executable() introduced in that PR,
which is a syntax error with older meson, this patch cannot be applied until
that PR is in a meson release, and we can update the minimum meson version
which we require in project() to that.
---
 hw/xfree86/dixmods/meson.build  | 6 +++++-
 hw/xfree86/exa/meson.build      | 2 +-
 hw/xfree86/fbdevhw/meson.build  | 1 +
 hw/xfree86/meson.build          | 3 ++-
 hw/xfree86/shadowfb/meson.build | 1 +
 5 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/dixmods/meson.build b/hw/xfree86/dixmods/meson.build
index ffaf3ef86..835d23215 100644
--- a/hw/xfree86/dixmods/meson.build
+++ b/hw/xfree86/dixmods/meson.build
@@ -1,4 +1,4 @@
-shared_module(
+fb = shared_module(
     'fb',
     'fbmodule.c',
 
@@ -6,6 +6,7 @@ shared_module(
     c_args: xorg_c_args,
     dependencies: common_dep,
     link_whole: libxserver_fb,
+    link_with: e,
 
     install: true,
     install_dir: module_dir,
@@ -19,6 +20,7 @@ shared_module(
     c_args: [ xorg_c_args, wfb_args ],
     dependencies: common_dep,
     link_whole: libxserver_wfb,
+    link_with: e,
 
     install: true,
     install_dir: module_dir,
@@ -32,6 +34,7 @@ shared_module(
     c_args: xorg_c_args,
     dependencies: common_dep,
     link_whole: libxserver_miext_shadow,
+    link_with: [fb, e],
 
     install: true,
     install_dir: module_dir,
@@ -46,6 +49,7 @@ if build_glx
         c_args: [ xorg_c_args, glx_align64 ],
         dependencies: [ common_dep, dl_dep ],
         link_whole: libxserver_glx,
+        link_with: e,
 
         install: true,
         install_dir: join_paths(module_dir, 'extensions')
diff --git a/hw/xfree86/exa/meson.build b/hw/xfree86/exa/meson.build
index bfc5590f8..5f5cf08a7 100644
--- a/hw/xfree86/exa/meson.build
+++ b/hw/xfree86/exa/meson.build
@@ -2,7 +2,7 @@ xorg_exa = shared_module('exa',
     'examodule.c',
     include_directories: [inc, xorg_inc],
     dependencies: common_dep,
-    link_with: libxserver_exa,
+    link_with: [libxserver_exa, e],
     c_args: xorg_c_args,
     install: true,
     install_dir: module_dir,
diff --git a/hw/xfree86/fbdevhw/meson.build b/hw/xfree86/fbdevhw/meson.build
index 2f82e2d9f..35d66ef2c 100644
--- a/hw/xfree86/fbdevhw/meson.build
+++ b/hw/xfree86/fbdevhw/meson.build
@@ -11,6 +11,7 @@ shared_module('fbdevhw',
     c_args: xorg_c_args,
     install: true,
     install_dir: module_dir,
+    link_with: e,
 )
 
 install_data('fbdevhw.h', install_dir: xorgsdkdir)
diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build
index 3c5f46f0b..3b1aa17ff 100644
--- a/hw/xfree86/meson.build
+++ b/hw/xfree86/meson.build
@@ -91,7 +91,7 @@ xorg_deps = [
     libdrm_dep,
 ]
 
-executable(
+e = executable(
     'Xorg',
     srcs_xorg,
     include_directories: [inc, xorg_inc],
@@ -100,6 +100,7 @@ executable(
     link_args: linker_export_flags,
     c_args: xorg_c_args,
     install: true,
+    implib: true,
 )
 
 # subdirs for modules loadable by Xorg
diff --git a/hw/xfree86/shadowfb/meson.build b/hw/xfree86/shadowfb/meson.build
index 0470ecbb5..7ecc9bc30 100644
--- a/hw/xfree86/shadowfb/meson.build
+++ b/hw/xfree86/shadowfb/meson.build
@@ -5,6 +5,7 @@ shared_module('shadowfb',
     c_args: xorg_c_args,
     install: true,
     install_dir: module_dir,
+    link_with: e,
 )
 
 install_data('shadowfb.h', install_dir: xorgsdkdir)
-- 
2.12.3



More information about the xorg-devel mailing list