Commit 349861ce authored by Thomas Haller's avatar Thomas Haller

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.
parent ec016f6b
......@@ -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
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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',
......
......@@ -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',
......
......@@ -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',
......
......@@ -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')
......
......@@ -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',
......
......@@ -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')
......
......@@ -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',
......
......@@ -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',
......
......@@ -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',
......
......@@ -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',
......
......@@ -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,
......
......@@ -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'
......
......@@ -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,
......
......@@ -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,
......
......@@ -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',
......
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment