diff options
author | 2013-05-15 22:51:23 +0000 | |
---|---|---|
committer | 2013-05-15 22:51:23 +0000 | |
commit | e22470f3ce6323e2285bbf8ec378876a63508018 (patch) | |
tree | b185d1f5e03b874efcd5059b1f3ed8ea9f4def6c /sys-apps/rng-tools | |
parent | whitespace (diff) | |
download | gentoo-2-e22470f3ce6323e2285bbf8ec378876a63508018.tar.gz gentoo-2-e22470f3ce6323e2285bbf8ec378876a63508018.tar.bz2 gentoo-2-e22470f3ce6323e2285bbf8ec378876a63508018.zip |
Fix assemby textrels on rdrand_asm.S on PIC x86, bug #469962
(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)
Diffstat (limited to 'sys-apps/rng-tools')
-rw-r--r-- | sys-apps/rng-tools/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch | 71 | ||||
-rw-r--r-- | sys-apps/rng-tools/rng-tools-4-r6.ebuild | 32 |
3 files changed, 110 insertions, 1 deletions
diff --git a/sys-apps/rng-tools/ChangeLog b/sys-apps/rng-tools/ChangeLog index a29f8714a7aa..a651000cd002 100644 --- a/sys-apps/rng-tools/ChangeLog +++ b/sys-apps/rng-tools/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/rng-tools # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/ChangeLog,v 1.45 2013/05/14 09:39:04 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/ChangeLog,v 1.46 2013/05/15 22:51:23 blueness Exp $ + +*rng-tools-4-r6 (15 May 2013) + + 15 May 2013; Anthony G. Basile <blueness@gentoo.org> + +files/fix-textrels-on-PIC-x86.patch, +rng-tools-4-r6.ebuild: + Fix assemby textrels on rdrand_asm.S on PIC x86, bug #469962 14 May 2013; Agostino Sarubbo <ago@gentoo.org> rng-tools-4-r5.ebuild: Stable for x86, wrt bug #458826 diff --git a/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch b/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch new file mode 100644 index 000000000000..5ff34da861b4 --- /dev/null +++ b/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch @@ -0,0 +1,71 @@ +From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> +Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86 + +This patch fixes the assembly in rdrand_asm.S so it won't generate textrels on PIC systems. +The main fixes are in the use of leal in SETPTR for such systems, the rest is the usual PIC +support stuff. + +This should fix Gentoo bug #469962 + +This patch is released under the GPLv2 or a higher version license as is the original file +as long as reference to the author and the tester are included in the final code. + +Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=469962 +Upstream-status: Not sent yet +Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> +Reported-by: cilly <cilly@cilly.mine.nu> +Tested-by: Anthony Basile <blueness@gentoo.org> + +--- rng-tools/rdrand_asm.S ++++ rng-tools/rdrand_asm.S +@@ -49,6 +49,7 @@ + ret + ENDPROC(x86_rdrand_nlong) + ++#define INIT_PIC() + #define SETPTR(var,ptr) leaq var(%rip),ptr + #define PTR0 %rdi + #define PTR1 %rsi +@@ -84,7 +85,16 @@ + ret + ENDPROC(x86_rdrand_nlong) + ++#if defined(__PIC__) ++#undef __i686 /* gcc builtin define gets in our way */ ++#define INIT_PIC() \ ++ call __i686.get_pc_thunk.bx ; \ ++ addl $_GLOBAL_OFFSET_TABLE_, %ebx ++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr ++#else ++#define INIT_PIC() + #define SETPTR(var,ptr) movl $(var),ptr ++#endif + #define PTR0 %eax + #define PTR1 %edx + #define PTR2 %ecx +@@ -101,6 +111,7 @@ + movl 8(%ebp), %eax + movl 12(%ebp), %edx + #endif ++ INIT_PIC() + + SETPTR(aes_round_keys, PTR2) + +@@ -166,6 +177,17 @@ + #endif + ret + ENDPROC(x86_aes_mangle) ++ ++#if defined(__i386__) && defined(__PIC__) ++ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits ++.globl __i686.get_pc_thunk.bx ++ .hidden __i686.get_pc_thunk.bx ++ .type __i686.get_pc_thunk.bx,@function ++__i686.get_pc_thunk.bx: ++ movl (%esp), %ebx ++ ret ++#endif ++ + /* + * AES round keys for an arbitrary key: + * 00102030405060708090A0B0C0D0E0F0 diff --git a/sys-apps/rng-tools/rng-tools-4-r6.ebuild b/sys-apps/rng-tools/rng-tools-4-r6.ebuild new file mode 100644 index 000000000000..47a0d696147d --- /dev/null +++ b/sys-apps/rng-tools/rng-tools-4-r6.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/rng-tools-4-r6.ebuild,v 1.1 2013/05/15 22:51:23 blueness Exp $ + +EAPI="4" + +inherit eutils autotools toolchain-funcs + +DESCRIPTION="Daemon to use hardware random number generators" +HOMEPAGE="http://gkernel.sourceforge.net/" +SRC_URI="mirror://sourceforge/gkernel/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86" +IUSE="" + +src_prepare() { + echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am + epatch "${FILESDIR}"/test-for-argp.patch + epatch "${FILESDIR}"/fix-textrels-on-PIC-x86.patch + eautoreconf + + sed -i '/^AR /d' Makefile.in + tc-export AR +} + +src_install() { + default + newinitd "${FILESDIR}"/rngd-initd-4.1 rngd + newconfd "${FILESDIR}"/rngd-confd-4.1 rngd +} |