17408935 GNU coreutils should be 64-bit s11-update
authorRich Burridge <rich.burridge@oracle.com>
Fri, 11 Apr 2014 15:51:35 -0700
branchs11-update
changeset 3072 1d751f6f8e9d
parent 3071 b3248af1296a
child 3073 7ff897151ce7
17408935 GNU coreutils should be 64-bit
components/coreutils/Makefile
components/coreutils/coreutils.p5m
components/coreutils/patches/stdbuf.c.patch
--- a/components/coreutils/Makefile	Mon Apr 07 12:48:54 2014 -0700
+++ b/components/coreutils/Makefile	Fri Apr 11 15:51:35 2014 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 include ../../make-rules/shared-macros.mk
 
@@ -37,18 +37,19 @@
 include ../../make-rules/ips.mk
 
 CONFIGURE_PREFIX	 =	/usr/gnu
+CONFIGURE_OPTIONS	+=	--bindir=/usr/gnu/bin
 CONFIGURE_OPTIONS	+=	--libdir=/usr/lib
 CONFIGURE_OPTIONS	+=	--infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS	+=	CPPFLAGS=-I/usr/include/gmp
 CONFIGURE_OPTIONS	+=	CFLAGS="$(CFLAGS)"
 
-# To allow stdbuf to correctly find /usr/lib/libstdbuf.so
-COMPONENT_BUILD_ARGS += pkglibexecdir=/usr/lib
+# Enable ASLR for this component
+ASLR_MODE = $(ASLR_ENABLE)
 
 # common targets
-build:		$(BUILD_32)
+build:		$(BUILD_32_and_64)
 
-install:	$(INSTALL_32)
+install:	$(INSTALL_32_and_64)
 
 # Needed for "gmake test" to work successfully.
 # If SHELLOPTS is exported (as it is by the userland makefiles),
@@ -61,7 +62,10 @@
 # Get the binaries to test from the component proto area.
 COMPONENT_TEST_ENV +=   PATH=$(PROTOUSRSBINDIR):/usr/bin
 
-test:		install $(TEST_32)
+# There are two known test failures:
+# misc/stdbuf             - see CR #15941179
+# misc/timeout-parameters - see CR #17425658
+test:		install $(TEST_64)
 
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
 
