[dconf: 1/7] client: add symbol map




commit d23b3fddd62cf5310c7f8869663ddb1c54c192dc
Author: Daniel Playfair Cal <daniel playfair cal gmail com>
Date:   Mon May 4 16:07:01 2020 +1000

    client: add symbol map
    
    This is similar to what is done in in libdconfsettings to prevent
    symbols not part of the API from being available in the compiled
    binaries. In practice, this makes it possible to include more code in
    the common directory without creating new symbols in libdconf.

 client/meson.build |  5 +++++
 client/symbol.map  | 14 ++++++++++++++
 2 files changed, 19 insertions(+)
---
diff --git a/client/meson.build b/client/meson.build
index e9672b8d..0308dc2d 100644
--- a/client/meson.build
+++ b/client/meson.build
@@ -32,6 +32,9 @@ client_deps = [
   libdconf_gdbus_thread_dep,
 ]
 
+symbol_map = join_paths(meson.current_source_dir(), 'symbol.map')
+ldflags = cc.get_supported_link_arguments('-Wl,--version-script,@0@'.format(symbol_map))
+
 libdconf = shared_library(
   'dconf',
   sources: sources,
@@ -40,6 +43,8 @@ libdconf = shared_library(
   include_directories: top_inc,
   dependencies: client_deps,
   c_args: dconf_c_args,
+  link_args: ldflags,
+  link_depends: symbol_map,
   install: true,
 )
 
diff --git a/client/symbol.map b/client/symbol.map
new file mode 100644
index 00000000..2fc99835
--- /dev/null
+++ b/client/symbol.map
@@ -0,0 +1,14 @@
+{
+global:
+  dconf_client_*;
+  dconf_changeset_*;
+  dconf_error_quark;
+  dconf_is_path;
+  dconf_is_key;
+  dconf_is_dir;
+  dconf_is_rel_path;
+  dconf_is_rel_key;
+  dconf_is_rel_dir;
+local:
+  *;
+};


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]