diff options
author | Roy Marples <uberlord@gentoo.org> | 2007-09-12 00:04:35 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2007-09-12 00:04:35 +0000 |
commit | 8941693646224999f5103de00a30011e3556efab (patch) | |
tree | 1610a68c47d9ceb7473fa0ed1b173ce3dc2f5283 /sys-freebsd | |
parent | masked x11-wm/ion2 (diff) | |
download | gentoo-2-8941693646224999f5103de00a30011e3556efab.tar.gz gentoo-2-8941693646224999f5103de00a30011e3556efab.tar.bz2 gentoo-2-8941693646224999f5103de00a30011e3556efab.zip |
Backport dl_iterate_phdr from FreeBSD-7 so that future gcc's dont pull in libgcc_s.so.1
(Portage version: 2.1.3.7)
Diffstat (limited to 'sys-freebsd')
4 files changed, 159 insertions, 1 deletions
diff --git a/sys-freebsd/freebsd-sources/ChangeLog b/sys-freebsd/freebsd-sources/ChangeLog index d14201eb905a..8af8d97081b3 100644 --- a/sys-freebsd/freebsd-sources/ChangeLog +++ b/sys-freebsd/freebsd-sources/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-freebsd/freebsd-sources # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.38 2007/07/03 11:08:00 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.39 2007/09/12 00:04:35 uberlord Exp $ + +*freebsd-sources-6.2-r3 (12 Sep 2007) + + 12 Sep 2007; Roy Marples <uberlord@gentoo.org> + +files/freebsd-sources-6.2-dl_iterate_phdr.patch, + +freebsd-sources-6.2-r3.ebuild: + Backport dl_iterate_phdr from FreeBSD-7 so that future gcc's don't pull in + libgcc_s.so.1 *freebsd-sources-6.2-r2 (03 Jul 2007) diff --git a/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r3 b/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r3 new file mode 100644 index 000000000000..f15ec910fc83 --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r3 @@ -0,0 +1,3 @@ +MD5 79c16213744e76d3bf13a9ac21ede56d freebsd-sys-6.2.tar.bz2 18344936 +RMD160 784230e22ccaf09933ef3f053ff29cc3e579786a freebsd-sys-6.2.tar.bz2 18344936 +SHA256 a754371d88601aaab7152bb3d127bd3777db912e13a26a866e13ba34934c5e5b freebsd-sys-6.2.tar.bz2 18344936 diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-dl_iterate_phdr.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-dl_iterate_phdr.patch new file mode 100644 index 000000000000..791da2190a1d --- /dev/null +++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-dl_iterate_phdr.patch @@ -0,0 +1,55 @@ +Backport dl_iterate_phdr from FreeBSD-7 so that we can use gcc-4 +and not pull in libgcc_s.so.1 into every binary we build. + +--- sys/link_elf.h 2005/01/07 02:29:23 1.26 ++++ sys/link_elf.h 2007/04/03 18:33:41 1.27 +@@ -41,7 +41,7 @@ + #ifndef _SYS_LINK_ELF_H_ + #define _SYS_LINK_ELF_H_ + +-#include <sys/types.h> ++#include <sys/elf.h> + + /* + * Flags that describe the origin of the entries in Dl_serinfo. +@@ -75,5 +75,28 @@ struct r_debug { + RT_DELETE /* removing a shared library */ + } r_state; + }; ++ ++/* Add a define so that libexec and lib can optionally use this */ ++#define _GENTOO_DL_ITERATE_PHDR ++ ++struct dl_phdr_info ++{ ++ Elf_Addr dlpi_addr; /* module relocation base */ ++ const char *dlpi_name; /* module name */ ++ const Elf_Phdr *dlpi_phdr; /* pointer to module's phdr */ ++ Elf_Half dlpi_phnum; /* number of entries in phdr */ ++ unsigned long long int dlpi_adds; /* total # of loads */ ++ unsigned long long int dlpi_subs; /* total # of unloads */ ++ size_t dlpi_tls_modid; ++ void *dlpi_tls_data; ++}; ++ ++__BEGIN_DECLS ++ ++typedef int (*__dl_iterate_hdr_callback)(struct dl_phdr_info *, size_t, ++ void *); ++extern int dl_iterate_phdr(__dl_iterate_hdr_callback, void *); ++ ++__END_DECLS + + #endif /* _SYS_LINK_ELF_H_ */ +--- sys/elf.h 2007-09-10 14:22:42 +0100 ++++ sys/elf.h 2007-09-10 14:25:12 +0100 +@@ -0,0 +1,9 @@ ++#ifndef _SYS_ELF_H_ ++#define _SYS_ELF_H_ ++ ++#include <sys/types.h> ++#include <machine/elf.h> ++#include <sys/elf32.h> ++#include <sys/elf64.h> ++ ++#endif /* !_SYS_ELF_H_ */ diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r3.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r3.ebuild new file mode 100644 index 000000000000..b0697f74fcfa --- /dev/null +++ b/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r3.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r3.ebuild,v 1.1 2007/09/12 00:04:35 uberlord Exp $ + +inherit bsdmk freebsd flag-o-matic + +DESCRIPTION="FreeBSD kernel sources" +SLOT="${PVR}" +KEYWORDS="~sparc-fbsd ~x86-fbsd" + +IUSE="symlink" + +SRC_URI="mirror://gentoo/${SYS}.tar.bz2" + +RDEPEND=">=sys-freebsd/freebsd-mk-defs-6.0-r1" +DEPEND="" + +RESTRICT="strip binchecks" + +S="${WORKDIR}/sys" + +MY_PVR="${PVR}" + +[[ ${MY_PVR} == "${RV}" ]] && MY_PVR="${MY_PVR}-r0" + +src_unpack() { + unpack ${A} + cd "${S}" + + # This replaces the gentoover patch, it doesn't need reapply every time. + sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \ + -e 's:^BRANCH=.*:BRANCH="Gentoo":' \ + -e 's:^VERSION=.*:VERSION="${TYPE} ${BRANCH} ${REVISION}":' \ + "${S}/conf/newvers.sh" + + epatch "${FILESDIR}/${PN}-gentoo.patch" + epatch "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" + epatch "${FILESDIR}/${PN}-6.0-asm.patch" + epatch "${FILESDIR}/${PN}-6.0-werror.patch" + epatch "${FILESDIR}/${PN}-6.2-gcc41.patch" + epatch "${FILESDIR}/${PN}-6.2-sparc64.patch" + epatch "${FILESDIR}/${PN}-6.1-ntfs.patch" + epatch "${FILESDIR}/${PN}-6.2-debug-O2.patch" + epatch "${FILESDIR}/${PN}-6.2-dl_iterate_phdr.patch" + + # Errata patches + epatch "${FILESDIR}/${P}-EN-07:02.net.patch" + epatch "${FILESDIR}/${P}-unp_gc.patch" + + # http://security.freebsd.org/advisories/FreeBSD-SA-07:03.ipv6.asc + epatch "${FILESDIR}/${P}-ipv6.patch" + + # Disable SSP for the kernel + grep -Zlr -- -ffreestanding "${S}" | xargs -0 sed -i -e \ + "s:-ffreestanding:-ffreestanding $(test-flags -fno-stack-protector -fno-stack-protector-all):g" +} + +src_compile() { + einfo "Nothing to compile.." +} + +src_install() { + insinto "/usr/src/sys-${MY_PVR}" + doins -r "${S}/"* +} + +pkg_postinst() { + if [[ ! -L "${ROOT}/usr/src/sys" ]]; then + einfo "/usr/src/sys symlink doesn't exist; creating symlink to sys-${MY_PVR}..." + ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys symlink." + # just in case... + [[ -L ""${ROOT}/usr/src/sys-${RV}"" ]] && rm "${ROOT}/usr/src/sys-${RV}" + ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink." + elif use symlink; then + einfo "Updating /usr/src/sys symlink to sys-${MY_PVR}..." + rm "${ROOT}/usr/src/sys" "${ROOT}/usr/src/sys-${RV}" || \ + eerror "Couldn't remove previous symlinks, please fix manually." + ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys symlink." + ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \ + eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink." + fi + + if use sparc-fbsd ; then + ewarn "WARNING: kldload currently causes kernel panics" + ewarn "on sparc64. This is probably a gcc-4.1 issue, but" + ewarn "we need gcc-4.1 to compile the kernel correctly :/" + ewarn "Please compile all modules you need into the kernel" + fi +} |