--- a/components/coreutils/coreutils.p5m	Mon Apr 07 12:48:54 2014 -0700
+++ b/components/coreutils/coreutils.p5m	Fri Apr 11 15:51:35 2014 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
@@ -35,139 +35,6 @@
 set name=org.opensolaris.arc-caseid \
     value=PSARC/2010/170
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
-dir path=usr
-dir path=usr/bin
-dir path=usr/gnu
-dir path=usr/gnu/bin
-dir path=usr/gnu/share
-dir path=usr/gnu/share/locale
-dir path=usr/gnu/share/locale/af
-dir path=usr/gnu/share/locale/af/LC_MESSAGES
-dir path=usr/gnu/share/locale/af/LC_TIME
-dir path=usr/gnu/share/locale/be
-dir path=usr/gnu/share/locale/be/LC_MESSAGES
-dir path=usr/gnu/share/locale/be/LC_TIME
-dir path=usr/gnu/share/locale/bg
-dir path=usr/gnu/share/locale/bg/LC_MESSAGES
-dir path=usr/gnu/share/locale/bg/LC_TIME
-dir path=usr/gnu/share/locale/ca
-dir path=usr/gnu/share/locale/ca/LC_MESSAGES
-dir path=usr/gnu/share/locale/ca/LC_TIME
-dir path=usr/gnu/share/locale/cs
-dir path=usr/gnu/share/locale/cs/LC_MESSAGES
-dir path=usr/gnu/share/locale/cs/LC_TIME
-dir path=usr/gnu/share/locale/da
-dir path=usr/gnu/share/locale/da/LC_MESSAGES
-dir path=usr/gnu/share/locale/da/LC_TIME
-dir path=usr/gnu/share/locale/de
-dir path=usr/gnu/share/locale/de/LC_MESSAGES
-dir path=usr/gnu/share/locale/de/LC_TIME
-dir path=usr/gnu/share/locale/el
-dir path=usr/gnu/share/locale/el/LC_MESSAGES
-dir path=usr/gnu/share/locale/el/LC_TIME
-dir path=usr/gnu/share/locale/eo
-dir path=usr/gnu/share/locale/eo/LC_MESSAGES
-dir path=usr/gnu/share/locale/eo/LC_TIME
-dir path=usr/gnu/share/locale/es
-dir path=usr/gnu/share/locale/es/LC_MESSAGES
-dir path=usr/gnu/share/locale/es/LC_TIME
-dir path=usr/gnu/share/locale/et
-dir path=usr/gnu/share/locale/et/LC_MESSAGES
-dir path=usr/gnu/share/locale/et/LC_TIME
-dir path=usr/gnu/share/locale/eu
-dir path=usr/gnu/share/locale/eu/LC_MESSAGES
-dir path=usr/gnu/share/locale/eu/LC_TIME
-dir path=usr/gnu/share/locale/fi
-dir path=usr/gnu/share/locale/fi/LC_MESSAGES
-dir path=usr/gnu/share/locale/fi/LC_TIME
-dir path=usr/gnu/share/locale/fr
-dir path=usr/gnu/share/locale/fr/LC_MESSAGES
-dir path=usr/gnu/share/locale/fr/LC_TIME
-dir path=usr/gnu/share/locale/ga
-dir path=usr/gnu/share/locale/ga/LC_MESSAGES
-dir path=usr/gnu/share/locale/ga/LC_TIME
-dir path=usr/gnu/share/locale/gl
-dir path=usr/gnu/share/locale/gl/LC_MESSAGES
-dir path=usr/gnu/share/locale/gl/LC_TIME
-dir path=usr/gnu/share/locale/hu
-dir path=usr/gnu/share/locale/hu/LC_MESSAGES
-dir path=usr/gnu/share/locale/hu/LC_TIME
-dir path=usr/gnu/share/locale/id
-dir path=usr/gnu/share/locale/id/LC_MESSAGES
-dir path=usr/gnu/share/locale/id/LC_TIME
-dir path=usr/gnu/share/locale/it
-dir path=usr/gnu/share/locale/it/LC_MESSAGES
-dir path=usr/gnu/share/locale/it/LC_TIME
-dir path=usr/gnu/share/locale/ja
-dir path=usr/gnu/share/locale/ja/LC_MESSAGES
-dir path=usr/gnu/share/locale/ja/LC_TIME
-dir path=usr/gnu/share/locale/kk
-dir path=usr/gnu/share/locale/kk/LC_MESSAGES
-dir path=usr/gnu/share/locale/kk/LC_TIME
-dir path=usr/gnu/share/locale/ko
-dir path=usr/gnu/share/locale/ko/LC_MESSAGES
-dir path=usr/gnu/share/locale/ko/LC_TIME
-dir path=usr/gnu/share/locale/lg
-dir path=usr/gnu/share/locale/lg/LC_MESSAGES
-dir path=usr/gnu/share/locale/lg/LC_TIME
-dir path=usr/gnu/share/locale/lt
-dir path=usr/gnu/share/locale/lt/LC_MESSAGES
-dir path=usr/gnu/share/locale/lt/LC_TIME
-dir path=usr/gnu/share/locale/ms
-dir path=usr/gnu/share/locale/ms/LC_MESSAGES
-dir path=usr/gnu/share/locale/ms/LC_TIME
-dir path=usr/gnu/share/locale/nb
-dir path=usr/gnu/share/locale/nb/LC_MESSAGES
-dir path=usr/gnu/share/locale/nb/LC_TIME
-dir path=usr/gnu/share/locale/nl
-dir path=usr/gnu/share/locale/nl/LC_MESSAGES
-dir path=usr/gnu/share/locale/nl/LC_TIME
-dir path=usr/gnu/share/locale/pl
-dir path=usr/gnu/share/locale/pl/LC_MESSAGES
-dir path=usr/gnu/share/locale/pl/LC_TIME
-dir path=usr/gnu/share/locale/pt
-dir path=usr/gnu/share/locale/pt/LC_MESSAGES
-dir path=usr/gnu/share/locale/pt/LC_TIME
-dir path=usr/gnu/share/locale/pt_BR
-dir path=usr/gnu/share/locale/pt_BR/LC_MESSAGES
-dir path=usr/gnu/share/locale/pt_BR/LC_TIME
-dir path=usr/gnu/share/locale/ro
-dir path=usr/gnu/share/locale/ro/LC_MESSAGES
-dir path=usr/gnu/share/locale/ro/LC_TIME
-dir path=usr/gnu/share/locale/ru
-dir path=usr/gnu/share/locale/ru/LC_MESSAGES
-dir path=usr/gnu/share/locale/ru/LC_TIME
-dir path=usr/gnu/share/locale/sk
-dir path=usr/gnu/share/locale/sk/LC_MESSAGES
-dir path=usr/gnu/share/locale/sk/LC_TIME
-dir path=usr/gnu/share/locale/sl
-dir path=usr/gnu/share/locale/sl/LC_MESSAGES
-dir path=usr/gnu/share/locale/sl/LC_TIME
-dir path=usr/gnu/share/locale/sv
-dir path=usr/gnu/share/locale/sv/LC_MESSAGES
-dir path=usr/gnu/share/locale/sv/LC_TIME
-dir path=usr/gnu/share/locale/tr
-dir path=usr/gnu/share/locale/tr/LC_MESSAGES
-dir path=usr/gnu/share/locale/tr/LC_TIME
-dir path=usr/gnu/share/locale/uk
-dir path=usr/gnu/share/locale/uk/LC_MESSAGES
-dir path=usr/gnu/share/locale/uk/LC_TIME
-dir path=usr/gnu/share/locale/vi
-dir path=usr/gnu/share/locale/vi/LC_MESSAGES
-dir path=usr/gnu/share/locale/vi/LC_TIME
-dir path=usr/gnu/share/locale/zh_CN
-dir path=usr/gnu/share/locale/zh_CN/LC_MESSAGES
-dir path=usr/gnu/share/locale/zh_CN/LC_TIME
-dir path=usr/gnu/share/locale/zh_TW
-dir path=usr/gnu/share/locale/zh_TW/LC_MESSAGES
-dir path=usr/gnu/share/locale/zh_TW/LC_TIME
-dir path=usr/gnu/share/man
-dir path=usr/gnu/share/man/man1
-dir path=usr/lib
-dir path=usr/share
-dir path=usr/share/info
-dir path=usr/share/man
-dir path=usr/share/man/man1
 file usr/gnu/bin/base64 path=usr/bin/base64
 file usr/gnu/bin/dir path=usr/bin/dir
 file usr/gnu/bin/dircolors path=usr/bin/dircolors
