[RFC PATCH xserver] xfree86: build a shared lib identical to Xorg
Peter Hutterer
peter.hutterer at who-t.net
Mon May 8 00:24:34 UTC 2017
Because we can use a shared lib in dlsym() for the symbol loader test, but we
can't use the executable.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
A quick hack to make the xorg_symbol_test bit actually load things and
bail out for appropriate reasons.
hw/xfree86/drivers/modesetting/meson.build | 2 +-
hw/xfree86/loader/symbol-test.c | 3 +--
hw/xfree86/meson.build | 42 +++++++++++++++++++++---------
3 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/meson.build b/hw/xfree86/drivers/modesetting/meson.build
index 518d6c19e..ac6f3275d 100644
--- a/hw/xfree86/drivers/modesetting/meson.build
+++ b/hw/xfree86/drivers/modesetting/meson.build
@@ -28,7 +28,7 @@ shared_module(
# Test that we don't have any unresolved symbols from our module to Xorg.
xorg_build_root = join_paths(meson.build_root(), 'hw', 'xfree86')
symbol_test_args = []
-symbol_test_args += join_paths(xorg_build_root, 'Xorg')
+symbol_test_args += join_paths(xorg_build_root, 'libxorgserver.so')
symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libfb.so')
symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libshadow.so')
if build_glamor
diff --git a/hw/xfree86/loader/symbol-test.c b/hw/xfree86/loader/symbol-test.c
index 6b4eb1a71..1d7d84635 100644
--- a/hw/xfree86/loader/symbol-test.c
+++ b/hw/xfree86/loader/symbol-test.c
@@ -35,8 +35,7 @@ int main (int argc, char**argv)
if (argc < 2) {
fprintf(stderr,
- "Must pass path of Xorg executable and any "
- "modules to be loaded.\n");
+ "Must pass path any modules to be loaded.\n");
exit(1);
}
diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build
index 22de2fdd6..e4f7bd681 100644
--- a/hw/xfree86/meson.build
+++ b/hw/xfree86/meson.build
@@ -90,25 +90,41 @@ if build_dri2
xorg_link += xorg_dri2
endif
+xorg_deps = [
+ pixman_dep,
+ m_dep,
+ dl_dep,
+ pciaccess_dep,
+ sha1_dep,
+ dependency('xau'),
+ xdmcp_dep,
+ xfont2_dep,
+ xshmfence_dep,
+ config_dep,
+ dependency('libdrm'),
+]
+
executable(
'Xorg',
srcs_xorg,
include_directories: [inc, xorg_inc],
link_whole: xorg_link,
- dependencies: [
- pixman_dep,
- m_dep,
- dl_dep,
- pciaccess_dep,
- sha1_dep,
- dependency('xau'),
- xdmcp_dep,
- xfont2_dep,
- xshmfence_dep,
- config_dep,
- dependency('libdrm'),
- ],
+ dependencies: xorg_deps,
link_args: '-Wl,--export-dynamic',
c_args: xorg_c_args,
install: true,
)
+
+# For symbol presence testing only
+xorgserver_lib = shared_library(
+ 'xorgserver',
+ srcs_xorg,
+ include_directories: [inc, xorg_inc],
+ link_whole: xorg_link,
+ dependencies: xorg_deps,
+ link_args: '-Wl,--export-dynamic',
+ c_args: xorg_c_args,
+ install: false,
+)
+
+xorgserver_dep = declare_dependency(link_with : xorgserver_lib)
--
2.12.2
More information about the xorg-devel
mailing list