components/coreutils/patches/system.h.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Thu, 13 Oct 2016 17:26:39 -0700
changeset 7104 8f45af4c27d7
parent 5326 5ee407fd058a
permissions -rw-r--r--
24837165 userland should move to parfait 1.9

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"