22510525 stdbuf on SPARC broken libstdbuf.so: referenced symbol not found
authorRich Burridge <rich.burridge@oracle.com>
Mon, 25 Jan 2016 13:38:07 -0800
changeset 5326 5ee407fd058a
parent 5325 25836c8f6fb0
child 5327 e8b0f6b16632
22510525 stdbuf on SPARC broken libstdbuf.so: referenced symbol not found
components/coreutils/patches/system.h.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/coreutils/patches/system.h.patch	Mon Jan 25 13:38:07 2016 -0800
@@ -0,0 +1,36 @@
+Prevent a relocation error with the "program_name" symbol in libstdbuf.so
+when used with the stdbuf utility on SPARC.
+
+See:
+
+  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22430
+
+for more details.
+
+This problem has been fixed upstream:
+http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=6412d569dc104fe7c0dea8adf71c011df1afeaeb
+
+--- src/system.h.orig	2016-01-24 12:37:11.150301128 -0800
++++ src/system.h	2016-01-24 12:38:39.880106964 -0800
+@@ -607,11 +607,16 @@
+           node, node == program ? " invocation" : "");
+ }
+ 
+-static inline void
+-emit_try_help (void)
+-{
+-  fprintf (stderr, _("Try '%s --help' for more information.\n"), program_name);
+-}
++/* A macro rather than an inline function, as it references
++   the global program_name, which causes run time linking issues
++   in libstdbuf.so where unused functions are not removed by the linker.  */
++#define emit_try_help() \
++  do \
++    { \
++      fprintf (stderr, _("Try '%s --help' for more information.\n"), \
++               program_name); \
++    } \
++  while (0)
+ 
+ #include "inttostr.h"
+