[network-manager-applet/lr/meson-fixes: 2/4] meson: drop unuseful -Wl, --gc-sections check



commit cac5b99d356d0690569da8cfdc7c2db172897ffd
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Feb 15 17:31:13 2019 +0100

    meson: drop unuseful -Wl,--gc-sections check
    
    Meson complains that it doesn't work:
    
      WARNING: -Wl,--gc-sections looks like a linker argument, but
      has_argument and other similar methods only support checking compiler
      arguments. Using them to check linker arguments are never supported, and
      results are likely to be wrong regardless of the compiler you are using.
      has_link_argument or other similar method can be used instead.
    
     The has_link_argument() function
    requires meson 0.46 (we depend on 0.43) and it can't check for options
    without argument.
    
    Let's drop the check instead. It complicates things for no good reason:
    we don't want to build on platforms that don't support symbol versioning
    anyways.

 meson.build                       | 3 ---
 src/connection-editor/meson.build | 7 +------
 src/libnm-gtk/meson.build         | 7 +------
 src/libnma/meson.build            | 7 +------
 src/meson.build                   | 7 +------
 5 files changed, 4 insertions(+), 27 deletions(-)
---
diff --git a/meson.build b/meson.build
index e1ce626f..8ba41792 100644
--- a/meson.build
+++ b/meson.build
@@ -107,9 +107,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_ver = join_paths(meson.source_root(), 'linker-script-binary.ver')
 
 # Check for iso-codes for country names translation
diff --git a/src/connection-editor/meson.build b/src/connection-editor/meson.build
index 8ab39a91..9f354ce1 100644
--- a/src/connection-editor/meson.build
+++ b/src/connection-editor/meson.build
@@ -98,11 +98,6 @@ cflags = [
   '-DICONDIR="@0@"'.format(nma_icondir)
 ]
 
-ldflags = []
-if have_version_script
-  ldflags += '-Wl,--version-script,@0@'.format(linker_script_ver)
-endif
-
 if enable_selinux
   deps += libselinux_dep
 endif
@@ -117,7 +112,7 @@ executable(
   include_directories: incs,
   dependencies: deps,
   c_args: cflags,
-  link_args: ldflags,
+  link_args: '-Wl,--version-script,@0@'.format(linker_script_ver),
   link_depends: linker_script_ver,
   link_whole: libwireless_security_libnm,
   install: true,
diff --git a/src/libnm-gtk/meson.build b/src/libnm-gtk/meson.build
index 569ee812..96c3c8bd 100644
--- a/src/libnm-gtk/meson.build
+++ b/src/libnm-gtk/meson.build
@@ -63,11 +63,6 @@ cflags = [
 
 symbol_map = join_paths(meson.current_source_dir(), 'libnm-gtk.ver')
 
-ldflags = []
-if have_version_script
-  ldflags += '-Wl,--version-script,' + symbol_map
-endif
-
 libnm_gtk = shared_library(
   'nm-gtk',
   sources: sources,
@@ -75,7 +70,7 @@ libnm_gtk = shared_library(
   include_directories: incs,
   dependencies: deps,
   c_args: cflags,
-  link_args: ldflags,
+  link_args: '-Wl,--version-script,' + symbol_map,
   link_depends: symbol_map,
   link_whole: libwireless_security_libnm_glib,
   install: true,
diff --git a/src/libnma/meson.build b/src/libnma/meson.build
index 9344bde1..879e1b84 100644
--- a/src/libnma/meson.build
+++ b/src/libnma/meson.build
@@ -71,11 +71,6 @@ cflags = [
 
 symbol_map = join_paths(meson.current_source_dir(), 'libnma.ver')
 
-ldflags = []
-if have_version_script
-  ldflags += '-Wl,--version-script,' + symbol_map
-endif
-
 if enable_gcr
   headers += files(
     'nma-cert-chooser-button.h',
@@ -100,7 +95,7 @@ libnma = shared_library(
   include_directories: incs,
   dependencies: deps,
   c_args: cflags,
-  link_args: ldflags,
+  link_args: '-Wl,--version-script,' + symbol_map,
   link_depends: symbol_map,
   link_whole: libwireless_security_libnm,
   install: true,
diff --git a/src/meson.build b/src/meson.build
index c96f9d0a..cd5c9368 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -88,11 +88,6 @@ cflags = [
   '-DG_LOG_DOMAIN="@0@"'.format(nma_name)
 ]
 
-ldflags = []
-if have_version_script
-  ldflags += '-Wl,--version-script,@0@'.format(linker_script_ver)
-endif
-
 if enable_appindicator == 'ayatana' or enable_appindicator == 'ubuntu'
   deps += [
     appindicator_dep,
@@ -112,7 +107,7 @@ executable(
   include_directories: incs,
   dependencies: deps,
   c_args: cflags,
-  link_args: ldflags,
+  link_args: '-Wl,--version-script,@0@'.format(linker_script_ver),
   link_depends: linker_script_ver,
   link_whole: libwireless_security_libnm,
   install: true,


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