summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2010-01-10 23:04:53 +0000
committerAlexis Ballier <aballier@gentoo.org>2010-01-10 23:04:53 +0000
commitcc0eb8b4b106963d84eb421f672ad5a90eebc916 (patch)
tree3abf4263c2b794d29983bd07417c46218a83eb8e /sys-freebsd/freebsd-libexec
parentwhitespace (diff)
downloadhistorical-cc0eb8b4b106963d84eb421f672ad5a90eebc916.tar.gz
historical-cc0eb8b4b106963d84eb421f672ad5a90eebc916.tar.bz2
historical-cc0eb8b4b106963d84eb421f672ad5a90eebc916.zip
backport RTLD_NOLOAD support from 8.0; code part
Package-Manager: portage-2.2_rc61/cvs/Linux x86_64
Diffstat (limited to 'sys-freebsd/freebsd-libexec')
-rw-r--r--sys-freebsd/freebsd-libexec/ChangeLog9
-rw-r--r--sys-freebsd/freebsd-libexec/files/freebsd-libexec-7.2-rtldnoload.patch75
-rw-r--r--sys-freebsd/freebsd-libexec/freebsd-libexec-7.2-r2.ebuild78
3 files changed, 161 insertions, 1 deletions
diff --git a/sys-freebsd/freebsd-libexec/ChangeLog b/sys-freebsd/freebsd-libexec/ChangeLog
index 9a3d3fff7465..31846bd69cf4 100644
--- a/sys-freebsd/freebsd-libexec/ChangeLog
+++ b/sys-freebsd/freebsd-libexec/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-freebsd/freebsd-libexec
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-libexec/ChangeLog,v 1.35 2010/01/09 16:38:20 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-libexec/ChangeLog,v 1.36 2010/01/10 23:04:53 aballier Exp $
+
+*freebsd-libexec-7.2-r2 (10 Jan 2010)
+
+ 10 Jan 2010; Alexis Ballier <aballier@gentoo.org>
+ +freebsd-libexec-7.2-r2.ebuild,
+ +files/freebsd-libexec-7.2-rtldnoload.patch:
+ backport RTLD_NOLOAD support from 8.0; code part
09 Jan 2010; Alexis Ballier <aballier@gentoo.org>
freebsd-libexec-7.2-r1.ebuild, +files/freebsd-libexec-7.2-pic.patch:
diff --git a/sys-freebsd/freebsd-libexec/files/freebsd-libexec-7.2-rtldnoload.patch b/sys-freebsd/freebsd-libexec/files/freebsd-libexec-7.2-rtldnoload.patch
new file mode 100644
index 000000000000..2e45736e3883
--- /dev/null
+++ b/sys-freebsd/freebsd-libexec/files/freebsd-libexec-7.2-rtldnoload.patch
@@ -0,0 +1,75 @@
+Backported from 8.0.
+Even if RTLD_NOLOAD is not standard, dev-libs/nss expects it.
+Since it has made it to 8.0 we can afford backporting it.
+
+--- libexec/rtld-elf/rtld.c.old 2010-01-10 18:19:50 +0100
++++ libexec/rtld-elf/rtld.c 2010-01-10 18:30:03 +0100
+@@ -104,7 +104,7 @@
+ static void linkmap_delete(Obj_Entry *);
+ static int load_needed_objects(Obj_Entry *);
+ static int load_preload_objects(void);
+-static Obj_Entry *load_object(const char *, const Obj_Entry *);
++static Obj_Entry *load_object(const char *, const Obj_Entry *, int);
+ static Obj_Entry *obj_from_addr(const void *);
+ static void objlist_call_fini(Objlist *, int *lockstate);
+ static void objlist_call_init(Objlist *, int *lockstate);
+@@ -1384,7 +1384,7 @@
+
+ while(*curpath) {
+ if (needed->obj == NULL) {
+- needed->obj = load_object(*curpath, NULL);
++ needed->obj = load_object(*curpath, NULL, false);
+ curpath++;
+ continue;
+ }
+@@ -1417,7 +1417,7 @@
+
+ savech = p[len];
+ p[len] = '\0';
+- if (load_object(p, NULL) == NULL)
++ if (load_object(p, NULL, false) == NULL)
+ return -1; /* XXX - cleanup */
+ p[len] = savech;
+ p += len;
+@@ -1434,7 +1434,7 @@
+ * on failure.
+ */
+ static Obj_Entry *
+-load_object(const char *name, const Obj_Entry *refobj)
++load_object(const char *name, const Obj_Entry *refobj, int noload)
+ {
+ Obj_Entry *obj;
+ int fd = -1;
+@@ -1480,6 +1480,8 @@
+ close(fd);
+ return obj;
+ }
++ if (noload)
++ return (NULL);
+
+ /* First use of this object, so we must map it in */
+ obj = do_load_object(fd, name, path, &sb);
+@@ -1940,12 +1942,13 @@
+ Obj_Entry **old_obj_tail;
+ Obj_Entry *obj;
+ Objlist initlist;
+- int result, lockstate;
++ int result, lockstate, noload;
+
+ LD_UTRACE(UTRACE_DLOPEN_START, NULL, NULL, 0, mode, name);
+ ld_tracing = (mode & RTLD_TRACE) == 0 ? NULL : "1";
+ if (ld_tracing != NULL)
+ environ = (char **)*get_program_var_addr("environ");
++ noload = mode & RTLD_NOLOAD;
+
+ objlist_init(&initlist);
+
+@@ -1958,7 +1961,7 @@
+ obj = obj_main;
+ obj->refcount++;
+ } else {
+- obj = load_object(name, obj_main);
++ obj = load_object(name, obj_main, noload);
+ }
+
+ if (obj) {
diff --git a/sys-freebsd/freebsd-libexec/freebsd-libexec-7.2-r2.ebuild b/sys-freebsd/freebsd-libexec/freebsd-libexec-7.2-r2.ebuild
new file mode 100644
index 000000000000..aa95adaba208
--- /dev/null
+++ b/sys-freebsd/freebsd-libexec/freebsd-libexec-7.2-r2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-libexec/freebsd-libexec-7.2-r2.ebuild,v 1.1 2010/01/10 23:04:53 aballier Exp $
+
+EAPI=2
+
+inherit bsdmk freebsd pam
+
+DESCRIPTION="FreeBSD libexec things"
+SLOT="0"
+KEYWORDS="~sparc-fbsd ~x86-fbsd"
+
+SRC_URI="mirror://gentoo/${LIBEXEC}.tar.bz2
+ mirror://gentoo/${UBIN}.tar.bz2
+ mirror://gentoo/${BIN}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${LIB}.tar.bz2
+ mirror://gentoo/${ETC}.tar.bz2
+ mirror://gentoo/${USBIN}.tar.bz2"
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*
+ >=sys-freebsd/freebsd-lib-7.2-r1
+ pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ =sys-freebsd/freebsd-sources-${RV}*"
+RDEPEND="${RDEPEND}
+ xinetd? ( sys-apps/xinetd )"
+
+S="${WORKDIR}/libexec"
+
+PATCHES=( "${FILESDIR}/${PN}-setXid.patch"
+ "${FILESDIR}/${PN}-nossp.patch"
+ "${FILESDIR}/${PN}-7.0-libfallback.patch"
+ "${FILESDIR}/${P}-rtld7.patch"
+ "${FILESDIR}/${P}-pic.patch"
+ "${FILESDIR}/${P}-rtldnoload.patch" )
+
+# Remove sendmail, tcp_wrapper and other useless stuff
+REMOVE_SUBDIRS="smrsh mail.local tcpd telnetd rshd rlogind lukemftpd ftpd"
+
+IUSE="pam ssl kerberos ipv6 nis xinetd"
+
+pkg_setup() {
+ use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6= WITHOUT_INET6_SUPPORT= "
+ use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= "
+ use nis || mymakeopts="${mymakeopts} WITHOUT_NIS= "
+ use pam || mymakeopts="${mymakeopts} WITHOUT_PAM_SUPPORT= "
+ use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
+
+ mymakeopts="${mymakeopts} WITHOUT_SENDMAIL= WITHOUT_PF= WITHOUT_RCMDS= "
+}
+
+src_prepare() {
+ ln -s /usr/include "${WORKDIR}/include"
+}
+
+src_compile() {
+ NOSSP_FLAGS="$(test-flags -fno-stack-protector -fno-stack-protector-all)"
+ export NOSSP_FLAGS
+ freebsd_src_compile
+}
+
+src_install() {
+ freebsd_src_install
+
+ insinto /etc
+ doins "${WORKDIR}/etc/gettytab"
+ newinitd "${FILESDIR}/bootpd.initd" bootpd
+ newconfd "${FILESDIR}/bootpd.confd" bootpd
+
+ if use xinetd; then
+ for rpcd in rstatd rusersd walld rquotad sprayd; do
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}/${rpcd}.xinetd" ${rpcd}
+ done
+ fi
+}