build/meson: unconditionally use linker version scripts

We also unconditionally use them with autotools.
Also, the detection for have_version_script does
not seem correct to me. At least, it didn't work
with clang.
This commit is contained in:
Thomas Haller 2018-01-10 10:29:11 +01:00
parent ec016f6b43
commit 349861ceec
20 changed files with 64 additions and 90 deletions

View file

@ -31,10 +31,9 @@ cflags = clients_cflags + [
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir)
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
if enable_polkit_agent
sources += nm_polkit_listener

View file

@ -14,10 +14,9 @@ cflags = clients_cflags + [
'-DG_LOG_DOMAIN="@0@"'.format(name),
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -61,10 +61,9 @@ deps += [
libnmt_newt_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -54,10 +54,9 @@ sources += gnome.gdbus_codegen(
namespace: 'NMDBus'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -102,10 +102,9 @@ deps = common_deps + [libnm_util_dep]
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm_glib_vpn = shared_library(
'nm-glib-vpn',
@ -195,10 +194,9 @@ deps = common_deps + [
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm_glib = shared_library(
'nm-glib',

View file

@ -110,10 +110,9 @@ cflags = common_cflags + [
symbol_map = join_paths(meson.current_source_dir(), 'libnm-util.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm_util = shared_library(
'nm-util',

View file

@ -145,10 +145,9 @@ deps = [
symbol_map = join_paths(meson.current_source_dir(), 'libnm.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm = shared_library(
'nm',

View file

@ -165,9 +165,6 @@ endif
add_project_arguments(common_flags, language: 'c')
add_project_link_arguments(common_ldflags, language: 'c')
ldflag = '-Wl,--version-script'
have_version_script = host_machine.system().contains('linux') and cc.has_argument(ldflag)
linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver')
linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver')
linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver')

View file

@ -9,10 +9,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_adsl = shared_module(
'nm-device-plugin-adsl',

View file

@ -14,10 +14,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
if enable_bluez5_dun
sources += files('nm-bluez5-dun.c')

View file

@ -12,10 +12,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_ovs = shared_module(
'nm-device-plugin-ovs',

View file

@ -10,10 +10,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_team = shared_module(
'nm-device-plugin-team',

View file

@ -21,10 +21,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_wifi = shared_module(
'nm-device-plugin-wifi',

View file

@ -16,10 +16,9 @@ endif
symbol_name = join_paths(meson.current_source_dir(), 'libnm-wwan.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_name)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_name),
]
libnm_wwan = shared_module(
'nm-wwan',
@ -51,10 +50,9 @@ sources = files(
deps += libnmdbus_dep
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_wwan = shared_module(
'nm-device-plugin-wwan',

View file

@ -6,10 +6,9 @@ cflags = [
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -232,9 +232,7 @@ symbol_map = custom_target(
command: [create_exports_networkmanager, '--called-from-make', '@INPUT@']
)
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
'''
network_manager = executable(
@ -257,10 +255,9 @@ deps = [
nm_core_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
name = 'nm-iface-helper'

View file

@ -28,10 +28,9 @@ deps = [
symbol_map = join_paths(meson.current_source_dir(), 'nm-ppp-plugin.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
core_plugins += shared_module(
name,

View file

@ -17,10 +17,9 @@ sources = files(
'nms-ibft-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_settings),
]
libnm_settings_plugin_ibft = shared_module(
name,

View file

@ -46,10 +46,9 @@ libnms_ifcfg_rh_core = static_library(
sources = [dbus_sources] + files('nms-ifcfg-rh-connection.c')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_settings),
]
libnm_settings_plugin_ifcfg_rh = shared_module(
'nm-settings-plugin-ifcfg-rh',

View file

@ -22,10 +22,9 @@ sources = files(
'nms-ifupdown-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_settings),
]
libnm_settings_plugin_ifupdown = shared_module(
'nm-settings-plugin-ifupdown',