components/coreutils/patches/chroot-libthread.patch
author Rich Burridge <rich.burridge@oracle.com>
Fri, 16 May 2014 10:43:57 -0700
changeset 1900 e587944ed7de
parent 1898 5c902a3c6e7e
child 2050 7c6a1559c620
permissions -rw-r--r--
18744156 /usr/gnu/bin/chroot is killed when executed with an invalid command argument (adjust approach)

These changes have not been passed upstream. It's really a Studio compiler
bug CR #18752073.

--- coreutils-8.16/src/Makefile.am.orig	2014-05-15 10:13:19.739717905 -0700
+++ coreutils-8.16/src/Makefile.am	2014-05-16 10:39:39.250671691 -0700
@@ -178,6 +178,15 @@
 # Tell the linker to omit references to unused shared libraries.
 AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
 
+# for chroot to work correctly for root (CR #18744156)
+# add '-z now' to disable lazy loading since we need to bring in
+# dependencies before we chroot(2) to an environment that may not
+# be able to satisfy them.
+chroot_LDFLAGS =  -z now
+# add '-mt=no' so that we don't end up with an unnecessary dependency on
+# libthread.so.
+chroot_LDFLAGS +=  -mt=no
+
 # Sometimes, the expansion of $(LIBINTL) includes -lc which may
 # include modules defining variables like 'optind', so libcoreutils.a
 # must precede $(LIBINTL) in order to ensure we use GNU getopt.