]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Fix version script handling
authorJan Janssen <medhefgo@web.de>
Tue, 26 Sep 2023 13:14:38 +0000 (15:14 +0200)
committerJan Janssen <medhefgo@web.de>
Tue, 26 Sep 2023 17:41:53 +0000 (19:41 +0200)
Build targets should have a link dependency on the version scripts they
use. This also uses absolute paths in anticipation for meson 1.3
needlessly deprecating file to string conversions.

meson.build
src/core/meson.build
src/cryptsetup/cryptsetup-tokens/meson.build
src/home/meson.build
src/login/meson.build
src/nss-myhostname/meson.build
src/nss-mymachines/meson.build
src/nss-resolve/meson.build
src/nss-systemd/meson.build
src/shared/meson.build

index 381e2a8c4e1f6089ea84d6536153e7d57506df65..bd7c3e89ed30c9111086c9434badc6549b66aae9 100644 (file)
@@ -2365,17 +2365,20 @@ foreach dict : modules
 
         kwargs = {}
         foreach key, val : dict
-                if key in ['name', 'conditions']
+                if key in ['name', 'conditions', 'version-script']
                         continue
                 endif
                 kwargs += { key : val }
         endforeach
 
-        sym = meson.current_source_dir() / '@0@'.format(dict.get('link_depends')[0])
         kwargs += {
                 'link_args' : [
                         kwargs.get('link_args', []),
-                        '-Wl,--version-script=' + sym,
+                        '-Wl,--version-script=' + dict.get('version-script'),
+                ],
+                'link_depends' : [
+                        kwargs.get('link_depends', []),
+                        dict.get('version-script'),
                 ],
         }
         foreach key, val : module_additional_kwargs
index 12c7d7c6ed728b8aa5e9646a2f31aaa442b3109d..e5b92ce4d909831dbb22f66dc9716e9389ac09c1 100644 (file)
@@ -117,6 +117,7 @@ libcore = shared_library(
         c_args : ['-fvisibility=default'],
         link_args : ['-shared',
                      '-Wl,--version-script=' + libshared_sym_path],
+        link_depends : libshared_sym_path,
         link_with : libshared,
         dependencies : [libacl,
                         libapparmor,
index 120621eaee35e87a8772fcf6d405a6fbf546c528..88665202a0dc535424ff9811ca0f81384ea0fe24 100644 (file)
@@ -29,7 +29,7 @@ template = {
                 lib_cryptsetup_token_common,
                 libshared,
         ],
-        'link_depends' : files('cryptsetup-token.sym'),
+        'version-script' : meson.current_source_dir() / 'cryptsetup-token.sym',
         'install_rpath' : pkglibdir,
         'install' : true,
         'install_dir' : libcryptsetup_plugins_dir,
index cbd37dba780647e6c20e4a89b6cd0907bc8aaeb7..5ababfa02db786a33a0b7a9bceb55b221e57f455 100644 (file)
@@ -123,7 +123,7 @@ modules += [
                         libpam,
                         threads,
                 ],
-                'link_depends' : files('pam_systemd_home.sym'),
+                'version-script' : meson.current_source_dir() / 'pam_systemd_home.sym',
         },
 ]
 
index 276e920dfc33349ba0e25453b601ac5059591914..1ba996d51711605dc21cc5b7085c2d57964815df 100644 (file)
@@ -112,7 +112,7 @@ modules += [
                         'HAVE_PAM',
                 ],
                 'sources' : files('pam_systemd.c'),
-                'link_depends' : files('pam_systemd.sym'),
+                'version-script' : meson.current_source_dir() / 'pam_systemd.sym',
         },
 ]
 
index c53ab22dbcd026ee10f5ba46adffda915a179f1b..53d8bda5773b2f2aec265af7f9625566e65a23cc 100644 (file)
@@ -5,6 +5,6 @@ modules += [
                 'name' : 'nss_myhostname',
                 'conditions' : ['ENABLE_NSS_MYHOSTNAME'],
                 'sources' : files('nss-myhostname.c'),
-                'link_depends' : files('nss-myhostname.sym'),
+                'version-script' : meson.current_source_dir() / 'nss-myhostname.sym',
         },
 ]
index 7b8198fe37e3f2b66edc478505e3c44f059bde14..3e10325100d5e84a43829cac3807b687d7e72a34 100644 (file)
@@ -5,6 +5,6 @@ modules += [
                 'name' : 'nss_mymachines',
                 'conditions' : ['ENABLE_NSS_MYMACHINES'],
                 'sources' : files('nss-mymachines.c'),
-                'link_depends' : files('nss-mymachines.sym'),
+                'version-script' : meson.current_source_dir() / 'nss-mymachines.sym',
         },
 ]
index e5b65d256a2e50156e336903540482c88086aa5f..1fae4266364f03616cadbad6ba49ba6cadceec4b 100644 (file)
@@ -5,7 +5,7 @@ modules += [
                 'name' : 'nss_resolve',
                 'conditions' : ['ENABLE_NSS_RESOLVE'],
                 'sources' : files('nss-resolve.c'),
-                'link_depends' : files('nss-resolve.sym'),
+                'version-script' : meson.current_source_dir() / 'nss-resolve.sym',
                 'include_directories' : includes +
                                         include_directories('../resolve'),
         },
index 1bea17156e5e7af41339b77800a29f946e446838..ec4f780d5faa4b7413055091b30f4f783f86a1f4 100644 (file)
@@ -8,6 +8,6 @@ modules += [
                         'nss-systemd.c',
                         'userdb-glue.c',
                 ),
-                'link_depends' : files('nss-systemd.sym'),
+                'version-script' : meson.current_source_dir() / 'nss-systemd.sym',
         },
 ]
index 67f4f4517d246998f60afa9596fdf2fbae4b8e76..91ab370e46bd9bd5ed78ec2d7f3a64fa00aac1ce 100644 (file)
@@ -315,7 +315,7 @@ libshared_deps = [threads,
                   libxz,
                   libzstd]
 
-libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
+libshared_sym_path = meson.current_source_dir() / 'libshared.sym'
 libshared_build_dir = meson.current_build_dir()
 
 libshared_static = static_library(
@@ -333,6 +333,7 @@ libshared = shared_library(
         c_args : ['-fvisibility=default'],
         link_args : ['-shared',
                      '-Wl,--version-script=' + libshared_sym_path],
+        link_depends : libshared_sym_path,
         link_whole : [libshared_static,
                       libbasic,
                       libbasic_gcrypt,