[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#334120: Patch to include more files from the build tree in libc6-pic: allows Plash to build custom glibc

Package: glibc
Version: 2.3.5-6
Severity: wishlist
Tags: patch

This patch changes rules.d/debhelper.mk to copy various files from the
glibc build tree into the libc6-pic package.

This allows Plash to build its modified version of glibc from

Background: Plash is a secure, restricted execution environment that
provides functionality similar to chroot(), but more flexible and
lightweight.  It works partly by dynamically linking Linux executables
with a modified glibc.  This is not used for taking authority away
from a process, only for giving it back.  This approach is more
complete than using LD_PRELOADed libraries.  There's more information
on what Plash does at <http://plash.beasts.org>.

Once this patch is applied it should be possible to put Plash into

I'm filing a second BTS entry for a patch to glibc itself for
preventing some system calls from being inlined, which Plash also

diff -ur glibc-2.3.5.orig/debian/rules.d/debhelper.mk glibc-2.3.5.orig/debian/rules.d/debhelper.mk
--- glibc-2.3.5.orig/debian/rules.d/debhelper.mk	Thu Sep 29 14:45:25 2005
+++ glibc-2.3.5.orig/debian/rules.d/debhelper.mk	Thu Sep 29 16:44:04 2005
@@ -2,6 +2,25 @@
 # renames.  There's very little we can do for now.  Maybe after
 # Sarge releases we can consider breaking packages, but certainly not now.
+# This is a list of files needed for building Plash's version of ld.so.
+# They are not built in the normal course of glibc's build process
+# because they are not normally linked into ld.so.
+	socket/rtld-recvmsg.os \
+        socket/rtld-sendmsg.os \
+        socket/rtld-send.os \
+        socket/rtld-cmsg_nxthdr.os \
+        io/rtld-fstat.os \
+	io/rtld-fxstat.os \
+        io/rtld-xstat64.os \
+	io/rtld-xstatconv.os \
+        io/rtld-dup.os \
+        stdlib/rtld-getenv.os \
+        string/rtld-strncmp.os \
+	string/rtld-strcpy.os
 $(stamp)binaryinst_$(libc)-pic:: $(stamp)debhelper
 	@echo Running special kludge for $(libc)-pic
@@ -10,6 +29,21 @@
 	install --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/libc.map debian/$(libc)-pic/usr/lib/libc_pic.map
 	install --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/elf/soinit.os debian/$(libc)-pic/usr/lib/libc_pic/soinit.o
 	install --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/elf/sofini.os debian/$(libc)-pic/usr/lib/libc_pic/sofini.o
+	for FILE in $(PLASH_RTLD_EXTRA_OBJS); do \
+	  $(MAKE) -C $(DEB_SRCDIR)/`dirname $$FILE` objdir=`pwd`/build-tree/$(DEB_HOST_ARCH)-libc -f Makefile -f ../elf/rtld-Rules rtld-all rtld-modules=`basename $$FILE`; \
+	done
+	# NB. Installs elf/so{init,fini}.os a second time, but this
+	# time under their full filename.
+	set -e; \
+        for F in `cat debian/plash-export-list`; do \
+	  install -D --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/$$F debian/$(libc)-pic/usr/lib/libc_pic/$$F; \
+	  strip --strip-debug debian/$(libc)-pic/usr/lib/libc_pic/$$F; \
+	done; \
+	for F in `cat debian/plash-export-list-nonobj`; do \
+	  install -D --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/$$F debian/$(libc)-pic/usr/lib/libc_pic/$$F; \
+	done
 	install --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/math/libm_pic.a debian/$(libc)-pic/usr/lib/.
 	install --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/libm.map debian/$(libc)-pic/usr/lib/libm_pic.map
diff -urN glibc-2.3.5.orig/debian/plash-export-list glibc-2.3.5.orig/debian/plash-export-list
--- glibc-2.3.5.orig/debian/plash-export-list	Wed Dec 31 19:00:00 1969
+++ glibc-2.3.5.orig/debian/plash-export-list	Thu Sep 29 16:49:18 2005
@@ -0,0 +1,71 @@
diff -urN glibc-2.3.5.orig/debian/plash-export-list-nonobj glibc-2.3.5.orig/debian/plash-export-list-nonobj
--- glibc-2.3.5.orig/debian/plash-export-list-nonobj	Wed Dec 31 19:00:00 1969
+++ glibc-2.3.5.orig/debian/plash-export-list-nonobj	Thu Sep 29 16:49:18 2005
@@ -0,0 +1,3 @@

Reply to: