ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
ff6046
From 0ed1150ccf8837ca85cbb8d5a42fe81b5efeac32 Mon Sep 17 00:00:00 2001
ff6046
From: Jussi Pakkanen <jpakkane@gmail.com>
ff6046
Date: Sat, 6 Apr 2019 21:59:06 +0200
ff6046
Subject: [PATCH] meson: drop misplaced -Wl,--undefined argument
ff6046
ff6046
Ld's man page says the following:
ff6046
ff6046
  -u symbol
ff6046
  --undefined=symbol
ff6046
ff6046
  Force symbol to be entered in the output file as an undefined symbol. Doing
ff6046
  this may, for example, trigger linking of additional modules from standard
ff6046
  libraries. -u may be repeated with different option arguments to enter
ff6046
  additional undefined symbols. This option is equivalent to the "EXTERN"
ff6046
  linker script command.
ff6046
ff6046
  If this option is being used to force additional modules to be pulled into
ff6046
  the link, and if it is an error for the symbol to remain undefined, then the
ff6046
  option --require-defined should be used instead.
ff6046
ff6046
This would imply that it always requires an argument, which this does not
ff6046
pass. Thus it will grab the next argument on the command line as its
ff6046
argument. Before it took one of the many -lrt args (presumably) and now it
ff6046
grabs something other random linker argument and things break.
ff6046
ff6046
[zj: this line was added in the first version of the meson configuration back
ff6046
in 5c23128daba7236a6080383b2a5649033cfef85c. AFAICT, this was a mistake. No
ff6046
such flag appeared in Makefile.am at the time.]
ff6046
ff6046
https://github.com/mesonbuild/meson/issues/5113
ff6046
(cherry picked from commit 700805f6c546f2adb79059614f3747f7b5474325)
ff6046
---
ff6046
 meson.build | 3 +--
ff6046
 1 file changed, 1 insertion(+), 2 deletions(-)
ff6046
ff6046
diff --git a/meson.build b/meson.build
ff6046
index d58926c981..f2d67b7e02 100644
ff6046
--- a/meson.build
ff6046
+++ b/meson.build
ff6046
@@ -1436,8 +1436,7 @@ foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
ff6046
                         # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
ff6046
                         link_args : ['-Wl,-z,nodelete',
ff6046
                                      '-shared',
ff6046
-                                     '-Wl,--version-script=' + version_script_arg,
ff6046
-                                     '-Wl,--undefined'],
ff6046
+                                     '-Wl,--version-script=' + version_script_arg],
ff6046
                         link_with : [libsystemd_static,
ff6046
                                      libbasic],
ff6046
                         dependencies : [threads,