mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
meson: Fix version script handling
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.
This commit is contained in:
parent
b53a80966e
commit
90461ef56f
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -123,7 +123,7 @@ modules += [
|
||||
libpam,
|
||||
threads,
|
||||
],
|
||||
'link_depends' : files('pam_systemd_home.sym'),
|
||||
'version-script' : meson.current_source_dir() / 'pam_systemd_home.sym',
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -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',
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -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',
|
||||
},
|
||||
]
|
||||
|
@ -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',
|
||||
},
|
||||
]
|
||||
|
@ -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'),
|
||||
},
|
||||
|
@ -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',
|
||||
},
|
||||
]
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user