@@ -381,7 +248,8 @@
 file path=usr/gnu/share/man/man1/wc.1
 file path=usr/gnu/share/man/man1/who.1
 file path=usr/gnu/share/man/man1/yes.1
-file usr/gnu/libexec/coreutils/libstdbuf.so path=usr/lib/libstdbuf.so
+file $(MACH32)/src/libstdbuf.so path=usr/lib/libstdbuf.so
+file $(MACH64)/src/libstdbuf.so path=usr/lib/$(MACH64)/libstdbuf.so
 file path=usr/share/info/coreutils.info
 file usr/gnu/share/man/man1/base64.1 path=usr/share/man/man1/base64.1
 file usr/gnu/share/man/man1/dir.1 path=usr/share/man/man1/dir.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/coreutils/patches/stdbuf.c.patch	Fri Apr 11 15:51:35 2014 -0700
@@ -0,0 +1,50 @@
+Changes needed to get stdbuf to successfully preload libstdbuf.so
+for both 32-bit and 64-bit applications. See comment in the patch
+for more details.
+
+--- coreutils-8.16/src/stdbuf.c.orig	2013-09-04 19:05:35.225857588 -0700
++++ coreutils-8.16/src/stdbuf.c	2013-09-04 19:11:51.945113130 -0700
[email protected]@ -195,37 +195,13 @@
+      gcc stdbuf.c -Wl,-rpath,'$ORIGIN' -Wl,-rpath,$PKGLIBEXECDIR
+      However we want the lookup done for the exec'd command not stdbuf.
+ 
+-     Since we don't link against libstdbuf.so add it to PKGLIBEXECDIR
+-     rather than to LIBDIR.  */
+-  char const *const search_path[] = {
+-    program_path,
+-    PKGLIBEXECDIR,
+-    NULL
+-  };
++     Since we don't link against libstdbuf.so, we need to LD_PRELOAD it.
++     As libstdbuf.so lives in /usr/lib and /usr/lib/64, we just use
++     LD_PRELOAD=libstdbuf.so, and ld.so.1 finds the right one associated
++     with the process class. ie. we don't use full path names for the
++     preload names.  */
+ 
+-  char const *const *path = search_path;
+-  char *libstdbuf;
+-
+-  while (true)
+-    {
+-      struct stat sb;
+-
+-      if (!**path)              /* system default  */
+-        {
+-          libstdbuf = xstrdup (LIB_NAME);
+-          break;
+-        }
+-      ret = asprintf (&libstdbuf, "%s/%s", *path, LIB_NAME);
+-      if (ret < 0)
+-        xalloc_die ();
+-      if (stat (libstdbuf, &sb) == 0)   /* file_exists  */
+-        break;
+-      free (libstdbuf);
+-
+-      ++path;
+-      if ( ! *path)
+-        error (EXIT_CANCELED, 0, _("failed to find %s"), quote (LIB_NAME));
+-    }
++  char *libstdbuf = xstrdup (LIB_NAME);
+ 
+   /* FIXME: Do we need to support libstdbuf.dll, c:, '\' separators etc?  */
+