parent
a2f65af846
commit
f28e165d86
@ -1,25 +0,0 @@
|
||||
# Copyright 1999-2009 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-arch/tarsync/tarsync-0.2.1.ebuild,v 1.6 2009/10/12 16:50:07 halcy0n Exp $
|
||||
|
||||
DESCRIPTION="Delta compression suite for using/generating binary patches"
|
||||
HOMEPAGE="http://gentooexperimental.org/~ferringb/tarsync/"
|
||||
SRC_URI="mirror://gentoo/${P}.tar.bz2"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
KEYWORDS="~hppa ppc x86 ~amd64"
|
||||
IUSE=""
|
||||
|
||||
S="${WORKDIR}/${PN}"
|
||||
|
||||
DEPEND=">=dev-util/diffball-0.7"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
src_compile() {
|
||||
emake || die "emake failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
make DESTDIR="${D}" install || die "failed installing"
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
diff -r a2912073be85 lisp/paragraphs.el
|
||||
--- a/lisp/paragraphs.el Wed Jun 19 09:30:30 2013 -0600
|
||||
+++ b/lisp/paragraphs.el Sat Jun 22 13:27:48 2013 +0200
|
||||
@@ -180,7 +180,10 @@
|
||||
:type '(choice regexp (const :tag "Use default value" nil)))
|
||||
(put 'sentence-end 'safe-local-variable 'string-or-null-p)
|
||||
|
||||
-(defcustom sentence-end-base "[.?!][]\"'”)}]*"
|
||||
+(defcustom sentence-end-base
|
||||
+ (concat "[.?!][]\"'"
|
||||
+ (if (featurep 'mule) (string (unicode-to-char #x201D)) "")
|
||||
+ ")}]*")
|
||||
"Regexp matching the basic end of a sentence, not including following space."
|
||||
:group 'paragraphs
|
||||
:type 'string
|
||||
@@ -201,14 +204,14 @@
|
||||
in between. See Info node `(elisp)Standard Regexps'."
|
||||
(or sentence-end
|
||||
;; We accept non-break space along with space.
|
||||
- (concat (if sentence-end-without-period "\\w[ \u00a0][ \u00a0]\\|")
|
||||
+ (concat (if sentence-end-without-period "\\w[ \240][ \240]\\|")
|
||||
"\\("
|
||||
sentence-end-base
|
||||
(if sentence-end-double-space
|
||||
- "\\($\\|[ \u00a0]$\\|\t\\|[ \u00a0][ \u00a0]\\)" "\\($\\|[\t \u00a0]\\)")
|
||||
+ "\\($\\|[ \240]$\\|\t\\|[ \240][ \240]\\)" "\\($\\|[\t \240]\\)")
|
||||
"\\|[" sentence-end-without-space "]+"
|
||||
"\\)"
|
||||
- "[ \u00a0\t\n]*")))
|
||||
+ "[ \240\t\n]*")))
|
||||
|
||||
(defcustom page-delimiter "^\014"
|
||||
"*Regexp describing line-beginnings that separate pages."
|
@ -1,4 +1 @@
|
||||
DIST q4wine-0.121.tar.bz2 665208 SHA256 fc5a1a8c09d133a17a997a2b020ad03eaf06c81357863d9f69fd7206d86e3edc SHA512 2086b45a6ecc110b365b63317d6f3b0dd7c87fce548907167fd4ddb6ebffdaf01b3c86df6b54eb977cebb309e80e8786fdfd85c16ab98dcb3f829af74cf26132 WHIRLPOOL dbd47f6d5687500f14ac82af1a8f7335c50f8895cab4b61b7e3597754756e0a39fa84c66b78bb06e45744b093e9cb4146da4d76cbf1d6266ff6676dd62d9416b
|
||||
DIST q4wine-1.0-r1.tar.bz2 858442 SHA256 a1020005ab4a71a0d11f37f65638dd8f97bd6f7b8d652f9b6042080046ba00a7 SHA512 bfb37c3bddf5cb6dacb08f71a2c278e977dc6b7bd0b8db1665be27316dc69a185282f9f4aa595eedc77df1ce9bdf386db8fa4b50ff43bc2276413216ea198c1d WHIRLPOOL 7b5ccc0e2cd52a6761517d09f05315a3cd865095de67cc81cde58937b5d0d81dfe5d0497a8c1029bade60322fab5b2c73a63ab75c421472f2b45fca7765fa1bc
|
||||
DIST q4wine-1.0-r2.tar.bz2 876411 SHA256 c92a5e0f7ce8b6dd5d4d4f6f0ed38ad14ad93652387f513f0769ff6c7bc0be0e SHA512 1be57465c1d96c8250ab3a0ae74df822d6ec4d53e1eb5bf0666ae2340511718052e7471a94fe5bab0bf07e105c86c2064cf7799ece2d530a7ede8e3d8564e458 WHIRLPOOL 063641823f5449c8b22bd7dfc54dd1cc761ac98a36c2d076be231bd5c657ef01684ee662146e4d4d4f3aab77c367ebcff356f8fc221ce07c449bfc8a675499a4
|
||||
DIST q4wine-1.0-r3.tar.bz2 889308 SHA256 9f1319dd0baff3834a3938e0a048c1529cb9ea521158370176b706fce0d4d2ff SHA512 df10a2fbf6874f4c4e02dd9c43031453a46c76f03d83321f2d6e9544d0540dd07da1bc9246767c5c91ce17d67d5d236227294efaed9de09f3d5a18afbd60b224 WHIRLPOOL 51b5b4cfc157da6b99154269ef4ef9f38ff91f861864158b789352505af485d8b523a21c6d4b59544804ed3c15cb1c6c756db3f3203c8e3ba55c8396c3630df3
|
||||
|
@ -1,44 +0,0 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/q4wine/q4wine-0.121.ebuild,v 1.4 2013/03/02 19:25:09 hwoarang Exp $
|
||||
|
||||
EAPI="2"
|
||||
inherit cmake-utils
|
||||
|
||||
DESCRIPTION="Qt4 GUI configuration tool for Wine"
|
||||
HOMEPAGE="http://q4wine.brezblock.org.ua/"
|
||||
SRC_URI="mirror://sourceforge/${PN}/${PF}.tar.bz2"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="debug +icoutils +wineappdb -dbus gnome kde"
|
||||
|
||||
DEPEND="dev-qt/qtgui:4
|
||||
dev-qt/qtsql:4[sqlite]
|
||||
dev-util/cmake"
|
||||
|
||||
RDEPEND="dev-qt/qtgui:4
|
||||
dev-qt/qtsql:4[sqlite]
|
||||
app-admin/sudo
|
||||
app-emulation/wine
|
||||
>=sys-apps/which-2.19
|
||||
icoutils? ( >=media-gfx/icoutils-0.26.0 )
|
||||
sys-fs/fuseiso
|
||||
kde? ( kde-base/kdesu )
|
||||
gnome? ( x11-libs/gksu )
|
||||
dbus? ( dev-qt/qtdbus:4 )"
|
||||
|
||||
DOCS="README AUTHORS ChangeLog"
|
||||
|
||||
S="${WORKDIR}/${PF}"
|
||||
|
||||
src_configure() {
|
||||
mycmakeargs="${mycmakeargs} \
|
||||
$(cmake-utils_use debug DEBUG) \
|
||||
$(cmake-utils_use_with icoutils ICOUTILS) \
|
||||
$(cmake-utils_use_with wineappdb WINEAPPDB) \
|
||||
$(cmake-utils_use_with dbus DBUS)"
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/q4wine/q4wine-1.0-r1.ebuild,v 1.2 2013/03/02 19:25:09 hwoarang Exp $
|
||||
|
||||
EAPI="4"
|
||||
LANGS="cs de en es he it ru uk pl pt"
|
||||
|
||||
inherit cmake-utils
|
||||
|
||||
DESCRIPTION="Qt4 GUI configuration tool for Wine"
|
||||
HOMEPAGE="http://q4wine.brezblock.org.ua/"
|
||||
SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}%20${PV}/${PF}.tar.bz2"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="debug +icoutils +wineappdb -dbus gnome kde"
|
||||
|
||||
for x in ${LANGS}; do
|
||||
IUSE+=" linguas_${x}"
|
||||
done
|
||||
|
||||
DEPEND="dev-qt/qtgui:4
|
||||
dev-qt/qtsql:4[sqlite]
|
||||
dev-util/cmake"
|
||||
|
||||
RDEPEND="dev-qt/qtgui:4
|
||||
dev-qt/qtsql:4[sqlite]
|
||||
app-admin/sudo
|
||||
app-emulation/wine
|
||||
>=sys-apps/which-2.19
|
||||
icoutils? ( >=media-gfx/icoutils-0.26.0 )
|
||||
sys-fs/fuseiso
|
||||
kde? ( kde-base/kdesu )
|
||||
gnome? ( x11-libs/gksu )
|
||||
dbus? ( dev-qt/qtdbus:4 )"
|
||||
|
||||
DOCS="README AUTHORS ChangeLog"
|
||||
|
||||
S="${WORKDIR}/${PF}"
|
||||
|
||||
src_configure() {
|
||||
mycmakeargs="${mycmakeargs} \
|
||||
$(cmake-utils_use debug DEBUG) \
|
||||
$(cmake-utils_use_with icoutils ICOUTILS) \
|
||||
$(cmake-utils_use_with wineappdb WINEAPPDB) \
|
||||
$(cmake-utils_use_with dbus DBUS)"
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
for x in ${LANGS}; do
|
||||
if ! has ${x} ${LINGUAS}; then
|
||||
find "${D}" -name "${PN}_${x}*.qm" -exec rm {} \;
|
||||
fi
|
||||
done
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/q4wine/q4wine-1.0-r2.ebuild,v 1.1 2013/03/03 15:33:48 hwoarang Exp $
|
||||
|
||||
EAPI="4"
|
||||
LANGS="cs de en es fa he it ru uk pl pt"
|
||||
|
||||
inherit cmake-utils
|
||||
|
||||
DESCRIPTION="Qt4 GUI configuration tool for Wine"
|
||||
HOMEPAGE="http://q4wine.brezblock.org.ua/"
|
||||
SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}%20${PV}/${PF}.tar.bz2"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="debug +icoutils +wineappdb -dbus gnome kde"
|
||||
|
||||
for x in ${LANGS}; do
|
||||
IUSE+=" linguas_${x}"
|
||||
done
|
||||
|
||||
DEPEND="dev-qt/qtgui:4
|
||||
dev-qt/qtsql:4[sqlite]
|
||||
dev-util/cmake"
|
||||
|
||||
RDEPEND="dev-qt/qtgui:4
|
||||
dev-qt/qtsql:4[sqlite]
|
||||
app-admin/sudo
|
||||
app-emulation/wine
|
||||
>=sys-apps/which-2.19
|
||||
icoutils? ( >=media-gfx/icoutils-0.26.0 )
|
||||
sys-fs/fuseiso
|
||||
kde? ( kde-base/kdesu )
|
||||
gnome? ( x11-libs/gksu )
|
||||
dbus? ( dev-qt/qtdbus:4 )"
|
||||
|
||||
DOCS="README AUTHORS ChangeLog"
|
||||
|
||||
S="${WORKDIR}/${PF}"
|
||||
|
||||
src_configure() {
|
||||
mycmakeargs="${mycmakeargs} \
|
||||
$(cmake-utils_use debug DEBUG) \
|
||||
$(cmake-utils_use_with icoutils ICOUTILS) \
|
||||
$(cmake-utils_use_with wineappdb WINEAPPDB) \
|
||||
$(cmake-utils_use_with dbus DBUS)"
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
for x in ${LANGS}; do
|
||||
if ! has ${x} ${LINGUAS}; then
|
||||
find "${D}" -name "${PN}_${x}*.qm" -exec rm {} \;
|
||||
fi
|
||||
done
|
||||
}
|
@ -1,788 +0,0 @@
|
||||
From cc8761371aac432318530c2ddfe2c8234bc0621f Mon Sep 17 00:00:00 2001
|
||||
From: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
Date: Fri, 14 Jun 2013 16:43:17 +0100
|
||||
Subject: [PATCH 11/23] libelf: check all pointer accesses
|
||||
|
||||
We change the ELF_PTRVAL and ELF_HANDLE types and associated macros:
|
||||
|
||||
* PTRVAL becomes a uintptr_t, for which we provide a typedef
|
||||
elf_ptrval. This means no arithmetic done on it can overflow so
|
||||
the compiler cannot do any malicious invalid pointer arithmetic
|
||||
"optimisations". It also means that any places where we
|
||||
dereference one of these pointers without using the appropriate
|
||||
macros or functions become a compilation error.
|
||||
|
||||
So we can be sure that we won't miss any memory accesses.
|
||||
|
||||
All the PTRVAL variables were previously void* or char*, so
|
||||
the actual address calculations are unchanged.
|
||||
|
||||
* ELF_HANDLE becomes a union, one half of which keeps the pointer
|
||||
value and the other half of which is just there to record the
|
||||
type.
|
||||
|
||||
The new type is not a pointer type so there can be no address
|
||||
calculations on it whose meaning would change. Every assignment or
|
||||
access has to go through one of our macros.
|
||||
|
||||
* The distinction between const and non-const pointers and char*s
|
||||
and void*s in libelf goes away. This was not important (and
|
||||
anyway libelf tended to cast away const in various places).
|
||||
|
||||
* The fields elf->image and elf->dest are renamed. That proves
|
||||
that we haven't missed any unchecked uses of these actual
|
||||
pointer values.
|
||||
|
||||
* The caller may fill in elf->caller_xdest_base and _size to
|
||||
specify another range of memory which is safe for libelf to
|
||||
access, besides the input and output images.
|
||||
|
||||
* When accesses fail due to being out of range, we mark the elf
|
||||
"broken". This will be checked and used for diagnostics in
|
||||
a following patch.
|
||||
|
||||
We do not check for write accesses to the input image. This is
|
||||
because libelf actually does this in a number of places. So we
|
||||
simply permit that.
|
||||
|
||||
* Each caller of libelf which used to set dest now sets
|
||||
dest_base and dest_size.
|
||||
|
||||
* In xc_dom_load_elf_symtab we provide a new actual-pointer
|
||||
value hdr_ptr which we get from mapping the guest's kernel
|
||||
area and use (checking carefully) as the caller_xdest area.
|
||||
|
||||
* The STAR(h) macro in libelf-dominfo.c now uses elf_access_unsigned.
|
||||
|
||||
* elf-init uses the new elf_uval_3264 accessor to access the 32-bit
|
||||
fields, rather than an unchecked field access (ie, unchecked
|
||||
pointer access).
|
||||
|
||||
* elf_uval has been reworked to use elf_uval_3264. Both of these
|
||||
macros are essentially new in this patch (although they are derived
|
||||
from the old elf_uval) and need careful review.
|
||||
|
||||
* ELF_ADVANCE_DEST is now safe in the sense that you can use it to
|
||||
chop parts off the front of the dest area but if you chop more than
|
||||
is available, the dest area is simply set to be empty, preventing
|
||||
future accesses.
|
||||
|
||||
* We introduce some #defines for memcpy, memset, memmove and strcpy:
|
||||
- We provide elf_memcpy_safe and elf_memset_safe which take
|
||||
PTRVALs and do checking on the supplied pointers.
|
||||
- Users inside libelf must all be changed to either
|
||||
elf_mem*_unchecked (which are just like mem*), or
|
||||
elf_mem*_safe (which take PTRVALs) and are checked. Any
|
||||
unchanged call sites become compilation errors.
|
||||
|
||||
* We do _not_ at this time fix elf_access_unsigned so that it doesn't
|
||||
make unaligned accesses. We hope that unaligned accesses are OK on
|
||||
every supported architecture. But it does check the supplied
|
||||
pointer for validity.
|
||||
|
||||
This is part of the fix to a security issue, XSA-55.
|
||||
|
||||
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
---
|
||||
tools/libxc/xc_dom_elfloader.c | 49 ++++++++--
|
||||
tools/libxc/xc_hvm_build_x86.c | 10 +-
|
||||
xen/arch/x86/domain_build.c | 3 +-
|
||||
xen/common/libelf/libelf-dominfo.c | 2 +-
|
||||
xen/common/libelf/libelf-loader.c | 16 ++--
|
||||
xen/common/libelf/libelf-private.h | 13 +++
|
||||
xen/common/libelf/libelf-tools.c | 106 ++++++++++++++++++-
|
||||
xen/include/xen/libelf.h | 198 +++++++++++++++++++++++++-----------
|
||||
8 files changed, 312 insertions(+), 85 deletions(-)
|
||||
|
||||
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
|
||||
index cc0f206..b82a08c 100644
|
||||
--- a/tools/libxc/xc_dom_elfloader.c
|
||||
+++ b/tools/libxc/xc_dom_elfloader.c
|
||||
@@ -130,20 +130,30 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
|
||||
if ( load )
|
||||
{
|
||||
- size_t allow_size; /* will be used in a forthcoming XSA-55 patch */
|
||||
+ char *hdr_ptr;
|
||||
+ size_t allow_size;
|
||||
+
|
||||
if ( !dom->bsd_symtab_start )
|
||||
return 0;
|
||||
size = dom->kernel_seg.vend - dom->bsd_symtab_start;
|
||||
- hdr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
|
||||
- *(int *)hdr = size - sizeof(int);
|
||||
+ hdr_ptr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
|
||||
+ elf->caller_xdest_base = hdr_ptr;
|
||||
+ elf->caller_xdest_size = allow_size;
|
||||
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
|
||||
+ elf_store_val(elf, int, hdr, size - sizeof(int));
|
||||
}
|
||||
else
|
||||
{
|
||||
+ char *hdr_ptr;
|
||||
+
|
||||
size = sizeof(int) + elf_size(elf, elf->ehdr) +
|
||||
elf_shdr_count(elf) * elf_size(elf, shdr);
|
||||
- hdr = xc_dom_malloc(dom, size);
|
||||
- if ( hdr == NULL )
|
||||
+ hdr_ptr = xc_dom_malloc(dom, size);
|
||||
+ if ( hdr_ptr == NULL )
|
||||
return 0;
|
||||
+ elf->caller_xdest_base = hdr_ptr;
|
||||
+ elf->caller_xdest_size = size;
|
||||
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
|
||||
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
|
||||
}
|
||||
|
||||
@@ -171,9 +181,32 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
ehdr->e_shoff = elf_size(elf, elf->ehdr);
|
||||
ehdr->e_shstrndx = SHN_UNDEF;
|
||||
}
|
||||
- if ( elf_init(&syms, hdr + sizeof(int), size - sizeof(int)) )
|
||||
+ if ( elf->caller_xdest_size < sizeof(int) )
|
||||
+ {
|
||||
+ DOMPRINTF("%s/%s: header size %"PRIx64" too small",
|
||||
+ __FUNCTION__, load ? "load" : "parse",
|
||||
+ (uint64_t)elf->caller_xdest_size);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
|
||||
+ elf->caller_xdest_size - sizeof(int)) )
|
||||
return -1;
|
||||
|
||||
+ /*
|
||||
+ * The caller_xdest_{base,size} and dest_{base,size} need to
|
||||
+ * remain valid so long as each struct elf_image does. The
|
||||
+ * principle we adopt is that these values are set when the
|
||||
+ * memory is allocated or mapped, and cleared when (and if)
|
||||
+ * they are unmapped.
|
||||
+ *
|
||||
+ * Mappings of the guest are normally undone by xc_dom_unmap_all
|
||||
+ * (directly or via xc_dom_release). We do not explicitly clear
|
||||
+ * these because in fact that happens only at the end of
|
||||
+ * xc_dom_boot_image, at which time all of these ELF loading
|
||||
+ * functions have returned. No relevant struct elf_binary*
|
||||
+ * escapes this file.
|
||||
+ */
|
||||
+
|
||||
xc_elf_set_logfile(dom->xch, &syms, 1);
|
||||
|
||||
symtab = dom->bsd_symtab_start + sizeof(int);
|
||||
@@ -312,8 +345,10 @@ static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
|
||||
{
|
||||
struct elf_binary *elf = dom->private_loader;
|
||||
int rc;
|
||||
+ xen_pfn_t pages;
|
||||
|
||||
- elf->dest = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
|
||||
+ elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
|
||||
+ elf->dest_size = pages * XC_DOM_PAGE_SIZE(dom);
|
||||
rc = elf_load_binary(elf);
|
||||
if ( rc < 0 )
|
||||
{
|
||||
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
|
||||
index 15b603d..ccfd8b5 100644
|
||||
--- a/tools/libxc/xc_hvm_build_x86.c
|
||||
+++ b/tools/libxc/xc_hvm_build_x86.c
|
||||
@@ -104,11 +104,12 @@ static int loadelfimage(
|
||||
for ( i = 0; i < pages; i++ )
|
||||
entries[i].mfn = parray[(elf->pstart >> PAGE_SHIFT) + i];
|
||||
|
||||
- elf->dest = xc_map_foreign_ranges(
|
||||
+ elf->dest_base = xc_map_foreign_ranges(
|
||||
xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
|
||||
entries, pages);
|
||||
- if ( elf->dest == NULL )
|
||||
+ if ( elf->dest_base == NULL )
|
||||
goto err;
|
||||
+ elf->dest_size = pages * PAGE_SIZE;
|
||||
|
||||
ELF_ADVANCE_DEST(elf, elf->pstart & (PAGE_SIZE - 1));
|
||||
|
||||
@@ -117,8 +118,9 @@ static int loadelfimage(
|
||||
if ( rc < 0 )
|
||||
PERROR("Failed to load elf binary\n");
|
||||
|
||||
- munmap(elf->dest, pages << PAGE_SHIFT);
|
||||
- elf->dest = NULL;
|
||||
+ munmap(elf->dest_base, pages << PAGE_SHIFT);
|
||||
+ elf->dest_base = NULL;
|
||||
+ elf->dest_size = 0;
|
||||
|
||||
err:
|
||||
free(entries);
|
||||
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
|
||||
index 469d363..a655b21 100644
|
||||
--- a/xen/arch/x86/domain_build.c
|
||||
+++ b/xen/arch/x86/domain_build.c
|
||||
@@ -908,7 +908,8 @@ int __init construct_dom0(
|
||||
write_ptbase(v);
|
||||
|
||||
/* Copy the OS image and free temporary buffer. */
|
||||
- elf.dest = (void*)vkern_start;
|
||||
+ elf.dest_base = (void*)vkern_start;
|
||||
+ elf.dest_size = vkern_end - vkern_start;
|
||||
rc = elf_load_binary(&elf);
|
||||
if ( rc < 0 )
|
||||
{
|
||||
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
|
||||
index b217f8f..98c80dc 100644
|
||||
--- a/xen/common/libelf/libelf-dominfo.c
|
||||
+++ b/xen/common/libelf/libelf-dominfo.c
|
||||
@@ -254,7 +254,7 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
int len;
|
||||
|
||||
h = parms->guest_info;
|
||||
-#define STAR(h) (*(h))
|
||||
+#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
|
||||
while ( STAR(h) )
|
||||
{
|
||||
elf_memset_unchecked(name, 0, sizeof(name));
|
||||
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
|
||||
index 0fef84c..a3310e7 100644
|
||||
--- a/xen/common/libelf/libelf-loader.c
|
||||
+++ b/xen/common/libelf/libelf-loader.c
|
||||
@@ -24,23 +24,25 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-int elf_init(struct elf_binary *elf, const char *image, size_t size)
|
||||
+int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
uint64_t i, count, section, offset;
|
||||
|
||||
- if ( !elf_is_elfbinary(image) )
|
||||
+ if ( !elf_is_elfbinary(image_input) )
|
||||
{
|
||||
elf_err(elf, "%s: not an ELF binary\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
elf_memset_unchecked(elf, 0, sizeof(*elf));
|
||||
- elf->image = image;
|
||||
+ elf->image_base = image_input;
|
||||
elf->size = size;
|
||||
- elf->ehdr = (elf_ehdr *)image;
|
||||
- elf->class = elf->ehdr->e32.e_ident[EI_CLASS];
|
||||
- elf->data = elf->ehdr->e32.e_ident[EI_DATA];
|
||||
+ elf->ehdr = ELF_MAKE_HANDLE(elf_ehdr, (elf_ptrval)image_input);
|
||||
+ elf->class = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_CLASS]);
|
||||
+ elf->data = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_DATA]);
|
||||
+ elf->caller_xdest_base = NULL;
|
||||
+ elf->caller_xdest_size = 0;
|
||||
|
||||
/* Sanity check phdr. */
|
||||
offset = elf_uval(elf, elf->ehdr, e_phoff) +
|
||||
@@ -300,7 +302,7 @@ int elf_load_binary(struct elf_binary *elf)
|
||||
|
||||
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr)
|
||||
{
|
||||
- return elf->dest + addr - elf->pstart;
|
||||
+ return ELF_REALPTR2PTRVAL(elf->dest_base) + addr - elf->pstart;
|
||||
}
|
||||
|
||||
uint64_t elf_lookup_addr(struct elf_binary * elf, const char *symbol)
|
||||
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
|
||||
index 3ef753c..280dfd1 100644
|
||||
--- a/xen/common/libelf/libelf-private.h
|
||||
+++ b/xen/common/libelf/libelf-private.h
|
||||
@@ -86,6 +86,19 @@ do { strncpy((d),(s),sizeof((d))-1); \
|
||||
|
||||
#endif
|
||||
|
||||
+#undef memcpy
|
||||
+#undef memset
|
||||
+#undef memmove
|
||||
+#undef strcpy
|
||||
+
|
||||
+#define memcpy MISTAKE_unspecified_memcpy
|
||||
+#define memset MISTAKE_unspecified_memset
|
||||
+#define memmove MISTAKE_unspecified_memmove
|
||||
+#define strcpy MISTAKE_unspecified_strcpy
|
||||
+ /* This prevents libelf from using these undecorated versions
|
||||
+ * of memcpy, memset, memmove and strcpy. Every call site
|
||||
+ * must either use elf_mem*_unchecked, or elf_mem*_safe. */
|
||||
+
|
||||
#endif /* __LIBELF_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
|
||||
index 3a0cde1..46ca553 100644
|
||||
--- a/xen/common/libelf/libelf-tools.c
|
||||
+++ b/xen/common/libelf/libelf-tools.c
|
||||
@@ -20,28 +20,100 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-uint64_t elf_access_unsigned(struct elf_binary * elf, const void *ptr,
|
||||
- uint64_t offset, size_t size)
|
||||
+void elf_mark_broken(struct elf_binary *elf, const char *msg)
|
||||
{
|
||||
+ if ( elf->broken == NULL )
|
||||
+ elf->broken = msg;
|
||||
+}
|
||||
+
|
||||
+const char *elf_check_broken(const struct elf_binary *elf)
|
||||
+{
|
||||
+ return elf->broken;
|
||||
+}
|
||||
+
|
||||
+static int elf_ptrval_in_range(elf_ptrval ptrval, uint64_t size,
|
||||
+ const void *region, uint64_t regionsize)
|
||||
+ /*
|
||||
+ * Returns true if the putative memory area [ptrval,ptrval+size>
|
||||
+ * is completely inside the region [region,region+regionsize>.
|
||||
+ *
|
||||
+ * ptrval and size are the untrusted inputs to be checked.
|
||||
+ * region and regionsize are trusted and must be correct and valid,
|
||||
+ * although it is OK for region to perhaps be maliciously NULL
|
||||
+ * (but not some other malicious value).
|
||||
+ */
|
||||
+{
|
||||
+ elf_ptrval regionp = (elf_ptrval)region;
|
||||
+
|
||||
+ if ( (region == NULL) ||
|
||||
+ (ptrval < regionp) || /* start is before region */
|
||||
+ (ptrval > regionp + regionsize) || /* start is after region */
|
||||
+ (size > regionsize - (ptrval - regionp)) ) /* too big */
|
||||
+ return 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int elf_access_ok(struct elf_binary * elf,
|
||||
+ uint64_t ptrval, size_t size)
|
||||
+{
|
||||
+ if ( elf_ptrval_in_range(ptrval, size, elf->image_base, elf->size) )
|
||||
+ return 1;
|
||||
+ if ( elf_ptrval_in_range(ptrval, size, elf->dest_base, elf->dest_size) )
|
||||
+ return 1;
|
||||
+ if ( elf_ptrval_in_range(ptrval, size,
|
||||
+ elf->caller_xdest_base, elf->caller_xdest_size) )
|
||||
+ return 1;
|
||||
+ elf_mark_broken(elf, "out of range access");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void elf_memcpy_safe(struct elf_binary *elf, elf_ptrval dst,
|
||||
+ elf_ptrval src, size_t size)
|
||||
+{
|
||||
+ if ( elf_access_ok(elf, dst, size) &&
|
||||
+ elf_access_ok(elf, src, size) )
|
||||
+ {
|
||||
+ /* use memmove because these checks do not prove that the
|
||||
+ * regions don't overlap and overlapping regions grant
|
||||
+ * permission for compiler malice */
|
||||
+ elf_memmove_unchecked(ELF_UNSAFE_PTR(dst), ELF_UNSAFE_PTR(src), size);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void elf_memset_safe(struct elf_binary *elf, elf_ptrval dst, int c, size_t size)
|
||||
+{
|
||||
+ if ( elf_access_ok(elf, dst, size) )
|
||||
+ {
|
||||
+ elf_memset_unchecked(ELF_UNSAFE_PTR(dst), c, size);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
|
||||
+ uint64_t moreoffset, size_t size)
|
||||
+{
|
||||
+ elf_ptrval ptrval = base + moreoffset;
|
||||
int need_swap = elf_swap(elf);
|
||||
const uint8_t *u8;
|
||||
const uint16_t *u16;
|
||||
const uint32_t *u32;
|
||||
const uint64_t *u64;
|
||||
|
||||
+ if ( !elf_access_ok(elf, ptrval, size) )
|
||||
+ return 0;
|
||||
+
|
||||
switch ( size )
|
||||
{
|
||||
case 1:
|
||||
- u8 = ptr + offset;
|
||||
+ u8 = (const void*)ptrval;
|
||||
return *u8;
|
||||
case 2:
|
||||
- u16 = ptr + offset;
|
||||
+ u16 = (const void*)ptrval;
|
||||
return need_swap ? bswap_16(*u16) : *u16;
|
||||
case 4:
|
||||
- u32 = ptr + offset;
|
||||
+ u32 = (const void*)ptrval;
|
||||
return need_swap ? bswap_32(*u32) : *u32;
|
||||
case 8:
|
||||
- u64 = ptr + offset;
|
||||
+ u64 = (const void*)ptrval;
|
||||
return need_swap ? bswap_64(*u64) : *u64;
|
||||
default:
|
||||
return 0;
|
||||
@@ -122,6 +194,28 @@ const char *elf_section_name(struct elf_binary *elf,
|
||||
return elf_strval(elf, elf->sec_strtab + elf_uval(elf, shdr, sh_name));
|
||||
}
|
||||
|
||||
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start)
|
||||
+{
|
||||
+ uint64_t length;
|
||||
+
|
||||
+ for ( length = 0; ; length++ ) {
|
||||
+ if ( !elf_access_ok(elf, start + length, 1) )
|
||||
+ return NULL;
|
||||
+ if ( !elf_access_unsigned(elf, start, length, 1) )
|
||||
+ /* ok */
|
||||
+ return ELF_UNSAFE_PTR(start);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start)
|
||||
+{
|
||||
+ const char *str = elf_strval(elf, start);
|
||||
+
|
||||
+ if ( str == NULL )
|
||||
+ return "(invalid)";
|
||||
+ return str;
|
||||
+}
|
||||
+
|
||||
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr)
|
||||
{
|
||||
return ELF_IMAGE_BASE(elf) + elf_uval(elf, shdr, sh_offset);
|
||||
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
|
||||
index af5b5c5..ddc3ed7 100644
|
||||
--- a/xen/include/xen/libelf.h
|
||||
+++ b/xen/include/xen/libelf.h
|
||||
@@ -57,8 +57,9 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
|
||||
* on this.
|
||||
* This replaces variables which were char*,void*
|
||||
* and their const versions, so we provide four
|
||||
- * different declaration macros:
|
||||
+ * different obsolete declaration macros:
|
||||
* ELF_PTRVAL_{,CONST}{VOID,CHAR}
|
||||
+ * New code can simply use the elf_ptrval typedef.
|
||||
* HANDLE A pointer to a struct. There is one of these types
|
||||
* for each pointer type - that is, for each "structname".
|
||||
* In the arguments to the various HANDLE macros, structname
|
||||
@@ -67,54 +68,66 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
|
||||
* pointers. In the current code attempts to do so will
|
||||
* compile, but in the next patch this will become a
|
||||
* compile error.
|
||||
- * We provide two declaration macros for const and
|
||||
- * non-const pointers.
|
||||
+ * We also provide a second declaration macro for
|
||||
+ * pointers which were to const; this is obsolete.
|
||||
*/
|
||||
|
||||
-#define ELF_REALPTR2PTRVAL(realpointer) (realpointer)
|
||||
+typedef uintptr_t elf_ptrval;
|
||||
+
|
||||
+#define ELF_REALPTR2PTRVAL(realpointer) ((elf_ptrval)(realpointer))
|
||||
/* Converts an actual C pointer into a PTRVAL */
|
||||
|
||||
-#define ELF_HANDLE_DECL_NONCONST(structname) structname *
|
||||
-#define ELF_HANDLE_DECL(structname) const structname *
|
||||
+#define ELF_HANDLE_DECL_NONCONST(structname) structname##_handle /*obsolete*/
|
||||
+#define ELF_HANDLE_DECL(structname) structname##_handle
|
||||
/* Provides a type declaration for a HANDLE. */
|
||||
- /* May only be used to declare ONE variable at a time */
|
||||
|
||||
-#define ELF_PTRVAL_VOID void *
|
||||
-#define ELF_PTRVAL_CHAR char *
|
||||
-#define ELF_PTRVAL_CONST_VOID const void *
|
||||
-#define ELF_PTRVAL_CONST_CHAR const char *
|
||||
- /* Provides a type declaration for a PTRVAL. */
|
||||
- /* May only be used to declare ONE variable at a time */
|
||||
+#define ELF_PTRVAL_VOID elf_ptrval /*obsolete*/
|
||||
+#define ELF_PTRVAL_CHAR elf_ptrval /*obsolete*/
|
||||
+#define ELF_PTRVAL_CONST_VOID elf_ptrval /*obsolete*/
|
||||
+#define ELF_PTRVAL_CONST_CHAR elf_ptrval /*obsolete*/
|
||||
+
|
||||
+#ifdef __XEN__
|
||||
+# define ELF_PRPTRVAL "lu"
|
||||
+ /*
|
||||
+ * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
|
||||
+ * to "u", when in fact uintptr_t is an unsigned long.
|
||||
+ */
|
||||
+#else
|
||||
+# define ELF_PRPTRVAL PRIuPTR
|
||||
+#endif
|
||||
+ /* printf format a la PRId... for a PTRVAL */
|
||||
|
||||
-#define ELF_DEFINE_HANDLE(structname) /* empty */
|
||||
+#define ELF_DEFINE_HANDLE(structname) \
|
||||
+ typedef union { \
|
||||
+ elf_ptrval ptrval; \
|
||||
+ const structname *typeonly; /* for sizeof, offsetof, &c only */ \
|
||||
+ } structname##_handle;
|
||||
/*
|
||||
* This must be invoked for each HANDLE type to define
|
||||
* the actual C type used for that kind of HANDLE.
|
||||
*/
|
||||
|
||||
-#define ELF_PRPTRVAL "p"
|
||||
- /* printf format a la PRId... for a PTRVAL */
|
||||
-
|
||||
-#define ELF_MAKE_HANDLE(structname, ptrval) (ptrval)
|
||||
+#define ELF_MAKE_HANDLE(structname, ptrval) ((structname##_handle){ ptrval })
|
||||
/* Converts a PTRVAL to a HANDLE */
|
||||
|
||||
-#define ELF_IMAGE_BASE(elf) ((elf)->image)
|
||||
+#define ELF_IMAGE_BASE(elf) ((elf_ptrval)(elf)->image_base)
|
||||
/* Returns the base of the image as a PTRVAL. */
|
||||
|
||||
-#define ELF_HANDLE_PTRVAL(handleval) ((void*)(handleval))
|
||||
+#define ELF_HANDLE_PTRVAL(handleval) ((handleval).ptrval)
|
||||
/* Converts a HANDLE to a PTRVAL. */
|
||||
|
||||
-#define ELF_OBSOLETE_VOIDP_CAST (void*)(uintptr_t)
|
||||
+#define ELF_OBSOLETE_VOIDP_CAST /*empty*/
|
||||
/*
|
||||
- * In some places the existing code needs to
|
||||
+ * In some places the old code used to need to
|
||||
* - cast away const (the existing code uses const a fair
|
||||
* bit but actually sometimes wants to write to its input)
|
||||
* from a PTRVAL.
|
||||
* - convert an integer representing a pointer to a PTRVAL
|
||||
- * This macro provides a suitable cast.
|
||||
+ * Nowadays all of these re uintptr_ts so there is no const problem
|
||||
+ * and no need for any casting.
|
||||
*/
|
||||
|
||||
-#define ELF_UNSAFE_PTR(ptrval) ((void*)(uintptr_t)(ptrval))
|
||||
+#define ELF_UNSAFE_PTR(ptrval) ((void*)(elf_ptrval)(ptrval))
|
||||
/*
|
||||
* Turns a PTRVAL into an actual C pointer. Before this is done
|
||||
* the caller must have ensured that the PTRVAL does in fact point
|
||||
@@ -122,18 +135,21 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
|
||||
*/
|
||||
|
||||
/* PTRVALs can be INVALID (ie, NULL). */
|
||||
-#define ELF_INVALID_PTRVAL (NULL) /* returns NULL PTRVAL */
|
||||
+#define ELF_INVALID_PTRVAL ((elf_ptrval)0) /* returns NULL PTRVAL */
|
||||
#define ELF_INVALID_HANDLE(structname) /* returns NULL handle */ \
|
||||
ELF_MAKE_HANDLE(structname, ELF_INVALID_PTRVAL)
|
||||
-#define ELF_PTRVAL_VALID(ptrval) (ptrval) /* } */
|
||||
-#define ELF_HANDLE_VALID(handleval) (handleval) /* } predicates */
|
||||
-#define ELF_PTRVAL_INVALID(ptrval) ((ptrval) == NULL) /* } */
|
||||
+#define ELF_PTRVAL_VALID(ptrval) (!!(ptrval)) /* } */
|
||||
+#define ELF_HANDLE_VALID(handleval) (!!(handleval).ptrval) /* } predicates */
|
||||
+#define ELF_PTRVAL_INVALID(ptrval) (!ELF_PTRVAL_VALID((ptrval))) /* } */
|
||||
+
|
||||
+#define ELF_MAX_PTRVAL (~(elf_ptrval)0)
|
||||
+ /* PTRVAL value guaranteed to compare > to any valid PTRVAL */
|
||||
|
||||
/* For internal use by other macros here */
|
||||
#define ELF__HANDLE_FIELD_TYPE(handleval, elm) \
|
||||
- typeof((handleval)->elm)
|
||||
+ typeof((handleval).typeonly->elm)
|
||||
#define ELF__HANDLE_FIELD_OFFSET(handleval, elm) \
|
||||
- offsetof(typeof(*(handleval)),elm)
|
||||
+ offsetof(typeof(*(handleval).typeonly),elm)
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
@@ -182,7 +198,7 @@ ELF_DEFINE_HANDLE(elf_note)
|
||||
|
||||
struct elf_binary {
|
||||
/* elf binary */
|
||||
- const char *image;
|
||||
+ const void *image_base;
|
||||
size_t size;
|
||||
char class;
|
||||
char data;
|
||||
@@ -190,10 +206,16 @@ struct elf_binary {
|
||||
ELF_HANDLE_DECL(elf_ehdr) ehdr;
|
||||
ELF_PTRVAL_CONST_CHAR sec_strtab;
|
||||
ELF_HANDLE_DECL(elf_shdr) sym_tab;
|
||||
- ELF_PTRVAL_CONST_CHAR sym_strtab;
|
||||
+ uint64_t sym_strtab;
|
||||
|
||||
/* loaded to */
|
||||
- char *dest;
|
||||
+ /*
|
||||
+ * dest_base and dest_size are trusted and must be correct;
|
||||
+ * whenever dest_size is not 0, both of these must be valid
|
||||
+ * so long as the struct elf_binary is in use.
|
||||
+ */
|
||||
+ char *dest_base;
|
||||
+ size_t dest_size;
|
||||
uint64_t pstart;
|
||||
uint64_t pend;
|
||||
uint64_t reloc_offset;
|
||||
@@ -201,12 +223,22 @@ struct elf_binary {
|
||||
uint64_t bsd_symtab_pstart;
|
||||
uint64_t bsd_symtab_pend;
|
||||
|
||||
+ /*
|
||||
+ * caller's other acceptable destination
|
||||
+ *
|
||||
+ * Again, these are trusted and must be valid (or 0) so long
|
||||
+ * as the struct elf_binary is in use.
|
||||
+ */
|
||||
+ void *caller_xdest_base;
|
||||
+ uint64_t caller_xdest_size;
|
||||
+
|
||||
#ifndef __XEN__
|
||||
/* misc */
|
||||
elf_log_callback *log_callback;
|
||||
void *log_caller_data;
|
||||
#endif
|
||||
int verbose;
|
||||
+ const char *broken;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
@@ -224,22 +256,27 @@ struct elf_binary {
|
||||
#define elf_lsb(elf) (ELFDATA2LSB == (elf)->data)
|
||||
#define elf_swap(elf) (NATIVE_ELFDATA != (elf)->data)
|
||||
|
||||
-#define elf_uval(elf, str, elem) \
|
||||
- ((ELFCLASS64 == (elf)->class) \
|
||||
- ? elf_access_unsigned((elf), (str), \
|
||||
- offsetof(typeof(*(str)),e64.elem), \
|
||||
- sizeof((str)->e64.elem)) \
|
||||
- : elf_access_unsigned((elf), (str), \
|
||||
- offsetof(typeof(*(str)),e32.elem), \
|
||||
- sizeof((str)->e32.elem)))
|
||||
+#define elf_uval_3264(elf, handle, elem) \
|
||||
+ elf_access_unsigned((elf), (handle).ptrval, \
|
||||
+ offsetof(typeof(*(handle).typeonly),elem), \
|
||||
+ sizeof((handle).typeonly->elem))
|
||||
+
|
||||
+#define elf_uval(elf, handle, elem) \
|
||||
+ ((ELFCLASS64 == (elf)->class) \
|
||||
+ ? elf_uval_3264(elf, handle, e64.elem) \
|
||||
+ : elf_uval_3264(elf, handle, e32.elem))
|
||||
/*
|
||||
* Reads an unsigned field in a header structure in the ELF.
|
||||
* str is a HANDLE, and elem is the field name in it.
|
||||
*/
|
||||
|
||||
-#define elf_size(elf, str) \
|
||||
+
|
||||
+#define elf_size(elf, handle_or_handletype) ({ \
|
||||
+ typeof(handle_or_handletype) elf_size__dummy; \
|
||||
((ELFCLASS64 == (elf)->class) \
|
||||
- ? sizeof((str)->e64) : sizeof((str)->e32))
|
||||
+ ? sizeof(elf_size__dummy.typeonly->e64) \
|
||||
+ : sizeof(elf_size__dummy.typeonly->e32)); \
|
||||
+})
|
||||
/*
|
||||
* Returns the size of the substructure for the appropriate 32/64-bitness.
|
||||
* str should be a HANDLE.
|
||||
@@ -251,23 +288,37 @@ uint64_t elf_access_unsigned(struct elf_binary *elf, ELF_PTRVAL_CONST_VOID ptr,
|
||||
|
||||
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
|
||||
|
||||
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start);
|
||||
+ /* may return NULL if the string is out of range etc. */
|
||||
|
||||
-#define elf_strval(elf,x) ((const char*)(x)) /* may return NULL in the future */
|
||||
-#define elf_strfmt(elf,x) ((const char*)(x)) /* will return (invalid) instead */
|
||||
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start);
|
||||
+ /* like elf_strval but returns "(invalid)" instead of NULL */
|
||||
|
||||
-#define elf_memcpy_safe(elf, dst, src, sz) memcpy((dst),(src),(sz))
|
||||
-#define elf_memset_safe(elf, dst, c, sz) memset((dst),(c),(sz))
|
||||
+void elf_memcpy_safe(struct elf_binary*, elf_ptrval dst, elf_ptrval src, size_t);
|
||||
+void elf_memset_safe(struct elf_binary*, elf_ptrval dst, int c, size_t);
|
||||
/*
|
||||
- * Versions of memcpy and memset which will (in the next patch)
|
||||
- * arrange never to write outside permitted areas.
|
||||
+ * Versions of memcpy and memset which arrange never to write
|
||||
+ * outside permitted areas.
|
||||
*/
|
||||
|
||||
-#define elf_store_val(elf, type, ptr, val) (*(type*)(ptr) = (val))
|
||||
+int elf_access_ok(struct elf_binary * elf,
|
||||
+ uint64_t ptrval, size_t size);
|
||||
+
|
||||
+#define elf_store_val(elf, type, ptr, val) \
|
||||
+ ({ \
|
||||
+ typeof(type) elf_store__val = (val); \
|
||||
+ elf_ptrval elf_store__targ = ptr; \
|
||||
+ if (elf_access_ok((elf), elf_store__targ, \
|
||||
+ sizeof(elf_store__val))) { \
|
||||
+ elf_memcpy_unchecked((void*)elf_store__targ, &elf_store__val, \
|
||||
+ sizeof(elf_store__val)); \
|
||||
+ } \
|
||||
+ }) \
|
||||
/* Stores a value at a particular PTRVAL. */
|
||||
|
||||
-#define elf_store_field(elf, hdr, elm, val) \
|
||||
- (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
|
||||
- &((hdr)->elm), \
|
||||
+#define elf_store_field(elf, hdr, elm, val) \
|
||||
+ (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
|
||||
+ ELF_HANDLE_PTRVAL(hdr) + ELF__HANDLE_FIELD_OFFSET(hdr, elm), \
|
||||
(val)))
|
||||
/* Stores a 32/64-bit field. hdr is a HANDLE and elm is the field name. */
|
||||
|
||||
@@ -306,6 +357,10 @@ int elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr)
|
||||
/* xc_libelf_loader.c */
|
||||
|
||||
int elf_init(struct elf_binary *elf, const char *image, size_t size);
|
||||
+ /*
|
||||
+ * image and size must be correct. They will be recorded in
|
||||
+ * *elf, and must remain valid while the elf is in use.
|
||||
+ */
|
||||
#ifdef __XEN__
|
||||
void elf_set_verbose(struct elf_binary *elf);
|
||||
#else
|
||||
@@ -321,6 +376,9 @@ uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
|
||||
|
||||
void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
|
||||
|
||||
+void elf_mark_broken(struct elf_binary *elf, const char *msg);
|
||||
+const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
|
||||
+
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_relocate.c */
|
||||
|
||||
@@ -395,16 +453,38 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
int elf_xen_parse(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms);
|
||||
|
||||
-#define elf_memcpy_unchecked memcpy
|
||||
-#define elf_memset_unchecked memset
|
||||
+static inline void *elf_memcpy_unchecked(void *dest, const void *src, size_t n)
|
||||
+ { return memcpy(dest, src, n); }
|
||||
+static inline void *elf_memmove_unchecked(void *dest, const void *src, size_t n)
|
||||
+ { return memmove(dest, src, n); }
|
||||
+static inline void *elf_memset_unchecked(void *s, int c, size_t n)
|
||||
+ { return memset(s, c, n); }
|
||||
/*
|
||||
- * Unsafe versions of memcpy and memset which take actual C
|
||||
- * pointers. These are just like real memcpy and memset.
|
||||
+ * Unsafe versions of memcpy, memmove memset which take actual C
|
||||
+ * pointers. These are just like the real functions.
|
||||
+ * We provide these so that in libelf-private.h we can #define
|
||||
+ * memcpy, memset and memmove to undefined MISTAKE things.
|
||||
*/
|
||||
|
||||
|
||||
-#define ELF_ADVANCE_DEST(elf, amount) elf->dest += (amount)
|
||||
- /* Advances past amount bytes of the current destination area. */
|
||||
+/* Advances past amount bytes of the current destination area. */
|
||||
+static inline void ELF_ADVANCE_DEST(struct elf_binary *elf, uint64_t amount)
|
||||
+{
|
||||
+ if ( elf->dest_base == NULL )
|
||||
+ {
|
||||
+ elf_mark_broken(elf, "advancing in null image");
|
||||
+ }
|
||||
+ else if ( elf->dest_size >= amount )
|
||||
+ {
|
||||
+ elf->dest_base += amount;
|
||||
+ elf->dest_size -= amount;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ elf->dest_size = 0;
|
||||
+ elf_mark_broken(elf, "advancing past end (image very short?)");
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
#endif /* __XEN_LIBELF_H__ */
|
||||
--
|
||||
1.7.2.5
|
||||
|
@ -1,759 +0,0 @@
|
||||
From e673ca50127b6c1263727aa31de0b8bb966ca7a2 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
Date: Fri, 14 Jun 2013 16:43:18 +0100
|
||||
Subject: [PATCH 15/23] libelf: use only unsigned integers
|
||||
|
||||
Signed integers have undesirable undefined behaviours on overflow.
|
||||
Malicious compilers can turn apparently-correct code into code with
|
||||
security vulnerabilities etc.
|
||||
|
||||
So use only unsigned integers. Exceptions are booleans (which we have
|
||||
already changed) and error codes.
|
||||
|
||||
We _do_ change all the chars which aren't fixed constants from our own
|
||||
text segment, but not the char*s. This is because it is safe to
|
||||
access an arbitrary byte through a char*, but not necessarily safe to
|
||||
convert an arbitrary value to a char.
|
||||
|
||||
As a consequence we need to compile libelf with -Wno-pointer-sign.
|
||||
|
||||
It is OK to change all the signed integers to unsigned because all the
|
||||
inequalities in libelf are in contexts where we don't "expect"
|
||||
negative numbers.
|
||||
|
||||
In libelf-dominfo.c:elf_xen_parse we rename a variable "rc" to
|
||||
"more_notes" as it actually contains a note count derived from the
|
||||
input image. The "error" return value from elf_xen_parse_notes is
|
||||
changed from -1 to ~0U.
|
||||
|
||||
grepping shows only one occurrence of "PRId" or "%d" or "%ld" in
|
||||
libelf and xc_dom_elfloader.c (a "%d" which becomes "%u").
|
||||
|
||||
This is part of the fix to a security issue, XSA-55.
|
||||
|
||||
For those concerned about unintentional functional changes, the
|
||||
following rune produces a version of the patch which is much smaller
|
||||
and eliminates only non-functional changes:
|
||||
|
||||
GIT_EXTERNAL_DIFF=.../unsigned-differ git-diff <before>..<after>
|
||||
|
||||
where <before> and <after> are git refs for the code before and after
|
||||
this patch, and unsigned-differ is this shell script:
|
||||
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
seddery () {
|
||||
perl -pe 's/\b(?:elf_errorstatus|elf_negerrnoval)\b/int/g'
|
||||
}
|
||||
|
||||
path="$1"
|
||||
in="$2"
|
||||
out="$5"
|
||||
|
||||
set +e
|
||||
diff -pu --label "$path~" <(seddery <"$in") --label "$path" <(seddery <"$out")
|
||||
rc=$?
|
||||
set -e
|
||||
if [ $rc = 1 ]; then rc=0; fi
|
||||
exit $rc
|
||||
|
||||
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
---
|
||||
tools/libxc/Makefile | 9 +++++-
|
||||
tools/libxc/xc_dom.h | 7 +++--
|
||||
tools/libxc/xc_dom_elfloader.c | 42 ++++++++++++++++-------------
|
||||
tools/xcutils/readnotes.c | 15 +++++-----
|
||||
xen/common/libelf/Makefile | 2 +
|
||||
xen/common/libelf/libelf-dominfo.c | 52 ++++++++++++++++++-----------------
|
||||
xen/common/libelf/libelf-loader.c | 20 +++++++-------
|
||||
xen/common/libelf/libelf-tools.c | 24 ++++++++--------
|
||||
xen/include/xen/libelf.h | 21 ++++++++------
|
||||
9 files changed, 105 insertions(+), 87 deletions(-)
|
||||
|
||||
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
|
||||
index d8c6a60..a3fd90c 100644
|
||||
--- a/tools/libxc/Makefile
|
||||
+++ b/tools/libxc/Makefile
|
||||
@@ -52,8 +52,13 @@ endif
|
||||
vpath %.c ../../xen/common/libelf
|
||||
CFLAGS += -I../../xen/common/libelf
|
||||
|
||||
-GUEST_SRCS-y += libelf-tools.c libelf-loader.c
|
||||
-GUEST_SRCS-y += libelf-dominfo.c
|
||||
+ELF_SRCS-y += libelf-tools.c libelf-loader.c
|
||||
+ELF_SRCS-y += libelf-dominfo.c
|
||||
+
|
||||
+GUEST_SRCS-y += $(ELF_SRCS-y)
|
||||
+
|
||||
+$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
|
||||
+$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
|
||||
|
||||
# new domain builder
|
||||
GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
|
||||
diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
|
||||
index 9f8037e..0161459 100644
|
||||
--- a/tools/libxc/xc_dom.h
|
||||
+++ b/tools/libxc/xc_dom.h
|
||||
@@ -140,9 +140,10 @@ struct xc_dom_image {
|
||||
|
||||
struct xc_dom_loader {
|
||||
char *name;
|
||||
- int (*probe) (struct xc_dom_image * dom);
|
||||
- int (*parser) (struct xc_dom_image * dom);
|
||||
- int (*loader) (struct xc_dom_image * dom);
|
||||
+ /* Sadly the error returns from these functions are not consistent: */
|
||||
+ elf_negerrnoval (*probe) (struct xc_dom_image * dom);
|
||||
+ elf_negerrnoval (*parser) (struct xc_dom_image * dom);
|
||||
+ elf_errorstatus (*loader) (struct xc_dom_image * dom);
|
||||
|
||||
struct xc_dom_loader *next;
|
||||
};
|
||||
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
|
||||
index 9ba64ae..62a0d3b 100644
|
||||
--- a/tools/libxc/xc_dom_elfloader.c
|
||||
+++ b/tools/libxc/xc_dom_elfloader.c
|
||||
@@ -84,7 +84,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* parse elf binary */
|
||||
|
||||
-static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
|
||||
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
|
||||
{
|
||||
if ( dom->kernel_blob == NULL )
|
||||
{
|
||||
@@ -106,12 +106,12 @@ static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
|
||||
+static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
|
||||
{
|
||||
return check_elf_kernel(dom, 0);
|
||||
}
|
||||
|
||||
-static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
+static elf_errorstatus xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
struct elf_binary *elf, bool load)
|
||||
{
|
||||
struct elf_binary syms;
|
||||
@@ -119,7 +119,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
xen_vaddr_t symtab, maxaddr;
|
||||
ELF_PTRVAL_CHAR hdr;
|
||||
size_t size;
|
||||
- int h, count, type, i, tables = 0;
|
||||
+ unsigned h, count, type, i, tables = 0;
|
||||
|
||||
if ( elf_swap(elf) )
|
||||
{
|
||||
@@ -140,13 +140,13 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
elf->caller_xdest_base = hdr_ptr;
|
||||
elf->caller_xdest_size = allow_size;
|
||||
hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
|
||||
- elf_store_val(elf, int, hdr, size - sizeof(int));
|
||||
+ elf_store_val(elf, unsigned, hdr, size - sizeof(unsigned));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *hdr_ptr;
|
||||
|
||||
- size = sizeof(int) + elf_size(elf, elf->ehdr) +
|
||||
+ size = sizeof(unsigned) + elf_size(elf, elf->ehdr) +
|
||||
elf_shdr_count(elf) * elf_size(elf, shdr);
|
||||
hdr_ptr = xc_dom_malloc(dom, size);
|
||||
if ( hdr_ptr == NULL )
|
||||
@@ -157,15 +157,15 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
|
||||
}
|
||||
|
||||
- elf_memcpy_safe(elf, hdr + sizeof(int),
|
||||
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned),
|
||||
ELF_IMAGE_BASE(elf),
|
||||
elf_size(elf, elf->ehdr));
|
||||
- elf_memcpy_safe(elf, hdr + sizeof(int) + elf_size(elf, elf->ehdr),
|
||||
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned) + elf_size(elf, elf->ehdr),
|
||||
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
|
||||
elf_shdr_count(elf) * elf_size(elf, shdr));
|
||||
if ( elf_64bit(elf) )
|
||||
{
|
||||
- Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(int));
|
||||
+ Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(unsigned));
|
||||
ehdr->e_phoff = 0;
|
||||
ehdr->e_phentsize = 0;
|
||||
ehdr->e_phnum = 0;
|
||||
@@ -174,22 +174,22 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
}
|
||||
else
|
||||
{
|
||||
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(int));
|
||||
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(unsigned));
|
||||
ehdr->e_phoff = 0;
|
||||
ehdr->e_phentsize = 0;
|
||||
ehdr->e_phnum = 0;
|
||||
ehdr->e_shoff = elf_size(elf, elf->ehdr);
|
||||
ehdr->e_shstrndx = SHN_UNDEF;
|
||||
}
|
||||
- if ( elf->caller_xdest_size < sizeof(int) )
|
||||
+ if ( elf->caller_xdest_size < sizeof(unsigned) )
|
||||
{
|
||||
DOMPRINTF("%s/%s: header size %"PRIx64" too small",
|
||||
__FUNCTION__, load ? "load" : "parse",
|
||||
(uint64_t)elf->caller_xdest_size);
|
||||
return -1;
|
||||
}
|
||||
- if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
|
||||
- elf->caller_xdest_size - sizeof(int)) )
|
||||
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(unsigned),
|
||||
+ elf->caller_xdest_size - sizeof(unsigned)) )
|
||||
return -1;
|
||||
|
||||
/*
|
||||
@@ -209,7 +209,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
|
||||
xc_elf_set_logfile(dom->xch, &syms, 1);
|
||||
|
||||
- symtab = dom->bsd_symtab_start + sizeof(int);
|
||||
+ symtab = dom->bsd_symtab_start + sizeof(unsigned);
|
||||
maxaddr = elf_round_up(&syms, symtab + elf_size(&syms, syms.ehdr) +
|
||||
elf_shdr_count(&syms) * elf_size(&syms, shdr));
|
||||
|
||||
@@ -255,7 +255,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
size = elf_uval(&syms, shdr, sh_size);
|
||||
maxaddr = elf_round_up(&syms, maxaddr + size);
|
||||
tables++;
|
||||
- DOMPRINTF("%s: h=%d %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
|
||||
+ DOMPRINTF("%s: h=%u %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
|
||||
__FUNCTION__, h,
|
||||
type == SHT_SYMTAB ? "symtab" : "strtab",
|
||||
size, maxaddr);
|
||||
@@ -294,10 +294,14 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
|
||||
+static elf_errorstatus xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
|
||||
+ /*
|
||||
+ * This function sometimes returns -1 for error and sometimes
|
||||
+ * an errno value. ?!?!
|
||||
+ */
|
||||
{
|
||||
struct elf_binary *elf;
|
||||
- int rc;
|
||||
+ elf_errorstatus rc;
|
||||
|
||||
rc = check_elf_kernel(dom, 1);
|
||||
if ( rc != 0 )
|
||||
@@ -358,10 +362,10 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
-static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
|
||||
+static elf_errorstatus xc_dom_load_elf_kernel(struct xc_dom_image *dom)
|
||||
{
|
||||
struct elf_binary *elf = dom->private_loader;
|
||||
- int rc;
|
||||
+ elf_errorstatus rc;
|
||||
xen_pfn_t pages;
|
||||
|
||||
elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
|
||||
diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
|
||||
index d1f7a30..2ca7732 100644
|
||||
--- a/tools/xcutils/readnotes.c
|
||||
+++ b/tools/xcutils/readnotes.c
|
||||
@@ -70,7 +70,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
|
||||
ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
uint64_t value = elf_note_numeric(elf, note);
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
|
||||
printf("%s: %#*" PRIx64 " (%d bytes)\n",
|
||||
prefix, 2+2*descsz, value, descsz);
|
||||
@@ -79,7 +79,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
|
||||
static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
|
||||
ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
|
||||
|
||||
/* XXX should be able to cope with a list of values. */
|
||||
@@ -99,10 +99,10 @@ static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
|
||||
|
||||
}
|
||||
|
||||
-static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
|
||||
+static unsigned print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_note) note;
|
||||
- int notes_found = 0;
|
||||
+ unsigned notes_found = 0;
|
||||
const char *this_note_name;
|
||||
|
||||
for ( note = start; ELF_HANDLE_PTRVAL(note) < ELF_HANDLE_PTRVAL(end); note = elf_note_next(elf, note) )
|
||||
@@ -161,7 +161,7 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
|
||||
break;
|
||||
default:
|
||||
printf("unknown note type %#x\n",
|
||||
- (int)elf_uval(elf, note, type));
|
||||
+ (unsigned)elf_uval(elf, note, type));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -171,12 +171,13 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *f;
|
||||
- int fd,h,size,usize,count;
|
||||
+ int fd;
|
||||
+ unsigned h,size,usize,count;
|
||||
void *image,*tmp;
|
||||
struct stat st;
|
||||
struct elf_binary elf;
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
- int notes_found = 0;
|
||||
+ unsigned notes_found = 0;
|
||||
|
||||
struct setup_header *hdr;
|
||||
uint64_t payload_offset, payload_length;
|
||||
diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
|
||||
index 18dc8e2..5bf8f76 100644
|
||||
--- a/xen/common/libelf/Makefile
|
||||
+++ b/xen/common/libelf/Makefile
|
||||
@@ -2,6 +2,8 @@ obj-bin-y := libelf.o
|
||||
|
||||
SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
|
||||
|
||||
+CFLAGS += -Wno-pointer-sign
|
||||
+
|
||||
libelf.o: libelf-temp.o Makefile
|
||||
$(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
|
||||
|
||||
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
|
||||
index 12b6c2a..cdd0d31 100644
|
||||
--- a/xen/common/libelf/libelf-dominfo.c
|
||||
+++ b/xen/common/libelf/libelf-dominfo.c
|
||||
@@ -29,15 +29,15 @@ static const char *const elf_xen_feature_names[] = {
|
||||
[XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb",
|
||||
[XENFEAT_dom0] = "dom0"
|
||||
};
|
||||
-static const int elf_xen_features =
|
||||
+static const unsigned elf_xen_features =
|
||||
sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]);
|
||||
|
||||
-int elf_xen_parse_features(const char *features,
|
||||
+elf_errorstatus elf_xen_parse_features(const char *features,
|
||||
uint32_t *supported,
|
||||
uint32_t *required)
|
||||
{
|
||||
- char feature[64];
|
||||
- int pos, len, i;
|
||||
+ unsigned char feature[64];
|
||||
+ unsigned pos, len, i;
|
||||
|
||||
if ( features == NULL )
|
||||
return 0;
|
||||
@@ -94,7 +94,7 @@ int elf_xen_parse_features(const char *features,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xen elf notes */
|
||||
|
||||
-int elf_xen_parse_note(struct elf_binary *elf,
|
||||
+elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms,
|
||||
ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
@@ -125,7 +125,7 @@ int elf_xen_parse_note(struct elf_binary *elf,
|
||||
const char *str = NULL;
|
||||
uint64_t val = 0;
|
||||
unsigned int i;
|
||||
- int type = elf_uval(elf, note, type);
|
||||
+ unsigned type = elf_uval(elf, note, type);
|
||||
|
||||
if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) ||
|
||||
(note_desc[type].name == NULL) )
|
||||
@@ -216,12 +216,14 @@ int elf_xen_parse_note(struct elf_binary *elf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int elf_xen_parse_notes(struct elf_binary *elf,
|
||||
+#define ELF_NOTE_INVALID (~0U)
|
||||
+
|
||||
+static unsigned elf_xen_parse_notes(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms,
|
||||
ELF_PTRVAL_CONST_VOID start,
|
||||
ELF_PTRVAL_CONST_VOID end)
|
||||
{
|
||||
- int xen_elfnotes = 0;
|
||||
+ unsigned xen_elfnotes = 0;
|
||||
ELF_HANDLE_DECL(elf_note) note;
|
||||
const char *note_name;
|
||||
|
||||
@@ -237,7 +239,7 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
|
||||
if ( strcmp(note_name, "Xen") )
|
||||
continue;
|
||||
if ( elf_xen_parse_note(elf, parms, note) )
|
||||
- return -1;
|
||||
+ return ELF_NOTE_INVALID;
|
||||
xen_elfnotes++;
|
||||
}
|
||||
return xen_elfnotes;
|
||||
@@ -246,12 +248,12 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* __xen_guest section */
|
||||
|
||||
-int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
+elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
ELF_PTRVAL_CONST_CHAR h;
|
||||
- char name[32], value[128];
|
||||
- int len;
|
||||
+ unsigned char name[32], value[128];
|
||||
+ unsigned len;
|
||||
|
||||
h = parms->guest_info;
|
||||
#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
|
||||
@@ -334,13 +336,13 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* sanity checks */
|
||||
|
||||
-static int elf_xen_note_check(struct elf_binary *elf,
|
||||
+static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
if ( (ELF_PTRVAL_INVALID(parms->elf_note_start)) &&
|
||||
(ELF_PTRVAL_INVALID(parms->guest_info)) )
|
||||
{
|
||||
- int machine = elf_uval(elf, elf->ehdr, e_machine);
|
||||
+ unsigned machine = elf_uval(elf, elf->ehdr, e_machine);
|
||||
if ( (machine == EM_386) || (machine == EM_X86_64) )
|
||||
{
|
||||
elf_err(elf, "%s: ERROR: Not a Xen-ELF image: "
|
||||
@@ -378,7 +380,7 @@ static int elf_xen_note_check(struct elf_binary *elf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int elf_xen_addr_calc_check(struct elf_binary *elf,
|
||||
+static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
if ( (parms->elf_paddr_offset != UNSET_ADDR) &&
|
||||
@@ -464,13 +466,13 @@ static int elf_xen_addr_calc_check(struct elf_binary *elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* glue it all together ... */
|
||||
|
||||
-int elf_xen_parse(struct elf_binary *elf,
|
||||
+elf_errorstatus elf_xen_parse(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
ELF_HANDLE_DECL(elf_phdr) phdr;
|
||||
- int xen_elfnotes = 0;
|
||||
- int i, count, rc;
|
||||
+ unsigned xen_elfnotes = 0;
|
||||
+ unsigned i, count, more_notes;
|
||||
|
||||
elf_memset_unchecked(parms, 0, sizeof(*parms));
|
||||
parms->virt_base = UNSET_ADDR;
|
||||
@@ -495,13 +497,13 @@ int elf_xen_parse(struct elf_binary *elf,
|
||||
if (elf_uval(elf, phdr, p_offset) == 0)
|
||||
continue;
|
||||
|
||||
- rc = elf_xen_parse_notes(elf, parms,
|
||||
+ more_notes = elf_xen_parse_notes(elf, parms,
|
||||
elf_segment_start(elf, phdr),
|
||||
elf_segment_end(elf, phdr));
|
||||
- if ( rc == -1 )
|
||||
+ if ( more_notes == ELF_NOTE_INVALID )
|
||||
return -1;
|
||||
|
||||
- xen_elfnotes += rc;
|
||||
+ xen_elfnotes += more_notes;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -518,17 +520,17 @@ int elf_xen_parse(struct elf_binary *elf,
|
||||
if ( elf_uval(elf, shdr, sh_type) != SHT_NOTE )
|
||||
continue;
|
||||
|
||||
- rc = elf_xen_parse_notes(elf, parms,
|
||||
+ more_notes = elf_xen_parse_notes(elf, parms,
|
||||
elf_section_start(elf, shdr),
|
||||
elf_section_end(elf, shdr));
|
||||
|
||||
- if ( rc == -1 )
|
||||
+ if ( more_notes == ELF_NOTE_INVALID )
|
||||
return -1;
|
||||
|
||||
- if ( xen_elfnotes == 0 && rc > 0 )
|
||||
+ if ( xen_elfnotes == 0 && more_notes > 0 )
|
||||
elf_msg(elf, "%s: using notes from SHT_NOTE section\n", __FUNCTION__);
|
||||
|
||||
- xen_elfnotes += rc;
|
||||
+ xen_elfnotes += more_notes;
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
|
||||
index 0dccd4d..c3a9e51 100644
|
||||
--- a/xen/common/libelf/libelf-loader.c
|
||||
+++ b/xen/common/libelf/libelf-loader.c
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
|
||||
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image_input, size_t size)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
uint64_t i, count, section, offset;
|
||||
@@ -114,7 +114,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback *log_callback,
|
||||
elf->verbose = verbose;
|
||||
}
|
||||
|
||||
-static int elf_load_image(struct elf_binary *elf,
|
||||
+static elf_errorstatus elf_load_image(struct elf_binary *elf,
|
||||
ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src,
|
||||
uint64_t filesz, uint64_t memsz)
|
||||
{
|
||||
@@ -129,9 +129,9 @@ void elf_set_verbose(struct elf_binary *elf)
|
||||
elf->verbose = 1;
|
||||
}
|
||||
|
||||
-static int elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
|
||||
+static elf_errorstatus elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
|
||||
{
|
||||
- int rc;
|
||||
+ elf_errorstatus rc;
|
||||
if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
|
||||
return -1;
|
||||
/* We trust the dom0 kernel image completely, so we don't care
|
||||
@@ -151,7 +151,7 @@ void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart)
|
||||
{
|
||||
uint64_t sz;
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
- int i, type;
|
||||
+ unsigned i, type;
|
||||
|
||||
if ( !ELF_HANDLE_VALID(elf->sym_tab) )
|
||||
return;
|
||||
@@ -187,7 +187,7 @@ static void elf_load_bsdsyms(struct elf_binary *elf)
|
||||
ELF_PTRVAL_VOID symbase;
|
||||
ELF_PTRVAL_VOID symtab_addr;
|
||||
ELF_HANDLE_DECL_NONCONST(elf_shdr) shdr;
|
||||
- int i, type;
|
||||
+ unsigned i, type;
|
||||
|
||||
if ( !elf->bsd_symtab_pstart )
|
||||
return;
|
||||
@@ -220,7 +220,7 @@ do { \
|
||||
elf_memcpy_safe(elf, ELF_HANDLE_PTRVAL(shdr),
|
||||
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
|
||||
sz);
|
||||
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
|
||||
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
|
||||
|
||||
for ( i = 0; i < elf_shdr_count(elf); i++ )
|
||||
{
|
||||
@@ -233,10 +233,10 @@ do { \
|
||||
elf_memcpy_safe(elf, maxva, elf_section_start(elf, shdr), sz);
|
||||
/* Mangled to be based on ELF header location. */
|
||||
elf_hdr_elm(elf, shdr, sh_offset, maxva - symtab_addr);
|
||||
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
|
||||
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
|
||||
}
|
||||
shdr = ELF_MAKE_HANDLE(elf_shdr, ELF_HANDLE_PTRVAL(shdr) +
|
||||
- (long)elf_uval(elf, elf->ehdr, e_shentsize));
|
||||
+ (unsigned long)elf_uval(elf, elf->ehdr, e_shentsize));
|
||||
}
|
||||
|
||||
/* Write down the actual sym size. */
|
||||
@@ -273,7 +273,7 @@ void elf_parse_binary(struct elf_binary *elf)
|
||||
__FUNCTION__, elf->pstart, elf->pend);
|
||||
}
|
||||
|
||||
-int elf_load_binary(struct elf_binary *elf)
|
||||
+elf_errorstatus elf_load_binary(struct elf_binary *elf)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_phdr) phdr;
|
||||
uint64_t i, count, paddr, offset, filesz, memsz;
|
||||
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
|
||||
index fa58f76..46d4ab1 100644
|
||||
--- a/xen/common/libelf/libelf-tools.c
|
||||
+++ b/xen/common/libelf/libelf-tools.c
|
||||
@@ -122,19 +122,19 @@ uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
|
||||
|
||||
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr)
|
||||
{
|
||||
- int elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
|
||||
+ uint64_t elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
|
||||
|
||||
return (addr + elf_round) & ~elf_round;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-int elf_shdr_count(struct elf_binary *elf)
|
||||
+unsigned elf_shdr_count(struct elf_binary *elf)
|
||||
{
|
||||
return elf_uval(elf, elf->ehdr, e_shnum);
|
||||
}
|
||||
|
||||
-int elf_phdr_count(struct elf_binary *elf)
|
||||
+unsigned elf_phdr_count(struct elf_binary *elf)
|
||||
{
|
||||
return elf_uval(elf, elf->ehdr, e_phnum);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
|
||||
uint64_t count = elf_shdr_count(elf);
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
const char *sname;
|
||||
- int i;
|
||||
+ unsigned i;
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
@@ -156,7 +156,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
|
||||
return ELF_INVALID_HANDLE(elf_shdr);
|
||||
}
|
||||
|
||||
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
|
||||
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index)
|
||||
{
|
||||
uint64_t count = elf_shdr_count(elf);
|
||||
ELF_PTRVAL_CONST_VOID ptr;
|
||||
@@ -170,7 +170,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
|
||||
return ELF_MAKE_HANDLE(elf_shdr, ptr);
|
||||
}
|
||||
|
||||
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index)
|
||||
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index)
|
||||
{
|
||||
uint64_t count = elf_uval(elf, elf->ehdr, e_phnum);
|
||||
ELF_PTRVAL_CONST_VOID ptr;
|
||||
@@ -264,7 +264,7 @@ ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *sym
|
||||
return ELF_INVALID_HANDLE(elf_sym);
|
||||
}
|
||||
|
||||
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index)
|
||||
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index)
|
||||
{
|
||||
ELF_PTRVAL_CONST_VOID ptr = elf_section_start(elf, elf->sym_tab);
|
||||
ELF_HANDLE_DECL(elf_sym) sym;
|
||||
@@ -280,7 +280,7 @@ const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note
|
||||
|
||||
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
|
||||
return ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_
|
||||
uint64_t elf_note_numeric(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
|
||||
switch (descsz)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
|
||||
unsigned int unitsz, unsigned int idx)
|
||||
{
|
||||
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
|
||||
if ( descsz % unitsz || idx >= descsz / unitsz )
|
||||
return 0;
|
||||
@@ -324,8 +324,8 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
|
||||
|
||||
ELF_HANDLE_DECL(elf_note) elf_note_next(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
- int descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
|
||||
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
+ unsigned descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
|
||||
|
||||
return ELF_MAKE_HANDLE(elf_note, ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz + descsz);
|
||||
}
|
||||
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
|
||||
index 951430f..87e126a 100644
|
||||
--- a/xen/include/xen/libelf.h
|
||||
+++ b/xen/include/xen/libelf.h
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
+typedef int elf_errorstatus; /* 0: ok; -ve (normally -1): error */
|
||||
+typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */
|
||||
+
|
||||
#undef ELFSIZE
|
||||
#include "elfstructs.h"
|
||||
#ifdef __XEN__
|
||||
@@ -328,12 +331,12 @@ bool elf_access_ok(struct elf_binary * elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_tools.c */
|
||||
|
||||
-int elf_shdr_count(struct elf_binary *elf);
|
||||
-int elf_phdr_count(struct elf_binary *elf);
|
||||
+unsigned elf_shdr_count(struct elf_binary *elf);
|
||||
+unsigned elf_phdr_count(struct elf_binary *elf);
|
||||
|
||||
ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *name);
|
||||
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index);
|
||||
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index);
|
||||
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index);
|
||||
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index);
|
||||
|
||||
const char *elf_section_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr); /* might return NULL if inputs are invalid */
|
||||
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr);
|
||||
@@ -343,7 +346,7 @@ ELF_PTRVAL_CONST_VOID elf_segment_start(struct elf_binary *elf, ELF_HANDLE_DECL(
|
||||
ELF_PTRVAL_CONST_VOID elf_segment_end(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr);
|
||||
|
||||
ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *symbol);
|
||||
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index);
|
||||
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index);
|
||||
|
||||
const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note); /* may return NULL */
|
||||
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note);
|
||||
@@ -360,7 +363,7 @@ bool elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_loader.c */
|
||||
|
||||
-int elf_init(struct elf_binary *elf, const char *image, size_t size);
|
||||
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image, size_t size);
|
||||
/*
|
||||
* image and size must be correct. They will be recorded in
|
||||
* *elf, and must remain valid while the elf is in use.
|
||||
@@ -373,7 +376,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback*,
|
||||
#endif
|
||||
|
||||
void elf_parse_binary(struct elf_binary *elf);
|
||||
-int elf_load_binary(struct elf_binary *elf);
|
||||
+elf_errorstatus elf_load_binary(struct elf_binary *elf);
|
||||
|
||||
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr);
|
||||
uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
|
||||
@@ -386,7 +389,7 @@ const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_relocate.c */
|
||||
|
||||
-int elf_reloc(struct elf_binary *elf);
|
||||
+elf_errorstatus elf_reloc(struct elf_binary *elf);
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_dominfo.c */
|
||||
@@ -420,7 +423,7 @@ struct elf_dom_parms {
|
||||
char guest_ver[16];
|
||||
char xen_ver[16];
|
||||
char loader[16];
|
||||
- int pae;
|
||||
+ int pae; /* some kind of enum apparently */
|
||||
bool bsd_symtab;
|
||||
uint64_t virt_base;
|
||||
uint64_t virt_entry;
|
||||
--
|
||||
1.7.2.5
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,788 +0,0 @@
|
||||
From cc8761371aac432318530c2ddfe2c8234bc0621f Mon Sep 17 00:00:00 2001
|
||||
From: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
Date: Fri, 14 Jun 2013 16:43:17 +0100
|
||||
Subject: [PATCH 11/23] libelf: check all pointer accesses
|
||||
|
||||
We change the ELF_PTRVAL and ELF_HANDLE types and associated macros:
|
||||
|
||||
* PTRVAL becomes a uintptr_t, for which we provide a typedef
|
||||
elf_ptrval. This means no arithmetic done on it can overflow so
|
||||
the compiler cannot do any malicious invalid pointer arithmetic
|
||||
"optimisations". It also means that any places where we
|
||||
dereference one of these pointers without using the appropriate
|
||||
macros or functions become a compilation error.
|
||||
|
||||
So we can be sure that we won't miss any memory accesses.
|
||||
|
||||
All the PTRVAL variables were previously void* or char*, so
|
||||
the actual address calculations are unchanged.
|
||||
|
||||
* ELF_HANDLE becomes a union, one half of which keeps the pointer
|
||||
value and the other half of which is just there to record the
|
||||
type.
|
||||
|
||||
The new type is not a pointer type so there can be no address
|
||||
calculations on it whose meaning would change. Every assignment or
|
||||
access has to go through one of our macros.
|
||||
|
||||
* The distinction between const and non-const pointers and char*s
|
||||
and void*s in libelf goes away. This was not important (and
|
||||
anyway libelf tended to cast away const in various places).
|
||||
|
||||
* The fields elf->image and elf->dest are renamed. That proves
|
||||
that we haven't missed any unchecked uses of these actual
|
||||
pointer values.
|
||||
|
||||
* The caller may fill in elf->caller_xdest_base and _size to
|
||||
specify another range of memory which is safe for libelf to
|
||||
access, besides the input and output images.
|
||||
|
||||
* When accesses fail due to being out of range, we mark the elf
|
||||
"broken". This will be checked and used for diagnostics in
|
||||
a following patch.
|
||||
|
||||
We do not check for write accesses to the input image. This is
|
||||
because libelf actually does this in a number of places. So we
|
||||
simply permit that.
|
||||
|
||||
* Each caller of libelf which used to set dest now sets
|
||||
dest_base and dest_size.
|
||||
|
||||
* In xc_dom_load_elf_symtab we provide a new actual-pointer
|
||||
value hdr_ptr which we get from mapping the guest's kernel
|
||||
area and use (checking carefully) as the caller_xdest area.
|
||||
|
||||
* The STAR(h) macro in libelf-dominfo.c now uses elf_access_unsigned.
|
||||
|
||||
* elf-init uses the new elf_uval_3264 accessor to access the 32-bit
|
||||
fields, rather than an unchecked field access (ie, unchecked
|
||||
pointer access).
|
||||
|
||||
* elf_uval has been reworked to use elf_uval_3264. Both of these
|
||||
macros are essentially new in this patch (although they are derived
|
||||
from the old elf_uval) and need careful review.
|
||||
|
||||
* ELF_ADVANCE_DEST is now safe in the sense that you can use it to
|
||||
chop parts off the front of the dest area but if you chop more than
|
||||
is available, the dest area is simply set to be empty, preventing
|
||||
future accesses.
|
||||
|
||||
* We introduce some #defines for memcpy, memset, memmove and strcpy:
|
||||
- We provide elf_memcpy_safe and elf_memset_safe which take
|
||||
PTRVALs and do checking on the supplied pointers.
|
||||
- Users inside libelf must all be changed to either
|
||||
elf_mem*_unchecked (which are just like mem*), or
|
||||
elf_mem*_safe (which take PTRVALs) and are checked. Any
|
||||
unchanged call sites become compilation errors.
|
||||
|
||||
* We do _not_ at this time fix elf_access_unsigned so that it doesn't
|
||||
make unaligned accesses. We hope that unaligned accesses are OK on
|
||||
every supported architecture. But it does check the supplied
|
||||
pointer for validity.
|
||||
|
||||
This is part of the fix to a security issue, XSA-55.
|
||||
|
||||
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
---
|
||||
tools/libxc/xc_dom_elfloader.c | 49 ++++++++--
|
||||
tools/libxc/xc_hvm_build_x86.c | 10 +-
|
||||
xen/arch/x86/domain_build.c | 3 +-
|
||||
xen/common/libelf/libelf-dominfo.c | 2 +-
|
||||
xen/common/libelf/libelf-loader.c | 16 ++--
|
||||
xen/common/libelf/libelf-private.h | 13 +++
|
||||
xen/common/libelf/libelf-tools.c | 106 ++++++++++++++++++-
|
||||
xen/include/xen/libelf.h | 198 +++++++++++++++++++++++++-----------
|
||||
8 files changed, 312 insertions(+), 85 deletions(-)
|
||||
|
||||
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
|
||||
index cc0f206..b82a08c 100644
|
||||
--- a/tools/libxc/xc_dom_elfloader.c
|
||||
+++ b/tools/libxc/xc_dom_elfloader.c
|
||||
@@ -130,20 +130,30 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
|
||||
if ( load )
|
||||
{
|
||||
- size_t allow_size; /* will be used in a forthcoming XSA-55 patch */
|
||||
+ char *hdr_ptr;
|
||||
+ size_t allow_size;
|
||||
+
|
||||
if ( !dom->bsd_symtab_start )
|
||||
return 0;
|
||||
size = dom->kernel_seg.vend - dom->bsd_symtab_start;
|
||||
- hdr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
|
||||
- *(int *)hdr = size - sizeof(int);
|
||||
+ hdr_ptr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
|
||||
+ elf->caller_xdest_base = hdr_ptr;
|
||||
+ elf->caller_xdest_size = allow_size;
|
||||
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
|
||||
+ elf_store_val(elf, int, hdr, size - sizeof(int));
|
||||
}
|
||||
else
|
||||
{
|
||||
+ char *hdr_ptr;
|
||||
+
|
||||
size = sizeof(int) + elf_size(elf, elf->ehdr) +
|
||||
elf_shdr_count(elf) * elf_size(elf, shdr);
|
||||
- hdr = xc_dom_malloc(dom, size);
|
||||
- if ( hdr == NULL )
|
||||
+ hdr_ptr = xc_dom_malloc(dom, size);
|
||||
+ if ( hdr_ptr == NULL )
|
||||
return 0;
|
||||
+ elf->caller_xdest_base = hdr_ptr;
|
||||
+ elf->caller_xdest_size = size;
|
||||
+ hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
|
||||
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
|
||||
}
|
||||
|
||||
@@ -171,9 +181,32 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
ehdr->e_shoff = elf_size(elf, elf->ehdr);
|
||||
ehdr->e_shstrndx = SHN_UNDEF;
|
||||
}
|
||||
- if ( elf_init(&syms, hdr + sizeof(int), size - sizeof(int)) )
|
||||
+ if ( elf->caller_xdest_size < sizeof(int) )
|
||||
+ {
|
||||
+ DOMPRINTF("%s/%s: header size %"PRIx64" too small",
|
||||
+ __FUNCTION__, load ? "load" : "parse",
|
||||
+ (uint64_t)elf->caller_xdest_size);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
|
||||
+ elf->caller_xdest_size - sizeof(int)) )
|
||||
return -1;
|
||||
|
||||
+ /*
|
||||
+ * The caller_xdest_{base,size} and dest_{base,size} need to
|
||||
+ * remain valid so long as each struct elf_image does. The
|
||||
+ * principle we adopt is that these values are set when the
|
||||
+ * memory is allocated or mapped, and cleared when (and if)
|
||||
+ * they are unmapped.
|
||||
+ *
|
||||
+ * Mappings of the guest are normally undone by xc_dom_unmap_all
|
||||
+ * (directly or via xc_dom_release). We do not explicitly clear
|
||||
+ * these because in fact that happens only at the end of
|
||||
+ * xc_dom_boot_image, at which time all of these ELF loading
|
||||
+ * functions have returned. No relevant struct elf_binary*
|
||||
+ * escapes this file.
|
||||
+ */
|
||||
+
|
||||
xc_elf_set_logfile(dom->xch, &syms, 1);
|
||||
|
||||
symtab = dom->bsd_symtab_start + sizeof(int);
|
||||
@@ -312,8 +345,10 @@ static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
|
||||
{
|
||||
struct elf_binary *elf = dom->private_loader;
|
||||
int rc;
|
||||
+ xen_pfn_t pages;
|
||||
|
||||
- elf->dest = xc_dom_seg_to_ptr(dom, &dom->kernel_seg);
|
||||
+ elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
|
||||
+ elf->dest_size = pages * XC_DOM_PAGE_SIZE(dom);
|
||||
rc = elf_load_binary(elf);
|
||||
if ( rc < 0 )
|
||||
{
|
||||
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
|
||||
index 15b603d..ccfd8b5 100644
|
||||
--- a/tools/libxc/xc_hvm_build_x86.c
|
||||
+++ b/tools/libxc/xc_hvm_build_x86.c
|
||||
@@ -104,11 +104,12 @@ static int loadelfimage(
|
||||
for ( i = 0; i < pages; i++ )
|
||||
entries[i].mfn = parray[(elf->pstart >> PAGE_SHIFT) + i];
|
||||
|
||||
- elf->dest = xc_map_foreign_ranges(
|
||||
+ elf->dest_base = xc_map_foreign_ranges(
|
||||
xch, dom, pages << PAGE_SHIFT, PROT_READ | PROT_WRITE, 1 << PAGE_SHIFT,
|
||||
entries, pages);
|
||||
- if ( elf->dest == NULL )
|
||||
+ if ( elf->dest_base == NULL )
|
||||
goto err;
|
||||
+ elf->dest_size = pages * PAGE_SIZE;
|
||||
|
||||
ELF_ADVANCE_DEST(elf, elf->pstart & (PAGE_SIZE - 1));
|
||||
|
||||
@@ -117,8 +118,9 @@ static int loadelfimage(
|
||||
if ( rc < 0 )
|
||||
PERROR("Failed to load elf binary\n");
|
||||
|
||||
- munmap(elf->dest, pages << PAGE_SHIFT);
|
||||
- elf->dest = NULL;
|
||||
+ munmap(elf->dest_base, pages << PAGE_SHIFT);
|
||||
+ elf->dest_base = NULL;
|
||||
+ elf->dest_size = 0;
|
||||
|
||||
err:
|
||||
free(entries);
|
||||
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
|
||||
index 469d363..a655b21 100644
|
||||
--- a/xen/arch/x86/domain_build.c
|
||||
+++ b/xen/arch/x86/domain_build.c
|
||||
@@ -908,7 +908,8 @@ int __init construct_dom0(
|
||||
write_ptbase(v);
|
||||
|
||||
/* Copy the OS image and free temporary buffer. */
|
||||
- elf.dest = (void*)vkern_start;
|
||||
+ elf.dest_base = (void*)vkern_start;
|
||||
+ elf.dest_size = vkern_end - vkern_start;
|
||||
rc = elf_load_binary(&elf);
|
||||
if ( rc < 0 )
|
||||
{
|
||||
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
|
||||
index b217f8f..98c80dc 100644
|
||||
--- a/xen/common/libelf/libelf-dominfo.c
|
||||
+++ b/xen/common/libelf/libelf-dominfo.c
|
||||
@@ -254,7 +254,7 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
int len;
|
||||
|
||||
h = parms->guest_info;
|
||||
-#define STAR(h) (*(h))
|
||||
+#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
|
||||
while ( STAR(h) )
|
||||
{
|
||||
elf_memset_unchecked(name, 0, sizeof(name));
|
||||
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
|
||||
index 0fef84c..a3310e7 100644
|
||||
--- a/xen/common/libelf/libelf-loader.c
|
||||
+++ b/xen/common/libelf/libelf-loader.c
|
||||
@@ -24,23 +24,25 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-int elf_init(struct elf_binary *elf, const char *image, size_t size)
|
||||
+int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
uint64_t i, count, section, offset;
|
||||
|
||||
- if ( !elf_is_elfbinary(image) )
|
||||
+ if ( !elf_is_elfbinary(image_input) )
|
||||
{
|
||||
elf_err(elf, "%s: not an ELF binary\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
elf_memset_unchecked(elf, 0, sizeof(*elf));
|
||||
- elf->image = image;
|
||||
+ elf->image_base = image_input;
|
||||
elf->size = size;
|
||||
- elf->ehdr = (elf_ehdr *)image;
|
||||
- elf->class = elf->ehdr->e32.e_ident[EI_CLASS];
|
||||
- elf->data = elf->ehdr->e32.e_ident[EI_DATA];
|
||||
+ elf->ehdr = ELF_MAKE_HANDLE(elf_ehdr, (elf_ptrval)image_input);
|
||||
+ elf->class = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_CLASS]);
|
||||
+ elf->data = elf_uval_3264(elf, elf->ehdr, e32.e_ident[EI_DATA]);
|
||||
+ elf->caller_xdest_base = NULL;
|
||||
+ elf->caller_xdest_size = 0;
|
||||
|
||||
/* Sanity check phdr. */
|
||||
offset = elf_uval(elf, elf->ehdr, e_phoff) +
|
||||
@@ -300,7 +302,7 @@ int elf_load_binary(struct elf_binary *elf)
|
||||
|
||||
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr)
|
||||
{
|
||||
- return elf->dest + addr - elf->pstart;
|
||||
+ return ELF_REALPTR2PTRVAL(elf->dest_base) + addr - elf->pstart;
|
||||
}
|
||||
|
||||
uint64_t elf_lookup_addr(struct elf_binary * elf, const char *symbol)
|
||||
diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h
|
||||
index 3ef753c..280dfd1 100644
|
||||
--- a/xen/common/libelf/libelf-private.h
|
||||
+++ b/xen/common/libelf/libelf-private.h
|
||||
@@ -86,6 +86,19 @@ do { strncpy((d),(s),sizeof((d))-1); \
|
||||
|
||||
#endif
|
||||
|
||||
+#undef memcpy
|
||||
+#undef memset
|
||||
+#undef memmove
|
||||
+#undef strcpy
|
||||
+
|
||||
+#define memcpy MISTAKE_unspecified_memcpy
|
||||
+#define memset MISTAKE_unspecified_memset
|
||||
+#define memmove MISTAKE_unspecified_memmove
|
||||
+#define strcpy MISTAKE_unspecified_strcpy
|
||||
+ /* This prevents libelf from using these undecorated versions
|
||||
+ * of memcpy, memset, memmove and strcpy. Every call site
|
||||
+ * must either use elf_mem*_unchecked, or elf_mem*_safe. */
|
||||
+
|
||||
#endif /* __LIBELF_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
|
||||
index 3a0cde1..46ca553 100644
|
||||
--- a/xen/common/libelf/libelf-tools.c
|
||||
+++ b/xen/common/libelf/libelf-tools.c
|
||||
@@ -20,28 +20,100 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-uint64_t elf_access_unsigned(struct elf_binary * elf, const void *ptr,
|
||||
- uint64_t offset, size_t size)
|
||||
+void elf_mark_broken(struct elf_binary *elf, const char *msg)
|
||||
{
|
||||
+ if ( elf->broken == NULL )
|
||||
+ elf->broken = msg;
|
||||
+}
|
||||
+
|
||||
+const char *elf_check_broken(const struct elf_binary *elf)
|
||||
+{
|
||||
+ return elf->broken;
|
||||
+}
|
||||
+
|
||||
+static int elf_ptrval_in_range(elf_ptrval ptrval, uint64_t size,
|
||||
+ const void *region, uint64_t regionsize)
|
||||
+ /*
|
||||
+ * Returns true if the putative memory area [ptrval,ptrval+size>
|
||||
+ * is completely inside the region [region,region+regionsize>.
|
||||
+ *
|
||||
+ * ptrval and size are the untrusted inputs to be checked.
|
||||
+ * region and regionsize are trusted and must be correct and valid,
|
||||
+ * although it is OK for region to perhaps be maliciously NULL
|
||||
+ * (but not some other malicious value).
|
||||
+ */
|
||||
+{
|
||||
+ elf_ptrval regionp = (elf_ptrval)region;
|
||||
+
|
||||
+ if ( (region == NULL) ||
|
||||
+ (ptrval < regionp) || /* start is before region */
|
||||
+ (ptrval > regionp + regionsize) || /* start is after region */
|
||||
+ (size > regionsize - (ptrval - regionp)) ) /* too big */
|
||||
+ return 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int elf_access_ok(struct elf_binary * elf,
|
||||
+ uint64_t ptrval, size_t size)
|
||||
+{
|
||||
+ if ( elf_ptrval_in_range(ptrval, size, elf->image_base, elf->size) )
|
||||
+ return 1;
|
||||
+ if ( elf_ptrval_in_range(ptrval, size, elf->dest_base, elf->dest_size) )
|
||||
+ return 1;
|
||||
+ if ( elf_ptrval_in_range(ptrval, size,
|
||||
+ elf->caller_xdest_base, elf->caller_xdest_size) )
|
||||
+ return 1;
|
||||
+ elf_mark_broken(elf, "out of range access");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void elf_memcpy_safe(struct elf_binary *elf, elf_ptrval dst,
|
||||
+ elf_ptrval src, size_t size)
|
||||
+{
|
||||
+ if ( elf_access_ok(elf, dst, size) &&
|
||||
+ elf_access_ok(elf, src, size) )
|
||||
+ {
|
||||
+ /* use memmove because these checks do not prove that the
|
||||
+ * regions don't overlap and overlapping regions grant
|
||||
+ * permission for compiler malice */
|
||||
+ elf_memmove_unchecked(ELF_UNSAFE_PTR(dst), ELF_UNSAFE_PTR(src), size);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void elf_memset_safe(struct elf_binary *elf, elf_ptrval dst, int c, size_t size)
|
||||
+{
|
||||
+ if ( elf_access_ok(elf, dst, size) )
|
||||
+ {
|
||||
+ elf_memset_unchecked(ELF_UNSAFE_PTR(dst), c, size);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
|
||||
+ uint64_t moreoffset, size_t size)
|
||||
+{
|
||||
+ elf_ptrval ptrval = base + moreoffset;
|
||||
int need_swap = elf_swap(elf);
|
||||
const uint8_t *u8;
|
||||
const uint16_t *u16;
|
||||
const uint32_t *u32;
|
||||
const uint64_t *u64;
|
||||
|
||||
+ if ( !elf_access_ok(elf, ptrval, size) )
|
||||
+ return 0;
|
||||
+
|
||||
switch ( size )
|
||||
{
|
||||
case 1:
|
||||
- u8 = ptr + offset;
|
||||
+ u8 = (const void*)ptrval;
|
||||
return *u8;
|
||||
case 2:
|
||||
- u16 = ptr + offset;
|
||||
+ u16 = (const void*)ptrval;
|
||||
return need_swap ? bswap_16(*u16) : *u16;
|
||||
case 4:
|
||||
- u32 = ptr + offset;
|
||||
+ u32 = (const void*)ptrval;
|
||||
return need_swap ? bswap_32(*u32) : *u32;
|
||||
case 8:
|
||||
- u64 = ptr + offset;
|
||||
+ u64 = (const void*)ptrval;
|
||||
return need_swap ? bswap_64(*u64) : *u64;
|
||||
default:
|
||||
return 0;
|
||||
@@ -122,6 +194,28 @@ const char *elf_section_name(struct elf_binary *elf,
|
||||
return elf_strval(elf, elf->sec_strtab + elf_uval(elf, shdr, sh_name));
|
||||
}
|
||||
|
||||
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start)
|
||||
+{
|
||||
+ uint64_t length;
|
||||
+
|
||||
+ for ( length = 0; ; length++ ) {
|
||||
+ if ( !elf_access_ok(elf, start + length, 1) )
|
||||
+ return NULL;
|
||||
+ if ( !elf_access_unsigned(elf, start, length, 1) )
|
||||
+ /* ok */
|
||||
+ return ELF_UNSAFE_PTR(start);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start)
|
||||
+{
|
||||
+ const char *str = elf_strval(elf, start);
|
||||
+
|
||||
+ if ( str == NULL )
|
||||
+ return "(invalid)";
|
||||
+ return str;
|
||||
+}
|
||||
+
|
||||
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr)
|
||||
{
|
||||
return ELF_IMAGE_BASE(elf) + elf_uval(elf, shdr, sh_offset);
|
||||
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
|
||||
index af5b5c5..ddc3ed7 100644
|
||||
--- a/xen/include/xen/libelf.h
|
||||
+++ b/xen/include/xen/libelf.h
|
||||
@@ -57,8 +57,9 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
|
||||
* on this.
|
||||
* This replaces variables which were char*,void*
|
||||
* and their const versions, so we provide four
|
||||
- * different declaration macros:
|
||||
+ * different obsolete declaration macros:
|
||||
* ELF_PTRVAL_{,CONST}{VOID,CHAR}
|
||||
+ * New code can simply use the elf_ptrval typedef.
|
||||
* HANDLE A pointer to a struct. There is one of these types
|
||||
* for each pointer type - that is, for each "structname".
|
||||
* In the arguments to the various HANDLE macros, structname
|
||||
@@ -67,54 +68,66 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
|
||||
* pointers. In the current code attempts to do so will
|
||||
* compile, but in the next patch this will become a
|
||||
* compile error.
|
||||
- * We provide two declaration macros for const and
|
||||
- * non-const pointers.
|
||||
+ * We also provide a second declaration macro for
|
||||
+ * pointers which were to const; this is obsolete.
|
||||
*/
|
||||
|
||||
-#define ELF_REALPTR2PTRVAL(realpointer) (realpointer)
|
||||
+typedef uintptr_t elf_ptrval;
|
||||
+
|
||||
+#define ELF_REALPTR2PTRVAL(realpointer) ((elf_ptrval)(realpointer))
|
||||
/* Converts an actual C pointer into a PTRVAL */
|
||||
|
||||
-#define ELF_HANDLE_DECL_NONCONST(structname) structname *
|
||||
-#define ELF_HANDLE_DECL(structname) const structname *
|
||||
+#define ELF_HANDLE_DECL_NONCONST(structname) structname##_handle /*obsolete*/
|
||||
+#define ELF_HANDLE_DECL(structname) structname##_handle
|
||||
/* Provides a type declaration for a HANDLE. */
|
||||
- /* May only be used to declare ONE variable at a time */
|
||||
|
||||
-#define ELF_PTRVAL_VOID void *
|
||||
-#define ELF_PTRVAL_CHAR char *
|
||||
-#define ELF_PTRVAL_CONST_VOID const void *
|
||||
-#define ELF_PTRVAL_CONST_CHAR const char *
|
||||
- /* Provides a type declaration for a PTRVAL. */
|
||||
- /* May only be used to declare ONE variable at a time */
|
||||
+#define ELF_PTRVAL_VOID elf_ptrval /*obsolete*/
|
||||
+#define ELF_PTRVAL_CHAR elf_ptrval /*obsolete*/
|
||||
+#define ELF_PTRVAL_CONST_VOID elf_ptrval /*obsolete*/
|
||||
+#define ELF_PTRVAL_CONST_CHAR elf_ptrval /*obsolete*/
|
||||
+
|
||||
+#ifdef __XEN__
|
||||
+# define ELF_PRPTRVAL "lu"
|
||||
+ /*
|
||||
+ * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
|
||||
+ * to "u", when in fact uintptr_t is an unsigned long.
|
||||
+ */
|
||||
+#else
|
||||
+# define ELF_PRPTRVAL PRIuPTR
|
||||
+#endif
|
||||
+ /* printf format a la PRId... for a PTRVAL */
|
||||
|
||||
-#define ELF_DEFINE_HANDLE(structname) /* empty */
|
||||
+#define ELF_DEFINE_HANDLE(structname) \
|
||||
+ typedef union { \
|
||||
+ elf_ptrval ptrval; \
|
||||
+ const structname *typeonly; /* for sizeof, offsetof, &c only */ \
|
||||
+ } structname##_handle;
|
||||
/*
|
||||
* This must be invoked for each HANDLE type to define
|
||||
* the actual C type used for that kind of HANDLE.
|
||||
*/
|
||||
|
||||
-#define ELF_PRPTRVAL "p"
|
||||
- /* printf format a la PRId... for a PTRVAL */
|
||||
-
|
||||
-#define ELF_MAKE_HANDLE(structname, ptrval) (ptrval)
|
||||
+#define ELF_MAKE_HANDLE(structname, ptrval) ((structname##_handle){ ptrval })
|
||||
/* Converts a PTRVAL to a HANDLE */
|
||||
|
||||
-#define ELF_IMAGE_BASE(elf) ((elf)->image)
|
||||
+#define ELF_IMAGE_BASE(elf) ((elf_ptrval)(elf)->image_base)
|
||||
/* Returns the base of the image as a PTRVAL. */
|
||||
|
||||
-#define ELF_HANDLE_PTRVAL(handleval) ((void*)(handleval))
|
||||
+#define ELF_HANDLE_PTRVAL(handleval) ((handleval).ptrval)
|
||||
/* Converts a HANDLE to a PTRVAL. */
|
||||
|
||||
-#define ELF_OBSOLETE_VOIDP_CAST (void*)(uintptr_t)
|
||||
+#define ELF_OBSOLETE_VOIDP_CAST /*empty*/
|
||||
/*
|
||||
- * In some places the existing code needs to
|
||||
+ * In some places the old code used to need to
|
||||
* - cast away const (the existing code uses const a fair
|
||||
* bit but actually sometimes wants to write to its input)
|
||||
* from a PTRVAL.
|
||||
* - convert an integer representing a pointer to a PTRVAL
|
||||
- * This macro provides a suitable cast.
|
||||
+ * Nowadays all of these re uintptr_ts so there is no const problem
|
||||
+ * and no need for any casting.
|
||||
*/
|
||||
|
||||
-#define ELF_UNSAFE_PTR(ptrval) ((void*)(uintptr_t)(ptrval))
|
||||
+#define ELF_UNSAFE_PTR(ptrval) ((void*)(elf_ptrval)(ptrval))
|
||||
/*
|
||||
* Turns a PTRVAL into an actual C pointer. Before this is done
|
||||
* the caller must have ensured that the PTRVAL does in fact point
|
||||
@@ -122,18 +135,21 @@ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
|
||||
*/
|
||||
|
||||
/* PTRVALs can be INVALID (ie, NULL). */
|
||||
-#define ELF_INVALID_PTRVAL (NULL) /* returns NULL PTRVAL */
|
||||
+#define ELF_INVALID_PTRVAL ((elf_ptrval)0) /* returns NULL PTRVAL */
|
||||
#define ELF_INVALID_HANDLE(structname) /* returns NULL handle */ \
|
||||
ELF_MAKE_HANDLE(structname, ELF_INVALID_PTRVAL)
|
||||
-#define ELF_PTRVAL_VALID(ptrval) (ptrval) /* } */
|
||||
-#define ELF_HANDLE_VALID(handleval) (handleval) /* } predicates */
|
||||
-#define ELF_PTRVAL_INVALID(ptrval) ((ptrval) == NULL) /* } */
|
||||
+#define ELF_PTRVAL_VALID(ptrval) (!!(ptrval)) /* } */
|
||||
+#define ELF_HANDLE_VALID(handleval) (!!(handleval).ptrval) /* } predicates */
|
||||
+#define ELF_PTRVAL_INVALID(ptrval) (!ELF_PTRVAL_VALID((ptrval))) /* } */
|
||||
+
|
||||
+#define ELF_MAX_PTRVAL (~(elf_ptrval)0)
|
||||
+ /* PTRVAL value guaranteed to compare > to any valid PTRVAL */
|
||||
|
||||
/* For internal use by other macros here */
|
||||
#define ELF__HANDLE_FIELD_TYPE(handleval, elm) \
|
||||
- typeof((handleval)->elm)
|
||||
+ typeof((handleval).typeonly->elm)
|
||||
#define ELF__HANDLE_FIELD_OFFSET(handleval, elm) \
|
||||
- offsetof(typeof(*(handleval)),elm)
|
||||
+ offsetof(typeof(*(handleval).typeonly),elm)
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
@@ -182,7 +198,7 @@ ELF_DEFINE_HANDLE(elf_note)
|
||||
|
||||
struct elf_binary {
|
||||
/* elf binary */
|
||||
- const char *image;
|
||||
+ const void *image_base;
|
||||
size_t size;
|
||||
char class;
|
||||
char data;
|
||||
@@ -190,10 +206,16 @@ struct elf_binary {
|
||||
ELF_HANDLE_DECL(elf_ehdr) ehdr;
|
||||
ELF_PTRVAL_CONST_CHAR sec_strtab;
|
||||
ELF_HANDLE_DECL(elf_shdr) sym_tab;
|
||||
- ELF_PTRVAL_CONST_CHAR sym_strtab;
|
||||
+ uint64_t sym_strtab;
|
||||
|
||||
/* loaded to */
|
||||
- char *dest;
|
||||
+ /*
|
||||
+ * dest_base and dest_size are trusted and must be correct;
|
||||
+ * whenever dest_size is not 0, both of these must be valid
|
||||
+ * so long as the struct elf_binary is in use.
|
||||
+ */
|
||||
+ char *dest_base;
|
||||
+ size_t dest_size;
|
||||
uint64_t pstart;
|
||||
uint64_t pend;
|
||||
uint64_t reloc_offset;
|
||||
@@ -201,12 +223,22 @@ struct elf_binary {
|
||||
uint64_t bsd_symtab_pstart;
|
||||
uint64_t bsd_symtab_pend;
|
||||
|
||||
+ /*
|
||||
+ * caller's other acceptable destination
|
||||
+ *
|
||||
+ * Again, these are trusted and must be valid (or 0) so long
|
||||
+ * as the struct elf_binary is in use.
|
||||
+ */
|
||||
+ void *caller_xdest_base;
|
||||
+ uint64_t caller_xdest_size;
|
||||
+
|
||||
#ifndef __XEN__
|
||||
/* misc */
|
||||
elf_log_callback *log_callback;
|
||||
void *log_caller_data;
|
||||
#endif
|
||||
int verbose;
|
||||
+ const char *broken;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
@@ -224,22 +256,27 @@ struct elf_binary {
|
||||
#define elf_lsb(elf) (ELFDATA2LSB == (elf)->data)
|
||||
#define elf_swap(elf) (NATIVE_ELFDATA != (elf)->data)
|
||||
|
||||
-#define elf_uval(elf, str, elem) \
|
||||
- ((ELFCLASS64 == (elf)->class) \
|
||||
- ? elf_access_unsigned((elf), (str), \
|
||||
- offsetof(typeof(*(str)),e64.elem), \
|
||||
- sizeof((str)->e64.elem)) \
|
||||
- : elf_access_unsigned((elf), (str), \
|
||||
- offsetof(typeof(*(str)),e32.elem), \
|
||||
- sizeof((str)->e32.elem)))
|
||||
+#define elf_uval_3264(elf, handle, elem) \
|
||||
+ elf_access_unsigned((elf), (handle).ptrval, \
|
||||
+ offsetof(typeof(*(handle).typeonly),elem), \
|
||||
+ sizeof((handle).typeonly->elem))
|
||||
+
|
||||
+#define elf_uval(elf, handle, elem) \
|
||||
+ ((ELFCLASS64 == (elf)->class) \
|
||||
+ ? elf_uval_3264(elf, handle, e64.elem) \
|
||||
+ : elf_uval_3264(elf, handle, e32.elem))
|
||||
/*
|
||||
* Reads an unsigned field in a header structure in the ELF.
|
||||
* str is a HANDLE, and elem is the field name in it.
|
||||
*/
|
||||
|
||||
-#define elf_size(elf, str) \
|
||||
+
|
||||
+#define elf_size(elf, handle_or_handletype) ({ \
|
||||
+ typeof(handle_or_handletype) elf_size__dummy; \
|
||||
((ELFCLASS64 == (elf)->class) \
|
||||
- ? sizeof((str)->e64) : sizeof((str)->e32))
|
||||
+ ? sizeof(elf_size__dummy.typeonly->e64) \
|
||||
+ : sizeof(elf_size__dummy.typeonly->e32)); \
|
||||
+})
|
||||
/*
|
||||
* Returns the size of the substructure for the appropriate 32/64-bitness.
|
||||
* str should be a HANDLE.
|
||||
@@ -251,23 +288,37 @@ uint64_t elf_access_unsigned(struct elf_binary *elf, ELF_PTRVAL_CONST_VOID ptr,
|
||||
|
||||
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
|
||||
|
||||
+const char *elf_strval(struct elf_binary *elf, elf_ptrval start);
|
||||
+ /* may return NULL if the string is out of range etc. */
|
||||
|
||||
-#define elf_strval(elf,x) ((const char*)(x)) /* may return NULL in the future */
|
||||
-#define elf_strfmt(elf,x) ((const char*)(x)) /* will return (invalid) instead */
|
||||
+const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start);
|
||||
+ /* like elf_strval but returns "(invalid)" instead of NULL */
|
||||
|
||||
-#define elf_memcpy_safe(elf, dst, src, sz) memcpy((dst),(src),(sz))
|
||||
-#define elf_memset_safe(elf, dst, c, sz) memset((dst),(c),(sz))
|
||||
+void elf_memcpy_safe(struct elf_binary*, elf_ptrval dst, elf_ptrval src, size_t);
|
||||
+void elf_memset_safe(struct elf_binary*, elf_ptrval dst, int c, size_t);
|
||||
/*
|
||||
- * Versions of memcpy and memset which will (in the next patch)
|
||||
- * arrange never to write outside permitted areas.
|
||||
+ * Versions of memcpy and memset which arrange never to write
|
||||
+ * outside permitted areas.
|
||||
*/
|
||||
|
||||
-#define elf_store_val(elf, type, ptr, val) (*(type*)(ptr) = (val))
|
||||
+int elf_access_ok(struct elf_binary * elf,
|
||||
+ uint64_t ptrval, size_t size);
|
||||
+
|
||||
+#define elf_store_val(elf, type, ptr, val) \
|
||||
+ ({ \
|
||||
+ typeof(type) elf_store__val = (val); \
|
||||
+ elf_ptrval elf_store__targ = ptr; \
|
||||
+ if (elf_access_ok((elf), elf_store__targ, \
|
||||
+ sizeof(elf_store__val))) { \
|
||||
+ elf_memcpy_unchecked((void*)elf_store__targ, &elf_store__val, \
|
||||
+ sizeof(elf_store__val)); \
|
||||
+ } \
|
||||
+ }) \
|
||||
/* Stores a value at a particular PTRVAL. */
|
||||
|
||||
-#define elf_store_field(elf, hdr, elm, val) \
|
||||
- (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
|
||||
- &((hdr)->elm), \
|
||||
+#define elf_store_field(elf, hdr, elm, val) \
|
||||
+ (elf_store_val((elf), ELF__HANDLE_FIELD_TYPE(hdr, elm), \
|
||||
+ ELF_HANDLE_PTRVAL(hdr) + ELF__HANDLE_FIELD_OFFSET(hdr, elm), \
|
||||
(val)))
|
||||
/* Stores a 32/64-bit field. hdr is a HANDLE and elm is the field name. */
|
||||
|
||||
@@ -306,6 +357,10 @@ int elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr)
|
||||
/* xc_libelf_loader.c */
|
||||
|
||||
int elf_init(struct elf_binary *elf, const char *image, size_t size);
|
||||
+ /*
|
||||
+ * image and size must be correct. They will be recorded in
|
||||
+ * *elf, and must remain valid while the elf is in use.
|
||||
+ */
|
||||
#ifdef __XEN__
|
||||
void elf_set_verbose(struct elf_binary *elf);
|
||||
#else
|
||||
@@ -321,6 +376,9 @@ uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
|
||||
|
||||
void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart); /* private */
|
||||
|
||||
+void elf_mark_broken(struct elf_binary *elf, const char *msg);
|
||||
+const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
|
||||
+
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_relocate.c */
|
||||
|
||||
@@ -395,16 +453,38 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
int elf_xen_parse(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms);
|
||||
|
||||
-#define elf_memcpy_unchecked memcpy
|
||||
-#define elf_memset_unchecked memset
|
||||
+static inline void *elf_memcpy_unchecked(void *dest, const void *src, size_t n)
|
||||
+ { return memcpy(dest, src, n); }
|
||||
+static inline void *elf_memmove_unchecked(void *dest, const void *src, size_t n)
|
||||
+ { return memmove(dest, src, n); }
|
||||
+static inline void *elf_memset_unchecked(void *s, int c, size_t n)
|
||||
+ { return memset(s, c, n); }
|
||||
/*
|
||||
- * Unsafe versions of memcpy and memset which take actual C
|
||||
- * pointers. These are just like real memcpy and memset.
|
||||
+ * Unsafe versions of memcpy, memmove memset which take actual C
|
||||
+ * pointers. These are just like the real functions.
|
||||
+ * We provide these so that in libelf-private.h we can #define
|
||||
+ * memcpy, memset and memmove to undefined MISTAKE things.
|
||||
*/
|
||||
|
||||
|
||||
-#define ELF_ADVANCE_DEST(elf, amount) elf->dest += (amount)
|
||||
- /* Advances past amount bytes of the current destination area. */
|
||||
+/* Advances past amount bytes of the current destination area. */
|
||||
+static inline void ELF_ADVANCE_DEST(struct elf_binary *elf, uint64_t amount)
|
||||
+{
|
||||
+ if ( elf->dest_base == NULL )
|
||||
+ {
|
||||
+ elf_mark_broken(elf, "advancing in null image");
|
||||
+ }
|
||||
+ else if ( elf->dest_size >= amount )
|
||||
+ {
|
||||
+ elf->dest_base += amount;
|
||||
+ elf->dest_size -= amount;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ elf->dest_size = 0;
|
||||
+ elf_mark_broken(elf, "advancing past end (image very short?)");
|
||||
+ }
|
||||
+}
|
||||
|
||||
|
||||
#endif /* __XEN_LIBELF_H__ */
|
||||
--
|
||||
1.7.2.5
|
||||
|
@ -1,759 +0,0 @@
|
||||
From e673ca50127b6c1263727aa31de0b8bb966ca7a2 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
Date: Fri, 14 Jun 2013 16:43:18 +0100
|
||||
Subject: [PATCH 15/23] libelf: use only unsigned integers
|
||||
|
||||
Signed integers have undesirable undefined behaviours on overflow.
|
||||
Malicious compilers can turn apparently-correct code into code with
|
||||
security vulnerabilities etc.
|
||||
|
||||
So use only unsigned integers. Exceptions are booleans (which we have
|
||||
already changed) and error codes.
|
||||
|
||||
We _do_ change all the chars which aren't fixed constants from our own
|
||||
text segment, but not the char*s. This is because it is safe to
|
||||
access an arbitrary byte through a char*, but not necessarily safe to
|
||||
convert an arbitrary value to a char.
|
||||
|
||||
As a consequence we need to compile libelf with -Wno-pointer-sign.
|
||||
|
||||
It is OK to change all the signed integers to unsigned because all the
|
||||
inequalities in libelf are in contexts where we don't "expect"
|
||||
negative numbers.
|
||||
|
||||
In libelf-dominfo.c:elf_xen_parse we rename a variable "rc" to
|
||||
"more_notes" as it actually contains a note count derived from the
|
||||
input image. The "error" return value from elf_xen_parse_notes is
|
||||
changed from -1 to ~0U.
|
||||
|
||||
grepping shows only one occurrence of "PRId" or "%d" or "%ld" in
|
||||
libelf and xc_dom_elfloader.c (a "%d" which becomes "%u").
|
||||
|
||||
This is part of the fix to a security issue, XSA-55.
|
||||
|
||||
For those concerned about unintentional functional changes, the
|
||||
following rune produces a version of the patch which is much smaller
|
||||
and eliminates only non-functional changes:
|
||||
|
||||
GIT_EXTERNAL_DIFF=.../unsigned-differ git-diff <before>..<after>
|
||||
|
||||
where <before> and <after> are git refs for the code before and after
|
||||
this patch, and unsigned-differ is this shell script:
|
||||
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
seddery () {
|
||||
perl -pe 's/\b(?:elf_errorstatus|elf_negerrnoval)\b/int/g'
|
||||
}
|
||||
|
||||
path="$1"
|
||||
in="$2"
|
||||
out="$5"
|
||||
|
||||
set +e
|
||||
diff -pu --label "$path~" <(seddery <"$in") --label "$path" <(seddery <"$out")
|
||||
rc=$?
|
||||
set -e
|
||||
if [ $rc = 1 ]; then rc=0; fi
|
||||
exit $rc
|
||||
|
||||
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
||||
---
|
||||
tools/libxc/Makefile | 9 +++++-
|
||||
tools/libxc/xc_dom.h | 7 +++--
|
||||
tools/libxc/xc_dom_elfloader.c | 42 ++++++++++++++++-------------
|
||||
tools/xcutils/readnotes.c | 15 +++++-----
|
||||
xen/common/libelf/Makefile | 2 +
|
||||
xen/common/libelf/libelf-dominfo.c | 52 ++++++++++++++++++-----------------
|
||||
xen/common/libelf/libelf-loader.c | 20 +++++++-------
|
||||
xen/common/libelf/libelf-tools.c | 24 ++++++++--------
|
||||
xen/include/xen/libelf.h | 21 ++++++++------
|
||||
9 files changed, 105 insertions(+), 87 deletions(-)
|
||||
|
||||
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
|
||||
index d8c6a60..a3fd90c 100644
|
||||
--- a/tools/libxc/Makefile
|
||||
+++ b/tools/libxc/Makefile
|
||||
@@ -52,8 +52,13 @@ endif
|
||||
vpath %.c ../../xen/common/libelf
|
||||
CFLAGS += -I../../xen/common/libelf
|
||||
|
||||
-GUEST_SRCS-y += libelf-tools.c libelf-loader.c
|
||||
-GUEST_SRCS-y += libelf-dominfo.c
|
||||
+ELF_SRCS-y += libelf-tools.c libelf-loader.c
|
||||
+ELF_SRCS-y += libelf-dominfo.c
|
||||
+
|
||||
+GUEST_SRCS-y += $(ELF_SRCS-y)
|
||||
+
|
||||
+$(patsubst %.c,%.o,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
|
||||
+$(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
|
||||
|
||||
# new domain builder
|
||||
GUEST_SRCS-y += xc_dom_core.c xc_dom_boot.c
|
||||
diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
|
||||
index 9f8037e..0161459 100644
|
||||
--- a/tools/libxc/xc_dom.h
|
||||
+++ b/tools/libxc/xc_dom.h
|
||||
@@ -140,9 +140,10 @@ struct xc_dom_image {
|
||||
|
||||
struct xc_dom_loader {
|
||||
char *name;
|
||||
- int (*probe) (struct xc_dom_image * dom);
|
||||
- int (*parser) (struct xc_dom_image * dom);
|
||||
- int (*loader) (struct xc_dom_image * dom);
|
||||
+ /* Sadly the error returns from these functions are not consistent: */
|
||||
+ elf_negerrnoval (*probe) (struct xc_dom_image * dom);
|
||||
+ elf_negerrnoval (*parser) (struct xc_dom_image * dom);
|
||||
+ elf_errorstatus (*loader) (struct xc_dom_image * dom);
|
||||
|
||||
struct xc_dom_loader *next;
|
||||
};
|
||||
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
|
||||
index 9ba64ae..62a0d3b 100644
|
||||
--- a/tools/libxc/xc_dom_elfloader.c
|
||||
+++ b/tools/libxc/xc_dom_elfloader.c
|
||||
@@ -84,7 +84,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* parse elf binary */
|
||||
|
||||
-static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
|
||||
+static elf_negerrnoval check_elf_kernel(struct xc_dom_image *dom, bool verbose)
|
||||
{
|
||||
if ( dom->kernel_blob == NULL )
|
||||
{
|
||||
@@ -106,12 +106,12 @@ static int check_elf_kernel(struct xc_dom_image *dom, bool verbose)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
|
||||
+static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
|
||||
{
|
||||
return check_elf_kernel(dom, 0);
|
||||
}
|
||||
|
||||
-static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
+static elf_errorstatus xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
struct elf_binary *elf, bool load)
|
||||
{
|
||||
struct elf_binary syms;
|
||||
@@ -119,7 +119,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
xen_vaddr_t symtab, maxaddr;
|
||||
ELF_PTRVAL_CHAR hdr;
|
||||
size_t size;
|
||||
- int h, count, type, i, tables = 0;
|
||||
+ unsigned h, count, type, i, tables = 0;
|
||||
|
||||
if ( elf_swap(elf) )
|
||||
{
|
||||
@@ -140,13 +140,13 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
elf->caller_xdest_base = hdr_ptr;
|
||||
elf->caller_xdest_size = allow_size;
|
||||
hdr = ELF_REALPTR2PTRVAL(hdr_ptr);
|
||||
- elf_store_val(elf, int, hdr, size - sizeof(int));
|
||||
+ elf_store_val(elf, unsigned, hdr, size - sizeof(unsigned));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *hdr_ptr;
|
||||
|
||||
- size = sizeof(int) + elf_size(elf, elf->ehdr) +
|
||||
+ size = sizeof(unsigned) + elf_size(elf, elf->ehdr) +
|
||||
elf_shdr_count(elf) * elf_size(elf, shdr);
|
||||
hdr_ptr = xc_dom_malloc(dom, size);
|
||||
if ( hdr_ptr == NULL )
|
||||
@@ -157,15 +157,15 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
|
||||
}
|
||||
|
||||
- elf_memcpy_safe(elf, hdr + sizeof(int),
|
||||
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned),
|
||||
ELF_IMAGE_BASE(elf),
|
||||
elf_size(elf, elf->ehdr));
|
||||
- elf_memcpy_safe(elf, hdr + sizeof(int) + elf_size(elf, elf->ehdr),
|
||||
+ elf_memcpy_safe(elf, hdr + sizeof(unsigned) + elf_size(elf, elf->ehdr),
|
||||
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
|
||||
elf_shdr_count(elf) * elf_size(elf, shdr));
|
||||
if ( elf_64bit(elf) )
|
||||
{
|
||||
- Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(int));
|
||||
+ Elf64_Ehdr *ehdr = (Elf64_Ehdr *)(hdr + sizeof(unsigned));
|
||||
ehdr->e_phoff = 0;
|
||||
ehdr->e_phentsize = 0;
|
||||
ehdr->e_phnum = 0;
|
||||
@@ -174,22 +174,22 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
}
|
||||
else
|
||||
{
|
||||
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(int));
|
||||
+ Elf32_Ehdr *ehdr = (Elf32_Ehdr *)(hdr + sizeof(unsigned));
|
||||
ehdr->e_phoff = 0;
|
||||
ehdr->e_phentsize = 0;
|
||||
ehdr->e_phnum = 0;
|
||||
ehdr->e_shoff = elf_size(elf, elf->ehdr);
|
||||
ehdr->e_shstrndx = SHN_UNDEF;
|
||||
}
|
||||
- if ( elf->caller_xdest_size < sizeof(int) )
|
||||
+ if ( elf->caller_xdest_size < sizeof(unsigned) )
|
||||
{
|
||||
DOMPRINTF("%s/%s: header size %"PRIx64" too small",
|
||||
__FUNCTION__, load ? "load" : "parse",
|
||||
(uint64_t)elf->caller_xdest_size);
|
||||
return -1;
|
||||
}
|
||||
- if ( elf_init(&syms, elf->caller_xdest_base + sizeof(int),
|
||||
- elf->caller_xdest_size - sizeof(int)) )
|
||||
+ if ( elf_init(&syms, elf->caller_xdest_base + sizeof(unsigned),
|
||||
+ elf->caller_xdest_size - sizeof(unsigned)) )
|
||||
return -1;
|
||||
|
||||
/*
|
||||
@@ -209,7 +209,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
|
||||
xc_elf_set_logfile(dom->xch, &syms, 1);
|
||||
|
||||
- symtab = dom->bsd_symtab_start + sizeof(int);
|
||||
+ symtab = dom->bsd_symtab_start + sizeof(unsigned);
|
||||
maxaddr = elf_round_up(&syms, symtab + elf_size(&syms, syms.ehdr) +
|
||||
elf_shdr_count(&syms) * elf_size(&syms, shdr));
|
||||
|
||||
@@ -255,7 +255,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
size = elf_uval(&syms, shdr, sh_size);
|
||||
maxaddr = elf_round_up(&syms, maxaddr + size);
|
||||
tables++;
|
||||
- DOMPRINTF("%s: h=%d %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
|
||||
+ DOMPRINTF("%s: h=%u %s, size=0x%zx, maxaddr=0x%" PRIx64 "",
|
||||
__FUNCTION__, h,
|
||||
type == SHT_SYMTAB ? "symtab" : "strtab",
|
||||
size, maxaddr);
|
||||
@@ -294,10 +294,14 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
|
||||
+static elf_errorstatus xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
|
||||
+ /*
|
||||
+ * This function sometimes returns -1 for error and sometimes
|
||||
+ * an errno value. ?!?!
|
||||
+ */
|
||||
{
|
||||
struct elf_binary *elf;
|
||||
- int rc;
|
||||
+ elf_errorstatus rc;
|
||||
|
||||
rc = check_elf_kernel(dom, 1);
|
||||
if ( rc != 0 )
|
||||
@@ -358,10 +362,10 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
-static int xc_dom_load_elf_kernel(struct xc_dom_image *dom)
|
||||
+static elf_errorstatus xc_dom_load_elf_kernel(struct xc_dom_image *dom)
|
||||
{
|
||||
struct elf_binary *elf = dom->private_loader;
|
||||
- int rc;
|
||||
+ elf_errorstatus rc;
|
||||
xen_pfn_t pages;
|
||||
|
||||
elf->dest_base = xc_dom_seg_to_ptr_pages(dom, &dom->kernel_seg, &pages);
|
||||
diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
|
||||
index d1f7a30..2ca7732 100644
|
||||
--- a/tools/xcutils/readnotes.c
|
||||
+++ b/tools/xcutils/readnotes.c
|
||||
@@ -70,7 +70,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
|
||||
ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
uint64_t value = elf_note_numeric(elf, note);
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
|
||||
printf("%s: %#*" PRIx64 " (%d bytes)\n",
|
||||
prefix, 2+2*descsz, value, descsz);
|
||||
@@ -79,7 +79,7 @@ static void print_numeric_note(const char *prefix, struct elf_binary *elf,
|
||||
static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
|
||||
ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
|
||||
|
||||
/* XXX should be able to cope with a list of values. */
|
||||
@@ -99,10 +99,10 @@ static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
|
||||
|
||||
}
|
||||
|
||||
-static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
|
||||
+static unsigned print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start, ELF_HANDLE_DECL(elf_note) end)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_note) note;
|
||||
- int notes_found = 0;
|
||||
+ unsigned notes_found = 0;
|
||||
const char *this_note_name;
|
||||
|
||||
for ( note = start; ELF_HANDLE_PTRVAL(note) < ELF_HANDLE_PTRVAL(end); note = elf_note_next(elf, note) )
|
||||
@@ -161,7 +161,7 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
|
||||
break;
|
||||
default:
|
||||
printf("unknown note type %#x\n",
|
||||
- (int)elf_uval(elf, note, type));
|
||||
+ (unsigned)elf_uval(elf, note, type));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -171,12 +171,13 @@ static int print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) start,
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *f;
|
||||
- int fd,h,size,usize,count;
|
||||
+ int fd;
|
||||
+ unsigned h,size,usize,count;
|
||||
void *image,*tmp;
|
||||
struct stat st;
|
||||
struct elf_binary elf;
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
- int notes_found = 0;
|
||||
+ unsigned notes_found = 0;
|
||||
|
||||
struct setup_header *hdr;
|
||||
uint64_t payload_offset, payload_length;
|
||||
diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
|
||||
index 18dc8e2..5bf8f76 100644
|
||||
--- a/xen/common/libelf/Makefile
|
||||
+++ b/xen/common/libelf/Makefile
|
||||
@@ -2,6 +2,8 @@ obj-bin-y := libelf.o
|
||||
|
||||
SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
|
||||
|
||||
+CFLAGS += -Wno-pointer-sign
|
||||
+
|
||||
libelf.o: libelf-temp.o Makefile
|
||||
$(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
|
||||
|
||||
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
|
||||
index 12b6c2a..cdd0d31 100644
|
||||
--- a/xen/common/libelf/libelf-dominfo.c
|
||||
+++ b/xen/common/libelf/libelf-dominfo.c
|
||||
@@ -29,15 +29,15 @@ static const char *const elf_xen_feature_names[] = {
|
||||
[XENFEAT_pae_pgdir_above_4gb] = "pae_pgdir_above_4gb",
|
||||
[XENFEAT_dom0] = "dom0"
|
||||
};
|
||||
-static const int elf_xen_features =
|
||||
+static const unsigned elf_xen_features =
|
||||
sizeof(elf_xen_feature_names) / sizeof(elf_xen_feature_names[0]);
|
||||
|
||||
-int elf_xen_parse_features(const char *features,
|
||||
+elf_errorstatus elf_xen_parse_features(const char *features,
|
||||
uint32_t *supported,
|
||||
uint32_t *required)
|
||||
{
|
||||
- char feature[64];
|
||||
- int pos, len, i;
|
||||
+ unsigned char feature[64];
|
||||
+ unsigned pos, len, i;
|
||||
|
||||
if ( features == NULL )
|
||||
return 0;
|
||||
@@ -94,7 +94,7 @@ int elf_xen_parse_features(const char *features,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xen elf notes */
|
||||
|
||||
-int elf_xen_parse_note(struct elf_binary *elf,
|
||||
+elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms,
|
||||
ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
@@ -125,7 +125,7 @@ int elf_xen_parse_note(struct elf_binary *elf,
|
||||
const char *str = NULL;
|
||||
uint64_t val = 0;
|
||||
unsigned int i;
|
||||
- int type = elf_uval(elf, note, type);
|
||||
+ unsigned type = elf_uval(elf, note, type);
|
||||
|
||||
if ( (type >= sizeof(note_desc) / sizeof(note_desc[0])) ||
|
||||
(note_desc[type].name == NULL) )
|
||||
@@ -216,12 +216,14 @@ int elf_xen_parse_note(struct elf_binary *elf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int elf_xen_parse_notes(struct elf_binary *elf,
|
||||
+#define ELF_NOTE_INVALID (~0U)
|
||||
+
|
||||
+static unsigned elf_xen_parse_notes(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms,
|
||||
ELF_PTRVAL_CONST_VOID start,
|
||||
ELF_PTRVAL_CONST_VOID end)
|
||||
{
|
||||
- int xen_elfnotes = 0;
|
||||
+ unsigned xen_elfnotes = 0;
|
||||
ELF_HANDLE_DECL(elf_note) note;
|
||||
const char *note_name;
|
||||
|
||||
@@ -237,7 +239,7 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
|
||||
if ( strcmp(note_name, "Xen") )
|
||||
continue;
|
||||
if ( elf_xen_parse_note(elf, parms, note) )
|
||||
- return -1;
|
||||
+ return ELF_NOTE_INVALID;
|
||||
xen_elfnotes++;
|
||||
}
|
||||
return xen_elfnotes;
|
||||
@@ -246,12 +248,12 @@ static int elf_xen_parse_notes(struct elf_binary *elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* __xen_guest section */
|
||||
|
||||
-int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
+elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
ELF_PTRVAL_CONST_CHAR h;
|
||||
- char name[32], value[128];
|
||||
- int len;
|
||||
+ unsigned char name[32], value[128];
|
||||
+ unsigned len;
|
||||
|
||||
h = parms->guest_info;
|
||||
#define STAR(h) (elf_access_unsigned(elf, (h), 0, 1))
|
||||
@@ -334,13 +336,13 @@ int elf_xen_parse_guest_info(struct elf_binary *elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* sanity checks */
|
||||
|
||||
-static int elf_xen_note_check(struct elf_binary *elf,
|
||||
+static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
if ( (ELF_PTRVAL_INVALID(parms->elf_note_start)) &&
|
||||
(ELF_PTRVAL_INVALID(parms->guest_info)) )
|
||||
{
|
||||
- int machine = elf_uval(elf, elf->ehdr, e_machine);
|
||||
+ unsigned machine = elf_uval(elf, elf->ehdr, e_machine);
|
||||
if ( (machine == EM_386) || (machine == EM_X86_64) )
|
||||
{
|
||||
elf_err(elf, "%s: ERROR: Not a Xen-ELF image: "
|
||||
@@ -378,7 +380,7 @@ static int elf_xen_note_check(struct elf_binary *elf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int elf_xen_addr_calc_check(struct elf_binary *elf,
|
||||
+static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
if ( (parms->elf_paddr_offset != UNSET_ADDR) &&
|
||||
@@ -464,13 +466,13 @@ static int elf_xen_addr_calc_check(struct elf_binary *elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* glue it all together ... */
|
||||
|
||||
-int elf_xen_parse(struct elf_binary *elf,
|
||||
+elf_errorstatus elf_xen_parse(struct elf_binary *elf,
|
||||
struct elf_dom_parms *parms)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
ELF_HANDLE_DECL(elf_phdr) phdr;
|
||||
- int xen_elfnotes = 0;
|
||||
- int i, count, rc;
|
||||
+ unsigned xen_elfnotes = 0;
|
||||
+ unsigned i, count, more_notes;
|
||||
|
||||
elf_memset_unchecked(parms, 0, sizeof(*parms));
|
||||
parms->virt_base = UNSET_ADDR;
|
||||
@@ -495,13 +497,13 @@ int elf_xen_parse(struct elf_binary *elf,
|
||||
if (elf_uval(elf, phdr, p_offset) == 0)
|
||||
continue;
|
||||
|
||||
- rc = elf_xen_parse_notes(elf, parms,
|
||||
+ more_notes = elf_xen_parse_notes(elf, parms,
|
||||
elf_segment_start(elf, phdr),
|
||||
elf_segment_end(elf, phdr));
|
||||
- if ( rc == -1 )
|
||||
+ if ( more_notes == ELF_NOTE_INVALID )
|
||||
return -1;
|
||||
|
||||
- xen_elfnotes += rc;
|
||||
+ xen_elfnotes += more_notes;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -518,17 +520,17 @@ int elf_xen_parse(struct elf_binary *elf,
|
||||
if ( elf_uval(elf, shdr, sh_type) != SHT_NOTE )
|
||||
continue;
|
||||
|
||||
- rc = elf_xen_parse_notes(elf, parms,
|
||||
+ more_notes = elf_xen_parse_notes(elf, parms,
|
||||
elf_section_start(elf, shdr),
|
||||
elf_section_end(elf, shdr));
|
||||
|
||||
- if ( rc == -1 )
|
||||
+ if ( more_notes == ELF_NOTE_INVALID )
|
||||
return -1;
|
||||
|
||||
- if ( xen_elfnotes == 0 && rc > 0 )
|
||||
+ if ( xen_elfnotes == 0 && more_notes > 0 )
|
||||
elf_msg(elf, "%s: using notes from SHT_NOTE section\n", __FUNCTION__);
|
||||
|
||||
- xen_elfnotes += rc;
|
||||
+ xen_elfnotes += more_notes;
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/xen/common/libelf/libelf-loader.c b/xen/common/libelf/libelf-loader.c
|
||||
index 0dccd4d..c3a9e51 100644
|
||||
--- a/xen/common/libelf/libelf-loader.c
|
||||
+++ b/xen/common/libelf/libelf-loader.c
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-int elf_init(struct elf_binary *elf, const char *image_input, size_t size)
|
||||
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image_input, size_t size)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
uint64_t i, count, section, offset;
|
||||
@@ -114,7 +114,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback *log_callback,
|
||||
elf->verbose = verbose;
|
||||
}
|
||||
|
||||
-static int elf_load_image(struct elf_binary *elf,
|
||||
+static elf_errorstatus elf_load_image(struct elf_binary *elf,
|
||||
ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src,
|
||||
uint64_t filesz, uint64_t memsz)
|
||||
{
|
||||
@@ -129,9 +129,9 @@ void elf_set_verbose(struct elf_binary *elf)
|
||||
elf->verbose = 1;
|
||||
}
|
||||
|
||||
-static int elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
|
||||
+static elf_errorstatus elf_load_image(struct elf_binary *elf, ELF_PTRVAL_VOID dst, ELF_PTRVAL_CONST_VOID src, uint64_t filesz, uint64_t memsz)
|
||||
{
|
||||
- int rc;
|
||||
+ elf_errorstatus rc;
|
||||
if ( filesz > ULONG_MAX || memsz > ULONG_MAX )
|
||||
return -1;
|
||||
/* We trust the dom0 kernel image completely, so we don't care
|
||||
@@ -151,7 +151,7 @@ void elf_parse_bsdsyms(struct elf_binary *elf, uint64_t pstart)
|
||||
{
|
||||
uint64_t sz;
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
- int i, type;
|
||||
+ unsigned i, type;
|
||||
|
||||
if ( !ELF_HANDLE_VALID(elf->sym_tab) )
|
||||
return;
|
||||
@@ -187,7 +187,7 @@ static void elf_load_bsdsyms(struct elf_binary *elf)
|
||||
ELF_PTRVAL_VOID symbase;
|
||||
ELF_PTRVAL_VOID symtab_addr;
|
||||
ELF_HANDLE_DECL_NONCONST(elf_shdr) shdr;
|
||||
- int i, type;
|
||||
+ unsigned i, type;
|
||||
|
||||
if ( !elf->bsd_symtab_pstart )
|
||||
return;
|
||||
@@ -220,7 +220,7 @@ do { \
|
||||
elf_memcpy_safe(elf, ELF_HANDLE_PTRVAL(shdr),
|
||||
ELF_IMAGE_BASE(elf) + elf_uval(elf, elf->ehdr, e_shoff),
|
||||
sz);
|
||||
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
|
||||
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
|
||||
|
||||
for ( i = 0; i < elf_shdr_count(elf); i++ )
|
||||
{
|
||||
@@ -233,10 +233,10 @@ do { \
|
||||
elf_memcpy_safe(elf, maxva, elf_section_start(elf, shdr), sz);
|
||||
/* Mangled to be based on ELF header location. */
|
||||
elf_hdr_elm(elf, shdr, sh_offset, maxva - symtab_addr);
|
||||
- maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (long)maxva + sz);
|
||||
+ maxva = ELF_OBSOLETE_VOIDP_CAST elf_round_up(elf, (unsigned long)maxva + sz);
|
||||
}
|
||||
shdr = ELF_MAKE_HANDLE(elf_shdr, ELF_HANDLE_PTRVAL(shdr) +
|
||||
- (long)elf_uval(elf, elf->ehdr, e_shentsize));
|
||||
+ (unsigned long)elf_uval(elf, elf->ehdr, e_shentsize));
|
||||
}
|
||||
|
||||
/* Write down the actual sym size. */
|
||||
@@ -273,7 +273,7 @@ void elf_parse_binary(struct elf_binary *elf)
|
||||
__FUNCTION__, elf->pstart, elf->pend);
|
||||
}
|
||||
|
||||
-int elf_load_binary(struct elf_binary *elf)
|
||||
+elf_errorstatus elf_load_binary(struct elf_binary *elf)
|
||||
{
|
||||
ELF_HANDLE_DECL(elf_phdr) phdr;
|
||||
uint64_t i, count, paddr, offset, filesz, memsz;
|
||||
diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c
|
||||
index fa58f76..46d4ab1 100644
|
||||
--- a/xen/common/libelf/libelf-tools.c
|
||||
+++ b/xen/common/libelf/libelf-tools.c
|
||||
@@ -122,19 +122,19 @@ uint64_t elf_access_unsigned(struct elf_binary * elf, elf_ptrval base,
|
||||
|
||||
uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr)
|
||||
{
|
||||
- int elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
|
||||
+ uint64_t elf_round = (elf_64bit(elf) ? 8 : 4) - 1;
|
||||
|
||||
return (addr + elf_round) & ~elf_round;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
-int elf_shdr_count(struct elf_binary *elf)
|
||||
+unsigned elf_shdr_count(struct elf_binary *elf)
|
||||
{
|
||||
return elf_uval(elf, elf->ehdr, e_shnum);
|
||||
}
|
||||
|
||||
-int elf_phdr_count(struct elf_binary *elf)
|
||||
+unsigned elf_phdr_count(struct elf_binary *elf)
|
||||
{
|
||||
return elf_uval(elf, elf->ehdr, e_phnum);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
|
||||
uint64_t count = elf_shdr_count(elf);
|
||||
ELF_HANDLE_DECL(elf_shdr) shdr;
|
||||
const char *sname;
|
||||
- int i;
|
||||
+ unsigned i;
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
@@ -156,7 +156,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *n
|
||||
return ELF_INVALID_HANDLE(elf_shdr);
|
||||
}
|
||||
|
||||
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
|
||||
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index)
|
||||
{
|
||||
uint64_t count = elf_shdr_count(elf);
|
||||
ELF_PTRVAL_CONST_VOID ptr;
|
||||
@@ -170,7 +170,7 @@ ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index)
|
||||
return ELF_MAKE_HANDLE(elf_shdr, ptr);
|
||||
}
|
||||
|
||||
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index)
|
||||
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index)
|
||||
{
|
||||
uint64_t count = elf_uval(elf, elf->ehdr, e_phnum);
|
||||
ELF_PTRVAL_CONST_VOID ptr;
|
||||
@@ -264,7 +264,7 @@ ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *sym
|
||||
return ELF_INVALID_HANDLE(elf_sym);
|
||||
}
|
||||
|
||||
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index)
|
||||
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index)
|
||||
{
|
||||
ELF_PTRVAL_CONST_VOID ptr = elf_section_start(elf, elf->sym_tab);
|
||||
ELF_HANDLE_DECL(elf_sym) sym;
|
||||
@@ -280,7 +280,7 @@ const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note
|
||||
|
||||
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
|
||||
return ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_
|
||||
uint64_t elf_note_numeric(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
|
||||
switch (descsz)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
|
||||
unsigned int unitsz, unsigned int idx)
|
||||
{
|
||||
ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
|
||||
- int descsz = elf_uval(elf, note, descsz);
|
||||
+ unsigned descsz = elf_uval(elf, note, descsz);
|
||||
|
||||
if ( descsz % unitsz || idx >= descsz / unitsz )
|
||||
return 0;
|
||||
@@ -324,8 +324,8 @@ uint64_t elf_note_numeric_array(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note
|
||||
|
||||
ELF_HANDLE_DECL(elf_note) elf_note_next(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
|
||||
{
|
||||
- int namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
- int descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
|
||||
+ unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
|
||||
+ unsigned descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
|
||||
|
||||
return ELF_MAKE_HANDLE(elf_note, ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz + descsz);
|
||||
}
|
||||
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
|
||||
index 951430f..87e126a 100644
|
||||
--- a/xen/include/xen/libelf.h
|
||||
+++ b/xen/include/xen/libelf.h
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
+typedef int elf_errorstatus; /* 0: ok; -ve (normally -1): error */
|
||||
+typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */
|
||||
+
|
||||
#undef ELFSIZE
|
||||
#include "elfstructs.h"
|
||||
#ifdef __XEN__
|
||||
@@ -328,12 +331,12 @@ bool elf_access_ok(struct elf_binary * elf,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_tools.c */
|
||||
|
||||
-int elf_shdr_count(struct elf_binary *elf);
|
||||
-int elf_phdr_count(struct elf_binary *elf);
|
||||
+unsigned elf_shdr_count(struct elf_binary *elf);
|
||||
+unsigned elf_phdr_count(struct elf_binary *elf);
|
||||
|
||||
ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_name(struct elf_binary *elf, const char *name);
|
||||
-ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, int index);
|
||||
-ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, int index);
|
||||
+ELF_HANDLE_DECL(elf_shdr) elf_shdr_by_index(struct elf_binary *elf, unsigned index);
|
||||
+ELF_HANDLE_DECL(elf_phdr) elf_phdr_by_index(struct elf_binary *elf, unsigned index);
|
||||
|
||||
const char *elf_section_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr); /* might return NULL if inputs are invalid */
|
||||
ELF_PTRVAL_CONST_VOID elf_section_start(struct elf_binary *elf, ELF_HANDLE_DECL(elf_shdr) shdr);
|
||||
@@ -343,7 +346,7 @@ ELF_PTRVAL_CONST_VOID elf_segment_start(struct elf_binary *elf, ELF_HANDLE_DECL(
|
||||
ELF_PTRVAL_CONST_VOID elf_segment_end(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr);
|
||||
|
||||
ELF_HANDLE_DECL(elf_sym) elf_sym_by_name(struct elf_binary *elf, const char *symbol);
|
||||
-ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, int index);
|
||||
+ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_binary *elf, unsigned index);
|
||||
|
||||
const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note); /* may return NULL */
|
||||
ELF_PTRVAL_CONST_VOID elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note);
|
||||
@@ -360,7 +363,7 @@ bool elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_loader.c */
|
||||
|
||||
-int elf_init(struct elf_binary *elf, const char *image, size_t size);
|
||||
+elf_errorstatus elf_init(struct elf_binary *elf, const char *image, size_t size);
|
||||
/*
|
||||
* image and size must be correct. They will be recorded in
|
||||
* *elf, and must remain valid while the elf is in use.
|
||||
@@ -373,7 +376,7 @@ void elf_set_log(struct elf_binary *elf, elf_log_callback*,
|
||||
#endif
|
||||
|
||||
void elf_parse_binary(struct elf_binary *elf);
|
||||
-int elf_load_binary(struct elf_binary *elf);
|
||||
+elf_errorstatus elf_load_binary(struct elf_binary *elf);
|
||||
|
||||
ELF_PTRVAL_VOID elf_get_ptr(struct elf_binary *elf, unsigned long addr);
|
||||
uint64_t elf_lookup_addr(struct elf_binary *elf, const char *symbol);
|
||||
@@ -386,7 +389,7 @@ const char *elf_check_broken(const struct elf_binary *elf); /* NULL means OK */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_relocate.c */
|
||||
|
||||
-int elf_reloc(struct elf_binary *elf);
|
||||
+elf_errorstatus elf_reloc(struct elf_binary *elf);
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* xc_libelf_dominfo.c */
|
||||
@@ -420,7 +423,7 @@ struct elf_dom_parms {
|
||||
char guest_ver[16];
|
||||
char xen_ver[16];
|
||||
char loader[16];
|
||||
- int pae;
|
||||
+ int pae; /* some kind of enum apparently */
|
||||
bool bsd_symtab;
|
||||
uint64_t virt_base;
|
||||
uint64_t virt_entry;
|
||||
--
|
||||
1.7.2.5
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
DIST gcalcli-2.4.2.tar.gz 1667739 SHA256 bcfaada7092fd988a23659cd285ec40919541bae2d9516daefcbd278f78bbc3b SHA512 ae0d4ddb4befa43df5ebbe434d44719522246725b2950549fcf43969038fcbab76012ee0855c02cb623bfd75351bf7b854ca6f74c34cbc57ca9a28e6d467bed1 WHIRLPOOL 2c58c276b6cc18d2768e9dd9dd88564a84427e6685f3f3809c66b9f0608bc2d60a3a81b961ea1dc6b1d4713ca200402a4cd3fbb5b5f34772cf4b012d364c2926
|
@ -0,0 +1,29 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-misc/gcalcli/gcalcli-2.4.2.ebuild,v 1.2 2013/06/27 03:15:21 robbat2 Exp $
|
||||
|
||||
EAPI=5
|
||||
# google-api-python-client only supports these
|
||||
PYTHON_COMPAT=( python{2_6,2_7} pypy{1_9,2_0} )
|
||||
|
||||
inherit python-r1
|
||||
|
||||
|
||||
DESCRIPTION="Google Calendar Command Line Interface"
|
||||
HOMEPAGE="https://github.com/insanum/gcalcli"
|
||||
SRC_URI="https://github.com/insanum/gcalcli/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-python/python-dateutil
|
||||
dev-python/google-api-python-client
|
||||
dev-python/vobject"
|
||||
|
||||
src_install() {
|
||||
dodoc -r ChangeLog README.md docs
|
||||
python_foreach_impl python_doscript ${PN}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer>
|
||||
<email>robbat2@gentoo.org</email>
|
||||
<name>Robin H. Johnson</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
|
@ -1,2 +1 @@
|
||||
DIST ignuit-0.0.16.tar.gz 499016 SHA256 cfb4de8907662f35eb6044c60b8aa736ecc24bdae0a45fc4574ecb563824d846 SHA512 daf193a92b67dffcf1ff72c5a19a3caf2a4b4318ed90e406518ca1f598b6ebf2266578bdf730933ec6ec3b7ac8440719122a8327583b1ca697807d9a5cff7367 WHIRLPOOL f1f976df0229645004693cfa7318e0385fdea28a5dcb9470bfc98834673d7fa18c6a60c027c8b42e28476bd41fabaf5beef0db652d14b31d1f46a2b26e375520
|
||||
DIST ignuit-2.20.0.tar.gz 541546 SHA256 5dc75cef0707677421c272c430cebf5c3730cbcfaeba6428fe14f6bd085d3630 SHA512 3d3a786ce87e252b1529ba427da52356d43554da6c23dfd3353f91b2c3962a83769431794c433c8ba8478ef48b8ef470a042416c5d2b2c0683711b09c959e106 WHIRLPOOL d93d2acb472bd23721c866f7231d301da8d9ee1f6894d51e1166bdc538ce0b99af2d3a79dd27ca72fd7ca6ab9a5a8b6aefd97d0219292e893ada9bdb7e8dd649
|
||||
|
@ -1,42 +0,0 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-misc/ignuit/ignuit-0.0.16.ebuild,v 1.7 2013/06/14 12:38:03 pinkbyte Exp $
|
||||
|
||||
EAPI="2"
|
||||
|
||||
DESCRIPTION="memorization aid based on the Leitner flashcard system"
|
||||
HOMEPAGE="http://homepages.ihug.co.nz/~trmusson/programs.html#ignuit"
|
||||
SRC_URI="http://homepages.ihug.co.nz/~trmusson/stuff/${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ppc ppc64 x86"
|
||||
IUSE="examples"
|
||||
|
||||
RDEPEND=">=gnome-base/libgnomeui-2.22.1
|
||||
gnome-base/gconf:2
|
||||
gnome-base/libglade:2.0
|
||||
dev-libs/glib:2
|
||||
x11-libs/gtk+:2
|
||||
>=media-libs/gstreamer-0.10.20:0.10
|
||||
dev-libs/libxslt
|
||||
dev-libs/libxml2:2
|
||||
x11-libs/pango
|
||||
app-text/dvipng
|
||||
app-text/scrollkeeper
|
||||
virtual/latex-base
|
||||
>=app-text/gnome-doc-utils-0.3.2"
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
sys-devel/gettext
|
||||
dev-util/intltool"
|
||||
|
||||
src_install() {
|
||||
emake DESTDIR="${D}" install || die "emake install failed."
|
||||
dodoc AUTHORS NEWS README TODO || die "dodoc failed"
|
||||
|
||||
if use examples; then
|
||||
insinto /usr/share/doc/${PF}
|
||||
doins -r examples
|
||||
fi
|
||||
}
|
@ -1 +1,2 @@
|
||||
DIST klavaro-1.9.6.tar.bz2 773462 SHA256 6d7fc916eb83d0381b0719c1525c8ea13a5032abcadd438755c7451b9f071561 SHA512 487110b4abfd5be5503bee82b100be538881acea88f7fefa374aa9f1ec349016ac8c0200e9c6fc1669c110c718ae4f2477a844b169e72eca5dd5750ce933d2ab WHIRLPOOL e49237ad5c4d290f71503c5a27fb368ecd0167ae2e295917dafd2e215e9fdab090267274a99e47eb3ad3881f5ee6483c9a8a0edde85ad1fe26f45c96523a66f5
|
||||
DIST klavaro-1.9.7.tar.bz2 802138 SHA256 4ebe693639ae59e560e0bbc54077c804eae7c495f8a8436fb559cdbdf4e5c1c8 SHA512 1f27d2e1003e03644bc1ac765a56b9416314ce5a7088f8ece7e5abd450a3ac7c084caf7cdbdac4088edc5dedaf94540fc655781126050c1b14fe2939a78d503f WHIRLPOOL 9ef8d76ba8f4344313d3643a480f743c266dcff03e095b162143ce94aa212adb985cba8fa0330958a862adc22b4d9414b13df02f7652f90e56d8b480a54e3295
|
||||
|
@ -0,0 +1,28 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-misc/klavaro/klavaro-1.9.7.ebuild,v 1.1 2013/06/27 13:21:04 xmw Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
AUTOTOOLS_AUTORECONF=yes
|
||||
|
||||
inherit autotools-utils
|
||||
|
||||
DESCRIPTION="Another free touch typing tutor program"
|
||||
HOMEPAGE="http://klavaro.sourceforge.net/"
|
||||
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="net-misc/curl
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/gtkdatabox"
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
sys-devel/gettext
|
||||
|| ( dev-util/gtk-builder-convert <=x11-libs/gtk+-2.24.10:2 )"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${PN}-1.9.5-gold.patch )
|
@ -1,7 +1,10 @@
|
||||
DIST texlive-20110705-source.tar.xz 131207904 SHA256 772d19795fd841737f5b00472810b49d98b3b62373fba67c12c757e95c510da2 SHA512 1efb5713bf80379f5104b41576911a4194d378ce35be5afb568c3b4aff6461b2b22e72fb34bc294021cf14a28d07bab083872f17752441f269f36c50f9363cc1 WHIRLPOOL 11cc5b53dedae8977b5d776f9141a849b23b877b836f56469336018e3529ebbf369c99d534c1d645aa99fe0750968f0089034a232dcf9401967e20afb5ce8dd5
|
||||
DIST texlive-20120701-source.tar.xz 131904044 SHA256 9666617d5dac3e82578e696835cc9f251ee0a56d162d86dff08659ac5dcb6c81 SHA512 0e8653aa21094e079900d17256f0768ac5514690a3725d96923d5fdc7633484d611441df1af8c674b38b9ce6a8845a9004976cd00635742dfc6837aa433caf5f WHIRLPOOL 9d570a1bd58cca8baed399ab53eb767c7c3db607c00363ce563e14dfccdd235703c538e6a651aa7f2934adf21f8477775f1547f9e7f3d957b89af644c89bcb57
|
||||
DIST texlive-20130530-source.tar.xz 179963948 SHA256 a905832e4c04dd1cb16db4bb7baacb78fbc19682bd33ac2697a3a85ce78d79d4 SHA512 4aa85273a675af2453f09777b7cb348c18add77410d72f562c6586f6814d4e7c34b6f3690e3453020654fb0a265339fcabf590d9155367d52846224499af334c WHIRLPOOL 3affaf25d3936505d971599092964b0f0e97d107d22dbac6a85ad547e1d2726a6a09c5075fecb0c6ff8c88bc1bd09d78f95902f76eb76c608f8a7bc42dd6bc33
|
||||
DIST texlive-core-upstream-patches-1.tar.xz 4316 SHA256 0a3eccc79ad608ea543e2ce04adcca0dbe968dbaebaa43014854f51d609659a5 SHA512 a559700fffbe2985b3eade84a9f8f539ba624ab5f92f2127769180073c6f05a9444c11599fef879d0f91aaa8ecbe76f6d4b4ebda2fae83da48074dc888eaa4b6 WHIRLPOOL f62e16fa7ab92c4f7800b48c82383d916f6450f08f6c39765672590e6c52088e252da398855d3b70a3c857a2f975d7b782ae045be083c4124fe84920dd0a4658
|
||||
DIST texlive-module-dvips-2011.tar.xz 93692 SHA256 dbf5c731fa4a0b34db1854b6704f197607253f5716051538bda28db1044bd276 SHA512 9384e20e09c6ca23e17ef7ad220979f0df963b8029c42ca6cdcb2ad8236373ae79486576eac38fa6c7dd5358e15335b058f49fdbb4adcd0ec09ed2138d43c751 WHIRLPOOL f05f98c191bc79c1d8c213ea7583c8556c5720e962061fe628243e458724d8fe542cb906b6b0276b449eeb5709a4fcf35b47f16d205900ab9045b08e83bb3f03
|
||||
DIST texlive-module-dvips-2012.tar.xz 95692 SHA256 9f12bb214eb245061bca42cd79fff999751725e35e972b2aa11439ced23f0d10 SHA512 cc5a5070fd04b501e2fae92864bfe027db2fb01cc5c0087fa62ba71ea044baa1166f5990d8545fc0b6ead130a069f825a6df243028ae1e8e7337d48936676d19 WHIRLPOOL 8c269d5242cb73cdeb83d6c304f9669fe3a7fbffa3faa67e765b5418c1ac8da8d1f3a2c20f9aea47b63734f813057aa99715c038de382f1ef3405e1cbf0a1b68
|
||||
DIST texlive-module-dvips-2013.tar.xz 114352 SHA256 cb3f058a3cfd139624d507f5b6cfdf8fd256978351d83148fa049e62f00f934e SHA512 816bb97b17548149435c5ce546cc84d11731be2c42a632e8146c8091367661be0b03dd939f244aca0d85d2d9706055dd82ca2bad66859043a8c7855b609b4991 WHIRLPOOL f5eabf48ba66113856db2baee6a5617bab35ffa09a4cca42b6c7fdb62b1adc14ae93fb53f8f45ce414bfa38d0630870f05b102e1450bc3b16e12a299a9b1de07
|
||||
DIST texlive-module-dvips.doc-2011.tar.xz 483680 SHA256 15c98b215eb5bee39a4982f3e1d9ef67578f5381c6bb54bc3252bab68f02ec88 SHA512 725fcdc16687d8b67456da2e69a7d23b228339913497cfb0038b7d75e1add36665e4bdf437593772a3cc4488c34866e22ab139946f4dcb502ace63d3052ef72b WHIRLPOOL 0927805b8d53979f07e4478331642f06d6ecb7311326f24bc49ba2504a4e41306bbcd410f2d48a003f7dcbdd3d534d20e5ba8c2279345215ecc3c3541258c1c9
|
||||
DIST texlive-module-dvips.doc-2012.tar.xz 484056 SHA256 247a738b46cd7283179de5bbd8e4ecf330fb145a886580b5ebd5547cee530e9c SHA512 05e0719edd98169982daa4fbf8b943b71b8bf8b4ae4f84ae70015bbff4e7ba2d55c7a4ed4a8ccf081193669ecceeb21dd05476d104d3742be0842b1bba84a4a5 WHIRLPOOL 3af98dc454152c1c0a6abfda19c43a29a8701a4dab3d155b530c2a0e0c0f81db7911de31b491c08b0cca4b8a06172a58796f54a2ea2184ab6371fede7b627edd
|
||||
DIST texlive-module-dvips.doc-2013.tar.xz 484492 SHA256 76dfb96428aee66f6cac7ba1925f245f498e176028f4930c09b7fa7668c3374f SHA512 4886f1156b6984a146e0128b6ba627131dbd3281a9e084ac2852cf3929f1c4f6a302c54ad37734d0b97aae9e45a8193679405e6c33a54a1367fbb793f771c4e8 WHIRLPOOL 8941a5da4b375f9800153550aa32d8376e9519c1fea643a1f8ad24a0a20f81a1957bb0d5cbb8f56186fa12ef70c89ea3bac2af46d4e4d698a22ac78bf41d0943
|
||||
|
@ -0,0 +1,71 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-text/dvipsk/dvipsk-5.993_p20130530.ebuild,v 1.1 2013/06/27 14:16:33 aballier Exp $
|
||||
|
||||
EAPI=4
|
||||
|
||||
#TL_UPSTREAM_PATCHLEVEL="1"
|
||||
|
||||
inherit texlive-common eutils
|
||||
|
||||
DESCRIPTION="DVI-to-PostScript translator"
|
||||
HOMEPAGE="http://tug.org/texlive/"
|
||||
SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz"
|
||||
#SRC_URI="${SRC_URI} mirror://gentoo/texlive-core-upstream-patches-${TL_UPSTREAM_PATCHLEVEL}.tar.xz"
|
||||
|
||||
TL_VERSION=2013
|
||||
EXTRA_TL_MODULES="dvips"
|
||||
EXTRA_TL_DOC_MODULES="dvips.doc"
|
||||
|
||||
for i in ${EXTRA_TL_MODULES} ; do
|
||||
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
|
||||
done
|
||||
|
||||
SRC_URI="${SRC_URI} doc? ( "
|
||||
for i in ${EXTRA_TL_DOC_MODULES} ; do
|
||||
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
|
||||
done
|
||||
SRC_URI="${SRC_URI} ) "
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE="doc source"
|
||||
|
||||
DEPEND=">=dev-libs/kpathsea-6.1.0_p20120701"
|
||||
RDEPEND="
|
||||
!<app-text/texlive-core-2010
|
||||
!<dev-texlive/texlive-basic-2009
|
||||
!app-text/ptex
|
||||
${DEPEND}"
|
||||
|
||||
S=${WORKDIR}/texlive-${PV#*_p}-source/texk/${PN}
|
||||
|
||||
#src_prepare() {
|
||||
# cd "${WORKDIR}/texlive-${PV#*_p}-source/"
|
||||
# EPATCH_MULTI_MSG="Applying patches from upstream bugfix branch..." EPATCH_SUFFIX="patch" epatch "${WORKDIR}/gentoo_branch2011_patches"
|
||||
#}
|
||||
|
||||
src_configure() {
|
||||
econf --with-system-kpathsea
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake DESTDIR="${D}" prologdir="${EPREFIX}/usr/share/texmf-dist/dvips/base" install
|
||||
|
||||
dodir /usr/share # just in case
|
||||
cp -pR "${WORKDIR}"/texmf-dist "${ED}/usr/share/" || die "failed to install texmf trees"
|
||||
if use source ; then
|
||||
cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
|
||||
fi
|
||||
|
||||
dodoc AUTHORS ChangeLog NEWS README TODO
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
etexmf-update
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
etexmf-update
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
Required by http://git.ghostscript.com/?p=mupdf.git;a=commit;f=fitz/dev_list.c;h=f85653219a85a9f91cb14471485611ca5f6b25ba
|
||||
|
||||
--- llpp-9999/link.c
|
||||
+++ llpp-9999/link.c
|
||||
@@ -571,7 +571,7 @@
|
||||
free (page->slinks);
|
||||
}
|
||||
page->freepage (page->u.ptr);
|
||||
- fz_free_display_list (state.ctx, page->dlist);
|
||||
+ fz_drop_display_list (state.ctx, page->dlist);
|
||||
free (page);
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
--- llpp-9999/work/llpp-9999/link.c
|
||||
+++ llpp-9999/work/llpp-9999/link.c
|
||||
@@ -30,12 +30,10 @@
|
||||
#include <caml/memory.h>
|
||||
#include <caml/unixsupport.h>
|
||||
|
||||
-#include <fitz.h>
|
||||
-#include <mupdf.h>
|
||||
-#include <mupdf-internal.h>
|
||||
-#include <muxps.h>
|
||||
-#include <muxps-internal.h>
|
||||
-#include <mucbz.h>
|
||||
+#include <mupdf/cbz.h>
|
||||
+#include <mupdf/fitz.h>
|
||||
+#include <mupdf/pdf.h>
|
||||
+#include <mupdf/xps.h>
|
||||
|
||||
#include FT_FREETYPE_H
|
||||
|
@ -0,0 +1,265 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/mysql-5.1.70.ebuild,v 1.1 2013/06/27 01:59:07 robbat2 Exp $
|
||||
|
||||
EAPI="4"
|
||||
|
||||
MY_EXTRAS_VER="20130626-0127Z"
|
||||
# PBXT
|
||||
PBXT_VERSION='1.0.11-6-pre-ga'
|
||||
# XtraDB
|
||||
PERCONA_VER='5.1.45-10' XTRADB_VER='1.0.6-10'
|
||||
|
||||
# Build type
|
||||
BUILD="autotools"
|
||||
|
||||
inherit toolchain-funcs mysql-v2
|
||||
|
||||
# only to make repoman happy. it is really set in the eclass
|
||||
IUSE="$IUSE"
|
||||
|
||||
# REMEMBER: also update eclass/mysql*.eclass before committing!
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-solaris"
|
||||
|
||||
# When MY_EXTRAS is bumped, the index should be revised to exclude these.
|
||||
# This is often broken still
|
||||
EPATCH_EXCLUDE=''
|
||||
|
||||
# Most of these are in the eclass
|
||||
DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
|
||||
>=sys-devel/libtool-2.2.10"
|
||||
RDEPEND="${RDEPEND}"
|
||||
|
||||
# Please do not add a naive src_unpack to this ebuild
|
||||
# If you want to add a single patch, copy the ebuild to an overlay
|
||||
# and create your own mysql-extras tarball, looking at 000_index.txt
|
||||
src_prepare() {
|
||||
sed -i \
|
||||
-e '/^noinst_PROGRAMS/s/basic-t//g' \
|
||||
"${S}"/unittest/mytap/t/Makefile.am
|
||||
mysql-v2_src_prepare
|
||||
}
|
||||
|
||||
# Official test instructions:
|
||||
# USE='berkdb -cluster embedded extraengine perl ssl community' \
|
||||
# FEATURES='test userpriv -usersandbox' \
|
||||
# ebuild mysql-X.X.XX.ebuild \
|
||||
# digest clean package
|
||||
src_test() {
|
||||
# Bug #213475 - MySQL _will_ object strenously if your machine is named
|
||||
# localhost. Also causes weird failures.
|
||||
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
|
||||
|
||||
emake check || die "make check failed"
|
||||
if ! use "minimal" ; then
|
||||
if [[ $UID -eq 0 ]]; then
|
||||
die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
|
||||
fi
|
||||
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
|
||||
cd "${S}"
|
||||
einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
||||
local retstatus_unit
|
||||
local retstatus_ns
|
||||
local retstatus_ps
|
||||
local t
|
||||
addpredict /this-dir-does-not-exist/t9.MYI
|
||||
|
||||
# Ensure that parallel runs don't die
|
||||
export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
|
||||
|
||||
# archive_gis really sucks a lot, but it's only relevant for the
|
||||
# USE=extraengines case
|
||||
case ${PV} in
|
||||
5.0.42)
|
||||
mysql-v2_disable_test "archive_gis" "Totally broken in 5.0.42"
|
||||
;;
|
||||
|
||||
5.0.4[3-9]|5.0.[56]*|5.0.70|5.0.87)
|
||||
[ "$(tc-endian)" == "big" ] && \
|
||||
mysql-v2_disable_test \
|
||||
"archive_gis" \
|
||||
"Broken in 5.0.43-70 and 5.0.87 on big-endian boxes only"
|
||||
;;
|
||||
esac
|
||||
|
||||
# This was a slight testcase breakage when the read_only security issue
|
||||
# was fixed.
|
||||
case ${PV} in
|
||||
5.0.54|5.0.51*)
|
||||
mysql-v2_disable_test \
|
||||
"read_only" \
|
||||
"Broken in 5.0.51-54, output in wrong order"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Ditto to read_only
|
||||
[ "${PV}" == "5.0.51a" ] && \
|
||||
mysql-v2_disable_test \
|
||||
"view" \
|
||||
"Broken in 5.0.51, output in wrong order"
|
||||
|
||||
# x86-specific, OOM issue with some subselects on low memory servers
|
||||
[ "${PV}" == "5.0.54" ] && \
|
||||
[ "${ARCH/x86}" != "${ARCH}" ] && \
|
||||
mysql-v2_disable_test \
|
||||
"subselect" \
|
||||
"Testcase needs tuning on x86 for oom condition"
|
||||
|
||||
# Broke with the YaSSL security issue that didn't affect Gentoo.
|
||||
[ "${PV}" == "5.0.56" ] && \
|
||||
for t in openssl_1 rpl_openssl rpl_ssl ssl \
|
||||
ssl_8k_key ssl_compress ssl_connect ; do \
|
||||
mysql-v2_disable_test \
|
||||
"$t" \
|
||||
"OpenSSL tests broken on 5.0.56"
|
||||
done
|
||||
|
||||
# New test was broken in first time
|
||||
# Upstream bug 41066
|
||||
# http://bugs.mysql.com/bug.php?id=41066
|
||||
[ "${PV}" == "5.0.72" ] && \
|
||||
mysql-v2_disable_test \
|
||||
"status2" \
|
||||
"Broken in 5.0.72, new test is broken, upstream bug #41066"
|
||||
|
||||
# The entire 5.0 series has pre-generated SSL certificates, they have
|
||||
# mostly expired now. ${S}/mysql-tests/std-data/*.pem
|
||||
# The certs really SHOULD be generated for the tests, so that they are
|
||||
# not expiring like this. We cannot do so ourselves as the tests look
|
||||
# closely as the cert path data, and we do not have the CA key to regen
|
||||
# ourselves. Alternatively, upstream should generate them with at least
|
||||
# 50-year validity.
|
||||
#
|
||||
# Known expiry points:
|
||||
# 4.1.*, 5.0.0-5.0.22, 5.1.7: Expires 2013/09/09
|
||||
# 5.0.23-5.0.77, 5.1.7-5.1.22?: Expires 2009/01/27
|
||||
# 5.0.78-5.0.90, 5.1.??-5.1.42: Expires 2010/01/28
|
||||
#
|
||||
# mysql-test/std_data/untrusted-cacert.pem is MEANT to be
|
||||
# expired/invalid.
|
||||
case ${PV} in
|
||||
5.0.*|5.1.*|5.4.*|5.5.*)
|
||||
for t in openssl_1 rpl_openssl rpl.rpl_ssl rpl.rpl_ssl1 ssl ssl_8k_key \
|
||||
ssl_compress ssl_connect rpl.rpl_heartbeat_ssl ; do \
|
||||
mysql-v2_disable_test \
|
||||
"$t" \
|
||||
"These OpenSSL tests break due to expired certificates"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
# These are also failing in MySQL 5.1 for now, and are believed to be
|
||||
# false positives:
|
||||
#
|
||||
# main.mysql_comment, main.mysql_upgrade, main.information_schema,
|
||||
# funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers:
|
||||
# fails due to USE=-latin1 / utf8 default
|
||||
#
|
||||
# main.mysql_client_test:
|
||||
# segfaults at random under Portage only, suspect resource limits.
|
||||
#
|
||||
# main.not_partition:
|
||||
# Failure reason unknown at this time, must resolve before package.mask
|
||||
# removal FIXME
|
||||
case ${PV} in
|
||||
5.1.*|5.4.*|5.5.*)
|
||||
for t in main.mysql_client_test main.mysql_comments \
|
||||
main.mysql_upgrade \
|
||||
main.information_schema \
|
||||
main.not_partition funcs_1.is_columns_mysql \
|
||||
funcs_1.is_tables_mysql funcs_1.is_triggers; do
|
||||
mysql-v2_disable_test "$t" "False positives in Gentoo"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
# New failures in 5.1.50/5.1.51, reported by jmbsvicetto.
|
||||
# These tests are picking up a 'connect-timeout' config from somewhere,
|
||||
# which is not valid, and since it does not have 'loose-' in front of
|
||||
# it, it's causing a failure
|
||||
case ${PV} in
|
||||
5.1.5*|5.4.*|5.5.*|6*)
|
||||
for t in rpl.rpl_mysql_upgrade main.log_tables_upgrade ; do
|
||||
mysql-v2_disable_test "$t" \
|
||||
"False positives in Gentoo: connect-timeout"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
use profiling && use community \
|
||||
|| mysql-v2_disable_test main.profiling \
|
||||
"Profiling test needs profiling support"
|
||||
|
||||
if [ "${PN}" == "mariadb" ]; then
|
||||
for t in \
|
||||
parts.part_supported_sql_func_ndb \
|
||||
parts.partition_auto_increment_ndb ; do
|
||||
mysql-v2_disable_test $t "ndb not supported in mariadb"
|
||||
done
|
||||
fi
|
||||
|
||||
# This fail with XtraDB in place of normal InnoDB
|
||||
# TODO: test if they are broken with the rest of the Percona patches
|
||||
if xtradb_patch_available && use xtradb ; then
|
||||
for t in main.innodb innodb.innodb_bug51378 \
|
||||
main.information_schema_db main.mysqlshow \
|
||||
main.innodb-autoinc main.innodb_bug21704 \
|
||||
main.innodb_bug44369 main.innodb_bug46000 \
|
||||
main.index_merge_innodb \
|
||||
innodb.innodb innodb.innodb_misc1 innodb.innodb_bug52663 \
|
||||
innodb.innodb-autoinc innodb.innodb-autoinc-44030 \
|
||||
innodb.innodb_bug21704 innodb.innodb_bug44369 \
|
||||
innodb.innodb_bug46000 innodb.innodb_bug48024 \
|
||||
innodb.innodb_bug49164 innodb.innodb_bug51920 \
|
||||
innodb.innodb_bug54044 \
|
||||
; do
|
||||
mysql-v2_disable_test $t "tests broken in xtradb"
|
||||
done
|
||||
fi
|
||||
|
||||
if ! use extraengine ; then
|
||||
# bug 332565
|
||||
for t in main.range ; do
|
||||
mysql-v2_disable_test $t "Test $t requires USE=extraengine"
|
||||
done
|
||||
# bug 401673
|
||||
for t in federated.federated_plugin ; do
|
||||
mysql-v2_disable_test $t "Test $t requires USE=extraengine (Need federated engine)"
|
||||
done
|
||||
fi
|
||||
|
||||
# create directories because mysqladmin might make out of order
|
||||
mkdir -p "${S}"/mysql-test/var-{ps,ns}{,/log}
|
||||
|
||||
# We run the test protocols seperately
|
||||
emake test-unit
|
||||
retstatus_unit=$?
|
||||
[[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed"
|
||||
|
||||
emake test-ns force="--force --vardir=${S}/mysql-test/var-ns"
|
||||
retstatus_ns=$?
|
||||
[[ $retstatus_ns -eq 0 ]] || eerror "test-ns failed"
|
||||
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
|
||||
|
||||
emake test-ps force="--force --vardir=${S}/mysql-test/var-ps"
|
||||
retstatus_ps=$?
|
||||
[[ $retstatus_ps -eq 0 ]] || eerror "test-ps failed"
|
||||
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
|
||||
|
||||
# TODO:
|
||||
# When upstream enables the pr and nr testsuites, we need those as well.
|
||||
|
||||
# Cleanup is important for these testcases.
|
||||
pkill -9 -f "${S}/ndb" 2>/dev/null
|
||||
pkill -9 -f "${S}/sql" 2>/dev/null
|
||||
failures=""
|
||||
[[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
|
||||
[[ $retstatus_ns -eq 0 ]] || failures="${failures} test-ns"
|
||||
[[ $retstatus_ps -eq 0 ]] || failures="${failures} test-ps"
|
||||
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox"
|
||||
[[ -z "$failures" ]] || die "Test failures: $failures"
|
||||
einfo "Tests successfully completed"
|
||||
else
|
||||
einfo "Skipping server tests due to minimal build."
|
||||
fi
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-java/gcj-jdk/gcj-jdk-4.7.3.ebuild,v 1.1 2013/06/27 10:52:04 tomwij Exp $
|
||||
|
||||
EAPI="5"
|
||||
|
||||
inherit java-vm-2 multilib
|
||||
|
||||
DESCRIPTION="Java wrappers around GCJ"
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="GPL-2"
|
||||
KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86 ~x86-linux"
|
||||
SLOT="0"
|
||||
IUSE="X"
|
||||
|
||||
ECJ_GCJ_SLOT="3.6"
|
||||
|
||||
RDEPEND="
|
||||
~sys-devel/gcc-${PV}[gcj]
|
||||
X? ( ~sys-devel/gcc-${PV}[gtk] )
|
||||
dev-java/ecj-gcj:${ECJ_GCJ_SLOT}"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
S="${WORKDIR}"
|
||||
|
||||
src_install() {
|
||||
# jre lib paths ...
|
||||
local libarch="$(get_system_arch)"
|
||||
local gcc_version=${PV}
|
||||
local gccbin=$(gcc-config -B ${gcc_version})
|
||||
gccbin=${gccbin#"${EPREFIX}"}
|
||||
local gcclib=$(gcc-config -L ${gcc_version} | cut -d':' -f1)
|
||||
gcclib=${gcclib#"${EPREFIX}"}
|
||||
local gcjhome="/usr/$(get_libdir)/${P}"
|
||||
local gccchost="${CHOST}"
|
||||
local gcjlibdir=$(echo "${EPREFIX}"/usr/$(get_libdir)/gcj-${gcc_version}-*)
|
||||
gcjlibdir=${gcjlibdir#"${EPREFIX}"}
|
||||
|
||||
# links
|
||||
dodir ${gcjhome}/bin
|
||||
dodir ${gcjhome}/jre/bin
|
||||
dosym ${gccbin}/gij ${gcjhome}/bin/java
|
||||
dosym ${gccbin}/gij ${gcjhome}/jre/bin/java
|
||||
dosym ${gccbin}/gjar ${gcjhome}/bin/jar
|
||||
dosym ${gccbin}/gjdoc ${gcjhome}/bin/javadoc
|
||||
dosym ${gccbin}/grmic ${gcjhome}/bin/rmic
|
||||
dosym ${gccbin}/gjavah ${gcjhome}/bin/javah
|
||||
dosym ${gccbin}/jcf-dump ${gcjhome}/bin/javap
|
||||
dosym ${gccbin}/gappletviewer ${gcjhome}/bin/appletviewer
|
||||
dosym ${gccbin}/gjarsigner ${gcjhome}/bin/jarsigner
|
||||
dosym ${gccbin}/grmiregistry ${gcjhome}/bin/rmiregistry
|
||||
dosym ${gccbin}/grmiregistry ${gcjhome}/jre/bin/rmiregistry
|
||||
dosym ${gccbin}/gkeytool ${gcjhome}/bin/keytool
|
||||
dosym ${gccbin}/gkeytool ${gcjhome}/jre/bin/keytool
|
||||
dosym ${gccbin}/gnative2ascii ${gcjhome}/bin/native2ascii
|
||||
dosym ${gccbin}/gorbd ${gcjhome}/bin/orbd
|
||||
dosym ${gccbin}/gorbd ${gcjhome}/jre/bin/orbd
|
||||
dosym ${gccbin}/grmid ${gcjhome}/bin/rmid
|
||||
dosym ${gccbin}/grmid ${gcjhome}/jre/bin/rmid
|
||||
dosym ${gccbin}/gserialver ${gcjhome}/bin/serialver
|
||||
dosym ${gccbin}/gtnameserv ${gcjhome}/bin/tnameserv
|
||||
dosym ${gccbin}/gtnameserv ${gcjhome}/jre/bin/tnameserv
|
||||
|
||||
dodir ${gcjhome}/jre/lib/${libarch}/client
|
||||
dodir ${gcjhome}/jre/lib/${libarch}/server
|
||||
dosym ${gcjlibdir}/libjvm.so ${gcjhome}/jre/lib/${libarch}/client/libjvm.so
|
||||
dosym ${gcjlibdir}/libjvm.so ${gcjhome}/jre/lib/${libarch}/server/libjvm.so
|
||||
use X && dosym ${gcjlibdir}/libjawt.so ${gcjhome}/jre/lib/${libarch}/libjawt.so
|
||||
|
||||
dosym /usr/share/gcc-data/${gccchost}/${gcc_version}/java/libgcj-${gcc_version/_/-}.jar \
|
||||
${gcjhome}/jre/lib/rt.jar
|
||||
dodir ${gcjhome}/lib
|
||||
dosym /usr/share/gcc-data/${gccchost}/${gcc_version}/java/libgcj-tools-${gcc_version/_/-}.jar \
|
||||
${gcjhome}/lib/tools.jar
|
||||
dosym ${gcclib}/include ${gcjhome}
|
||||
|
||||
dosym /usr/bin/ecj-gcj-${ECJ_GCJ_SLOT} ${gcjhome}/bin/javac
|
||||
|
||||
set_java_env
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Do not set as system VM (see below)
|
||||
# java-vm-2_pkg_postinst
|
||||
|
||||
ewarn "gcj does not currently provide all the 1.5 APIs."
|
||||
ewarn "See http://builder.classpath.org/japi/libgcj-jdk15.html"
|
||||
ewarn "Check for existing bugs relating to missing APIs and file"
|
||||
ewarn "new ones at http://gcc.gnu.org/bugzilla/"
|
||||
ewarn
|
||||
ewarn "Due to this and limited manpower, we currently cannot support"
|
||||
ewarn "using gcj-jdk as a system VM. Its main purpose is to bootstrap"
|
||||
ewarn "IcedTea without prior binary VM installation. To do that, execute:"
|
||||
ewarn
|
||||
ewarn "emerge -o icedtea && emerge icedtea"
|
||||
}
|
@ -0,0 +1,161 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/fpc/fpc-2.6.0-r1.ebuild,v 1.1 2013/06/26 22:47:51 hasufell Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
HOMEPAGE="http://www.freepascal.org/"
|
||||
DESCRIPTION="Free Pascal Compiler"
|
||||
SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
|
||||
amd64? ( mirror://sourceforge/freepascal/${P}.x86_64-linux.tar )
|
||||
arm? ( mirror://sourceforge/freepascal/${P}.arm-linux.tar )
|
||||
ppc? ( mirror://sourceforge/freepascal/${P}.powerpc-linux.tar )
|
||||
ppc64? ( mirror://sourceforge/freepascal/${P}.powerpc64-linux.tar )
|
||||
sparc? ( mirror://sourceforge/freepascal/${PN}-2.2.4.sparc-linux.tar )
|
||||
x86? ( mirror://sourceforge/freepascal/${P}.i386-linux.tar )
|
||||
doc? ( mirror://sourceforge/freepascal/Documentation/${PV}/doc-html.tar.gz -> ${P}-doc-html.tar.gz
|
||||
http://dev.gentoo.org/~radhermit/distfiles/${P}-fpctoc.htx.bz2 )"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
|
||||
KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
|
||||
IUSE="doc ide source"
|
||||
|
||||
RDEPEND="ide? ( !dev-lang/fpc-ide )"
|
||||
|
||||
RESTRICT="strip" #269221
|
||||
|
||||
S=${WORKDIR}/fpcbuild-${PV}/fpcsrc
|
||||
|
||||
src_unpack() {
|
||||
case ${ARCH} in
|
||||
amd64) FPC_ARCH="x86_64" PV_BIN=${PV} ;;
|
||||
arm) FPC_ARCH="arm" PV_BIN=${PV} ;;
|
||||
ppc) FPC_ARCH="powerpc" PV_BIN=${PV} ;;
|
||||
ppc64) FPC_ARCH="powerpc64" PV_BIN=${PV} ;;
|
||||
sparc) FPC_ARCH="sparc" PV_BIN=2.2.4 ;;
|
||||
x86) FPC_ARCH="i386" PV_BIN=${PV} ;;
|
||||
*) die "This ebuild doesn't support ${ARCH}." ;;
|
||||
esac
|
||||
|
||||
unpack ${A}
|
||||
|
||||
tar -xf ${P}.${FPC_ARCH}-linux/binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
|
||||
tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
find "${WORKDIR}" -name Makefile -exec sed -i -e 's/ -Xs / /g' {} + || die
|
||||
|
||||
# let the pkg manager compress man files
|
||||
sed -i '/find man.* gzip /d' "${WORKDIR}"/fpcbuild-${PV}/install/man/Makefile || die
|
||||
}
|
||||
|
||||
set_pp() {
|
||||
case ${ARCH} in
|
||||
amd64) FPC_ARCH="x64" ;;
|
||||
arm) FPC_ARCH="arm" ;;
|
||||
ppc) FPC_ARCH="ppc" ;;
|
||||
ppc64) FPC_ARCH="ppc64" ;;
|
||||
sparc) FPC_ARCH="sparc" ;;
|
||||
x86) FPC_ARCH="386" ;;
|
||||
*) die "This ebuild doesn't support ${ARCH}." ;;
|
||||
esac
|
||||
|
||||
case ${1} in
|
||||
bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
|
||||
new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
|
||||
*) die "set_pp: unknown argument: ${1}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local pp
|
||||
|
||||
# Using the bootstrap compiler.
|
||||
set_pp bootstrap
|
||||
|
||||
emake -j1 PP="${pp}" compiler_cycle
|
||||
|
||||
# Save new compiler from cleaning...
|
||||
cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new || die
|
||||
|
||||
# ...rebuild with current version...
|
||||
emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle
|
||||
|
||||
# ..and clean up afterwards
|
||||
rm "${S}"/ppc${FPC_ARCH}.new || die
|
||||
|
||||
# Using the new compiler.
|
||||
set_pp new
|
||||
|
||||
emake -j1 PP="${pp}" rtl_clean
|
||||
|
||||
emake -j1 PP="${pp}" rtl packages_all utils
|
||||
|
||||
if use ide ; then
|
||||
cd "${S}"/ide || die
|
||||
emake -j1 PP="${pp}"
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local pp
|
||||
set_pp new
|
||||
|
||||
set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/fpcmake" \
|
||||
INSTALL_PREFIX="${D}"/usr \
|
||||
INSTALL_DOCDIR="${D}"/usr/share/doc/${PF} \
|
||||
INSTALL_MANDIR="${D}"/usr/share/man \
|
||||
INSTALL_SOURCEDIR="${D}"/usr/lib/fpc/${PV}/source
|
||||
|
||||
emake -j1 "$@" compiler_install rtl_install packages_install utils_install
|
||||
|
||||
dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
|
||||
|
||||
cd "${S}"/../install/doc || die
|
||||
emake -j1 "$@" installdoc
|
||||
|
||||
cd "${S}"/../install/man || die
|
||||
emake -j1 "$@" installman
|
||||
|
||||
if use doc ; then
|
||||
cd "${S}"/../../doc || die
|
||||
dodoc -r *
|
||||
newdoc "${WORKDIR}"/${P}-fpctoc.htx fpctoc.htx
|
||||
docompress -x /usr/share/doc/${PF}/fpctoc.htx
|
||||
fi
|
||||
|
||||
if use ide ; then
|
||||
cd "${S}"/ide
|
||||
emake -j1 "$@" install
|
||||
fi
|
||||
|
||||
if use source ; then
|
||||
cd "${S}" || die
|
||||
shift
|
||||
emake -j1 PP="${D}"/usr/bin/ppc${FPC_ARCH} "$@" sourceinstall
|
||||
find "${D}"/usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
|
||||
fi
|
||||
|
||||
"${D}"/usr/lib/fpc/${PV}/samplecfg "${D}"/usr/lib/fpc/${PV} "${D}"/etc || die
|
||||
|
||||
sed -i "s:${D}::g" "${D}"/etc/fpc.cfg || die
|
||||
|
||||
if use ide ; then
|
||||
sed -e "s:${D}::g" \
|
||||
-i "${D}"/etc/fppkg.cfg \
|
||||
-i "${D}"/etc/fppkg/* \
|
||||
-i "${D}"/usr/lib/fpc/${PV}/ide/text/fp*.cfg \
|
||||
|| die
|
||||
fi
|
||||
|
||||
rm -r "${D}"/usr/lib/fpc/lexyacc || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] && use ide; then
|
||||
einfo "To read the documentation in the fpc IDE, enable the doc USE flag"
|
||||
einfo "and add /usr/share/doc/${PF}/fpctoc.htx to the Help Files list."
|
||||
fi
|
||||
}
|
@ -0,0 +1,161 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/fpc/fpc-2.6.2.ebuild,v 1.1 2013/06/26 22:20:08 radhermit Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
HOMEPAGE="http://www.freepascal.org/"
|
||||
DESCRIPTION="Free Pascal Compiler"
|
||||
SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
|
||||
amd64? ( mirror://sourceforge/freepascal/${P}.x86_64-linux.tar )
|
||||
arm? ( mirror://sourceforge/freepascal/${P}.arm-linux.tar )
|
||||
ppc? ( mirror://sourceforge/freepascal/${P}.powerpc-linux.tar )
|
||||
ppc64? ( mirror://sourceforge/freepascal/${P}.powerpc64-linux.tar )
|
||||
sparc? ( mirror://sourceforge/freepascal/${PN}-2.2.4.sparc-linux.tar )
|
||||
x86? ( mirror://sourceforge/freepascal/${P}.i386-linux.tar )
|
||||
doc? ( mirror://sourceforge/freepascal/Documentation/${PV}/doc-html.tar.gz -> ${P}-doc-html.tar.gz
|
||||
http://dev.gentoo.org/~radhermit/distfiles/${P}-fpctoc.htx.bz2 )"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
|
||||
KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
|
||||
IUSE="doc ide source"
|
||||
|
||||
RDEPEND="ide? ( !dev-lang/fpc-ide )"
|
||||
|
||||
RESTRICT="strip" #269221
|
||||
|
||||
S=${WORKDIR}/fpcbuild-${PV}/fpcsrc
|
||||
|
||||
src_unpack() {
|
||||
case ${ARCH} in
|
||||
amd64) FPC_ARCH="x86_64" PV_BIN=${PV} ;;
|
||||
arm) FPC_ARCH="arm" PV_BIN=${PV} ;;
|
||||
ppc) FPC_ARCH="powerpc" PV_BIN=${PV} ;;
|
||||
ppc64) FPC_ARCH="powerpc64" PV_BIN=${PV} ;;
|
||||
sparc) FPC_ARCH="sparc" PV_BIN=2.2.4 ;;
|
||||
x86) FPC_ARCH="i386" PV_BIN=${PV} ;;
|
||||
*) die "This ebuild doesn't support ${ARCH}." ;;
|
||||
esac
|
||||
|
||||
unpack ${A}
|
||||
|
||||
tar -xf ${P}.${FPC_ARCH}-linux/binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
|
||||
tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
find "${WORKDIR}" -name Makefile -exec sed -i -e 's/ -Xs / /g' {} + || die
|
||||
|
||||
# let the pkg manager compress man files
|
||||
sed -i '/find man.* gzip /d' "${WORKDIR}"/fpcbuild-${PV}/install/man/Makefile || die
|
||||
}
|
||||
|
||||
set_pp() {
|
||||
case ${ARCH} in
|
||||
amd64) FPC_ARCH="x64" ;;
|
||||
arm) FPC_ARCH="arm" ;;
|
||||
ppc) FPC_ARCH="ppc" ;;
|
||||
ppc64) FPC_ARCH="ppc64" ;;
|
||||
sparc) FPC_ARCH="sparc" ;;
|
||||
x86) FPC_ARCH="386" ;;
|
||||
*) die "This ebuild doesn't support ${ARCH}." ;;
|
||||
esac
|
||||
|
||||
case ${1} in
|
||||
bootstrap) pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
|
||||
new) pp="${S}"/compiler/ppc${FPC_ARCH} ;;
|
||||
*) die "set_pp: unknown argument: ${1}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local pp
|
||||
|
||||
# Using the bootstrap compiler.
|
||||
set_pp bootstrap
|
||||
|
||||
emake -j1 PP="${pp}" compiler_cycle
|
||||
|
||||
# Save new compiler from cleaning...
|
||||
cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new || die
|
||||
|
||||
# ...rebuild with current version...
|
||||
emake -j1 PP="${S}"/ppc${FPC_ARCH}.new compiler_cycle
|
||||
|
||||
# ..and clean up afterwards
|
||||
rm "${S}"/ppc${FPC_ARCH}.new || die
|
||||
|
||||
# Using the new compiler.
|
||||
set_pp new
|
||||
|
||||
emake -j1 PP="${pp}" rtl_clean
|
||||
|
||||
emake -j1 PP="${pp}" rtl packages_all utils
|
||||
|
||||
if use ide ; then
|
||||
cd "${S}"/ide || die
|
||||
emake -j1 PP="${pp}"
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local pp
|
||||
set_pp new
|
||||
|
||||
set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/fpcmake" \
|
||||
INSTALL_PREFIX="${D}"/usr \
|
||||
INSTALL_DOCDIR="${D}"/usr/share/doc/${PF} \
|
||||
INSTALL_MANDIR="${D}"/usr/share/man \
|
||||
INSTALL_SOURCEDIR="${D}"/usr/lib/fpc/${PV}/source
|
||||
|
||||
emake -j1 "$@" compiler_install rtl_install packages_install utils_install
|
||||
|
||||
dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
|
||||
|
||||
cd "${S}"/../install/doc || die
|
||||
emake -j1 "$@" installdoc
|
||||
|
||||
cd "${S}"/../install/man || die
|
||||
emake -j1 "$@" installman
|
||||
|
||||
if use doc ; then
|
||||
cd "${S}"/../../doc || die
|
||||
dodoc -r *
|
||||
newdoc "${WORKDIR}"/${P}-fpctoc.htx fpctoc.htx
|
||||
docompress -x /usr/share/doc/${PF}/fpctoc.htx
|
||||
fi
|
||||
|
||||
if use ide ; then
|
||||
cd "${S}"/ide
|
||||
emake -j1 "$@" install
|
||||
fi
|
||||
|
||||
if use source ; then
|
||||
cd "${S}" || die
|
||||
shift
|
||||
emake -j1 PP="${D}"/usr/bin/ppc${FPC_ARCH} "$@" sourceinstall
|
||||
find "${D}"/usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
|
||||
fi
|
||||
|
||||
"${D}"/usr/lib/fpc/${PV}/samplecfg "${D}"/usr/lib/fpc/${PV} "${D}"/etc || die
|
||||
|
||||
sed -i "s:${D}::g" "${D}"/etc/fpc.cfg || die
|
||||
|
||||
if use ide ; then
|
||||
sed -e "s:${D}::g" \
|
||||
-i "${D}"/etc/fppkg.cfg \
|
||||
-i "${D}"/etc/fppkg/* \
|
||||
-i "${D}"/usr/lib/fpc/${PV}/ide/text/fp*.cfg \
|
||||
|| die
|
||||
fi
|
||||
|
||||
rm -r "${D}"/usr/lib/fpc/lexyacc || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ -z ${REPLACING_VERSIONS} ]] && use ide; then
|
||||
einfo "To read the documentation in the fpc IDE, enable the doc USE flag"
|
||||
einfo "and add /usr/share/doc/${PF}/fpctoc.htx to the Help Files list."
|
||||
fi
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
DIST lazarus-0.9.26-0.tgz 12641854 SHA256 d4c2dc8e8c797049d45d0c01aff51ea94fcae489efab7d4529afb6aeca8066dd SHA512 6c2b1610e40bc55ecd69f56ebfa97304abb024d12fe38ae52a4f39937e6734aa800102c21fa460be060f867d0371c69fdcc972e30051f592b94c21d54f1f0c6e WHIRLPOOL 725fbf9612736a9a619f0fbc8f8c7508975bd41b7a8d16cbcbea7fdffbf712f65d4617e5bdccc7f6094d57c80511922a50bbe40b9ee26c30213591a453ca5301
|
||||
DIST lazarus-0.9.28.2-src.tar.bz2 12933724 SHA256 5711372c6724d19624be6cb8f6c397d789f3ac6fd7f70f825817ee47bd0e4dfd SHA512 bde0ac39237d60311f0295eacf27b330fe8b0eef2b5a687a02d8a1aca9a2ad6d279aa3c2ea6ac1d67f0aca383eb17cd85f249a98d876745fe830c79db6c69a21 WHIRLPOOL 39f7ae728f05e8216ed426044d7cf67ff0c0549bce6745b1949522bd9b820f7f15f5a4876b8f3954c498abd2f0f7247a0752a2e04e1e0c2f3f1aef498f004d03
|
||||
DIST lazarus-1.0.10-0.tar.gz 47688266 SHA256 61fd508c832a9c6a27e624be42257493999fe7a3b2f2ab30b9eccd4a2b4d3758 SHA512 e55100531a57de3daf931cb501ca58f57a35f1d17fe9ace1a3c6cbe995b17ecb300cf46636a6609349e81f29ecc7356dcba4c2b3ae01d23650650553650b7677 WHIRLPOOL 3c6efef7e6ddc89bc6ad7255a5d5f302c6e0825dd799b5fb73f75ec2819577825b109f73bc2e860302e0a8ffafd2fee4954455f51a5df7a5b588e5c4574eb4d3
|
||||
DIST lazarus-1.0.4-1.tar.gz 46146420 SHA256 e3a52fe5a1053d12fa2c6a4c89faf5487c3184ad584324b0c640db87b5b85744 SHA512 26d17f175f71f593543f63de7dddaf5a4dc674df17657e242968280618c21e623acb446b18d49643ca872b53f3f1b81b9a09fabaced2a6f7419935121ac4f1fa WHIRLPOOL 0aa61a385ab812b4dd1b0abc7a57c95519bfc27a9c56b375af8484de299d7f6e439e5fa5504da2b7571b0def5526e960f35b6bdf2ec9efc118d534ca290c5f8c
|
||||
|
@ -0,0 +1,73 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/lazarus/lazarus-1.0.10.ebuild,v 1.1 2013/06/26 20:14:11 hasufell Exp $
|
||||
|
||||
EAPI=2
|
||||
|
||||
inherit eutils
|
||||
|
||||
RESTRICT="strip" #269221
|
||||
|
||||
FPCVER="2.6.0"
|
||||
|
||||
SLOT="0" # Note: Slotting Lazarus needs slotting fpc, see DEPEND.
|
||||
LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
|
||||
KEYWORDS="~amd64 ~ppc ~x86"
|
||||
DESCRIPTION="Lazarus IDE is a feature rich visual programming environment emulating Delphi."
|
||||
HOMEPAGE="http://www.lazarus.freepascal.org/"
|
||||
IUSE=""
|
||||
SRC_URI="http://downloads.sourceforge.net/project/${PN}/Lazarus%20Zip%20_%20GZip/Lazarus%20${PV}/lazarus-1.0.10-0.tar.gz"
|
||||
|
||||
DEPEND=">=dev-lang/fpc-${FPCVER}[source]
|
||||
net-misc/rsync
|
||||
x11-libs/gtk+:2"
|
||||
RDEPEND="${DEPEND}
|
||||
!=gnome-base/librsvg-2.16.1"
|
||||
DEPEND="${DEPEND}
|
||||
>=sys-devel/binutils-2.19.1-r1"
|
||||
|
||||
S=${WORKDIR}/${PN}
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/${PN}-0.9.26-fpcsrc.patch
|
||||
|
||||
# Use default configuration (minus stripping) unless specifically requested otherwise
|
||||
if ! test ${PPC_CONFIG_PATH+set} ; then
|
||||
local FPCVER=$(fpc -iV)
|
||||
export PPC_CONFIG_PATH="${WORKDIR}"
|
||||
sed -e 's/^FPBIN=/#&/' /usr/lib/fpc/${FPCVER}/samplecfg |
|
||||
sh -s /usr/lib/fpc/${FPCVER} "${PPC_CONFIG_PATH}" || die
|
||||
#sed -i -e '/^-Xs/d' "${PPC_CONFIG_PATH}"/fpc.cfg || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
LCL_PLATFORM=gtk2 emake -j1 || die "make failed!"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
diropts -m0755
|
||||
dodir /usr/share
|
||||
# Using rsync to avoid unnecessary copies and cleaning...
|
||||
# Note: *.o and *.ppu are needed
|
||||
rsync -a \
|
||||
--exclude="CVS" --exclude=".cvsignore" \
|
||||
--exclude="*.ppw" --exclude="*.ppl" \
|
||||
--exclude="*.ow" --exclude="*.a"\
|
||||
--exclude="*.rst" --exclude=".#*" \
|
||||
--exclude="*.~*" --exclude="*.bak" \
|
||||
--exclude="*.orig" --exclude="*.rej" \
|
||||
--exclude=".xvpics" --exclude="*.compiled" \
|
||||
--exclude="killme*" --exclude=".gdb_hist*" \
|
||||
--exclude="debian" --exclude="COPYING*" \
|
||||
--exclude="*.app" \
|
||||
"${S}" "${D}"usr/share \
|
||||
|| die "Unable to copy files!"
|
||||
|
||||
dosym ../share/lazarus/startlazarus /usr/bin/startlazarus
|
||||
dosym ../share/lazarus/startlazarus /usr/bin/lazarus
|
||||
dosym ../share/lazarus/lazbuild /usr/bin/lazbuild
|
||||
dosym ../lazarus/images/ide_icon48x48.png /usr/share/pixmaps/lazarus.png
|
||||
|
||||
make_desktop_entry startlazarus "Lazarus IDE" "lazarus" || die "Failed making desktop entry!"
|
||||
}
|
@ -0,0 +1,194 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-13.05.1.ebuild,v 1.1 2013/06/27 13:22:10 keri Exp $
|
||||
|
||||
EAPI=2
|
||||
|
||||
inherit eutils multilib
|
||||
|
||||
PATCHSET_VER="0"
|
||||
MY_P=mercury-srcdist-${PV}
|
||||
|
||||
DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
|
||||
HOMEPAGE="http://www.mercurylang.org/index.html"
|
||||
SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
|
||||
mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
|
||||
|
||||
LICENSE="GPL-2 LGPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
IUSE="X cairo examples glut iodbc ncurses odbc opengl ssl tcl tk xml"
|
||||
|
||||
RDEPEND="~dev-lang/mercury-${PV}
|
||||
cairo? ( >=x11-libs/cairo-1.10.0 )
|
||||
glut? ( media-libs/freeglut )
|
||||
odbc? ( dev-db/unixODBC )
|
||||
iodbc? ( !odbc? ( dev-db/libiodbc ) )
|
||||
ncurses? ( sys-libs/ncurses )
|
||||
opengl? ( virtual/opengl )
|
||||
tcl? ( tk? (
|
||||
dev-lang/tcl
|
||||
dev-lang/tk
|
||||
x11-libs/libX11
|
||||
x11-libs/libXmu ) )"
|
||||
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
S="${WORKDIR}"/${MY_P}/extras
|
||||
|
||||
src_prepare() {
|
||||
cd "${WORKDIR}"
|
||||
|
||||
EPATCH_FORCE=yes
|
||||
EPATCH_SUFFIX=patch
|
||||
epatch "${WORKDIR}"/${PV}
|
||||
|
||||
if use odbc; then
|
||||
epatch "${WORKDIR}"/${PV}-odbc/${P}-odbc.patch
|
||||
elif use iodbc; then
|
||||
epatch "${WORKDIR}"/${PV}-odbc/${P}-iodbc.patch
|
||||
fi
|
||||
|
||||
cd "${S}"
|
||||
sed -i -e "s:references:references solver_types/library:" \
|
||||
-e "s:windows_installer_generator::" \
|
||||
Mmakefile || die "sed default packages failed"
|
||||
|
||||
if use cairo; then
|
||||
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_cairo lex \\\\:" Mmakefile \
|
||||
|| die "sed cairo failed"
|
||||
fi
|
||||
|
||||
if use glut; then
|
||||
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_glut lex \\\\:" Mmakefile \
|
||||
|| die "sed glut failed"
|
||||
fi
|
||||
|
||||
if use opengl; then
|
||||
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_opengl lex \\\\:" Mmakefile \
|
||||
|| die "sed opengl failed"
|
||||
fi
|
||||
|
||||
if use tcl && use tk; then
|
||||
sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_tcltk lex \\\\:" Mmakefile \
|
||||
|| die "sed tcltk failed"
|
||||
fi
|
||||
|
||||
if use odbc || use iodbc; then
|
||||
sed -i -e "s:moose:moose odbc:" Mmakefile \
|
||||
|| die "sed odbc failed"
|
||||
fi
|
||||
|
||||
if use ncurses; then
|
||||
sed -i -e "s:complex_numbers:complex_numbers curs curses:" Mmakefile \
|
||||
|| die "sed ncurses failed"
|
||||
fi
|
||||
|
||||
if ! use xml; then
|
||||
sed -i -e "s:xml::" Mmakefile \
|
||||
|| die "sed xml failed"
|
||||
fi
|
||||
|
||||
sed -i -e "s:@libdir@:$(get_libdir):" \
|
||||
dynamic_linking/Mmakefile \
|
||||
|| die "sed libdir failed"
|
||||
|
||||
# disable broken packages
|
||||
sed -i -e "s:references::" Mmakefile \
|
||||
|| die "sed broken packages failed"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# Mercury dependency generation must be run single-threaded
|
||||
mmake \
|
||||
-j1 depend || die "mmake depend failed"
|
||||
|
||||
# Compiling Mercury submodules is not thread-safe
|
||||
mmake -j1 \
|
||||
EXTRA_MLFLAGS=--no-strip \
|
||||
EXTRA_LDFLAGS="${LDFLAGS}" \
|
||||
EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
|
||||
|| die "mmake failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Compiling Mercury submodules is not thread-safe
|
||||
mmake -j1 \
|
||||
EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
|
||||
INSTALL_PREFIX="${D}"/usr \
|
||||
install || die "mmake install failed"
|
||||
|
||||
find "${D}"/usr/$(get_libdir)/mercury -type l | xargs rm
|
||||
|
||||
cd "${S}"
|
||||
if use examples; then
|
||||
insinto /usr/share/doc/${PF}/samples/base64
|
||||
doins base64/*.m || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/complex_numbers
|
||||
doins complex_numbers/samples/* || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/dynamic_linking
|
||||
doins dynamic_linking/hello.m || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/error
|
||||
doins error/* || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/fixed
|
||||
doins fixed/*.m || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/gator
|
||||
doins -r gator/* || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/lex
|
||||
doins lex/samples/* || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/log4m
|
||||
doins log4m/*.m || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/monte
|
||||
doins monte/*.m || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/moose
|
||||
doins moose/samples/* || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/net
|
||||
doins net/*.m || die
|
||||
|
||||
if use ncurses; then
|
||||
insinto /usr/share/doc/${PF}/samples/curs
|
||||
doins curs/samples/* || die
|
||||
|
||||
insinto /usr/share/doc/${PF}/samples/curses
|
||||
doins curses/sample/* || die
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
insinto /usr/share/doc/${PF}/samples/graphics
|
||||
doins graphics/easyx/samples/*.m || die
|
||||
fi
|
||||
|
||||
if use glut && use opengl; then
|
||||
insinto /usr/share/doc/${PF}/samples/graphics
|
||||
doins graphics/samples/calc/* || die
|
||||
doins graphics/samples/gears/* || die
|
||||
doins graphics/samples/maze/* || die
|
||||
doins graphics/samples/pent/* || die
|
||||
fi
|
||||
|
||||
if use opengl && use tcl && use tk; then
|
||||
insinto /usr/share/doc/${PF}/samples/graphics
|
||||
doins graphics/samples/pent/*.m || die
|
||||
fi
|
||||
|
||||
if use ssl; then
|
||||
insinto /usr/share/doc/${PF}/samples/mopenssl
|
||||
doins mopenssl/*.m || die
|
||||
fi
|
||||
|
||||
rm -rf $(find "${D}"/usr/share/doc/${PF}/samples -name CVS)
|
||||
fi
|
||||
|
||||
dodoc README || die
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/mercury-13.05.1.ebuild,v 1.1 2013/06/27 13:19:07 keri Exp $
|
||||
|
||||
EAPI=2
|
||||
|
||||
inherit autotools elisp-common eutils flag-o-matic java-pkg-opt-2 multilib
|
||||
|
||||
PATCHSET_VER="0"
|
||||
MY_P=${PN}-srcdist-${PV}
|
||||
|
||||
DESCRIPTION="Mercury is a modern general-purpose logic/functional programming language"
|
||||
HOMEPAGE="http://www.mercurylang.org/index.html"
|
||||
SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
|
||||
mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
|
||||
|
||||
LICENSE="GPL-2 LGPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
IUSE="debug emacs erlang examples java minimal readline threads"
|
||||
|
||||
DEPEND="!dev-libs/mpatrol
|
||||
!dev-util/mono-debugger
|
||||
readline? ( sys-libs/readline )
|
||||
erlang? ( dev-lang/erlang )
|
||||
java? ( >=virtual/jdk-1.5 )"
|
||||
|
||||
RDEPEND="${DEPEND}
|
||||
emacs? ( virtual/emacs )"
|
||||
|
||||
S="${WORKDIR}"/${MY_P}
|
||||
|
||||
SITEFILE=50${PN}-gentoo.el
|
||||
|
||||
src_prepare() {
|
||||
cd "${WORKDIR}"
|
||||
EPATCH_FORCE=yes
|
||||
EPATCH_SUFFIX=patch
|
||||
epatch "${WORKDIR}"/${PV}
|
||||
|
||||
sed -i -e "s/@libdir@/$(get_libdir)/" \
|
||||
"${S}"/scripts/Mmake.vars.in \
|
||||
|| die "sed libdir failed"
|
||||
|
||||
cd "${S}"
|
||||
eautoconf
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
strip-flags
|
||||
|
||||
local myconf
|
||||
myconf="--libdir=/usr/$(get_libdir) \
|
||||
--disable-deep-profiler \
|
||||
--disable-dotnet-grades \
|
||||
--without-hwloc \
|
||||
$(use_enable erlang erlang-grade) \
|
||||
$(use_enable java java-grade) \
|
||||
$(use_enable debug debug-grades) \
|
||||
$(use_enable threads par-grades) \
|
||||
$(use_enable !minimal most-grades) \
|
||||
$(use_with readline)"
|
||||
|
||||
econf ${myconf}
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# Build Mercury using base llds grade
|
||||
emake \
|
||||
PARALLEL=${MAKEOPTS} \
|
||||
MMAKEFLAGS="EXTRA_MLFLAGS=--no-strip \
|
||||
EXTRA_LDFLAGS='${LDFLAGS}' \
|
||||
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
|
||||
|| die "emake failed"
|
||||
|
||||
# We can now patch .m Mercury compiler files since we
|
||||
# have just built mercury_compiler.
|
||||
EPATCH_FORCE=yes
|
||||
EPATCH_SUFFIX=patch
|
||||
epatch "${WORKDIR}"/${PV}-mmc
|
||||
|
||||
sed -i -e "s/@libdir@/$(get_libdir)/" \
|
||||
"${S}"/compiler/file_util.m \
|
||||
"${S}"/compiler/make.program_target.m \
|
||||
|| die "sed libdir failed"
|
||||
|
||||
# Rebuild Mercury compiler using the just built mercury_compiler
|
||||
emake \
|
||||
PARALLEL=${MAKEOPTS} \
|
||||
MMAKEFLAGS="EXTRA_MLFLAGS=--no-strip \
|
||||
EXTRA_LDFLAGS='${LDFLAGS}' \
|
||||
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
|
||||
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
|
||||
compiler || die "emake compiler failed"
|
||||
|
||||
# The default Mercury grade may not be the same as the grade used to
|
||||
# compile the llds base grade. Since src_test() is run before
|
||||
# src_install() we compile the default grade now
|
||||
emake \
|
||||
PARALLEL=${MAKEOPTS} \
|
||||
MMAKEFLAGS="EXTRA_MLFLAGS=--no-strip \
|
||||
EXTRA_LDFLAGS='${LDFLAGS}' \
|
||||
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
|
||||
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
|
||||
default_grade || die "emake default_grade failed"
|
||||
}
|
||||
|
||||
src_test() {
|
||||
TEST_GRADE=`scripts/ml --print-grade`
|
||||
if [ -d "${S}"/install_grade_dir.${TEST_GRADE} ] ; then
|
||||
TWS="${S}"/install_grade_dir.${TEST_GRADE}
|
||||
cp runtime/mer_rt.init "${TWS}"/runtime/
|
||||
cp mdbcomp/mer_mdbcomp.init "${TWS}"/mdbcomp/
|
||||
cp browser/mer_browser.init "${TWS}"/browser/
|
||||
else
|
||||
TWS="${S}"
|
||||
fi
|
||||
|
||||
cd "${S}"/tests
|
||||
sed -e "s:@WORKSPACE@:${TWS}:" < WS_FLAGS.ws > WS_FLAGS \
|
||||
|| die "sed WORKSPACE failed"
|
||||
|
||||
# Mercury tests must be run in C locale since Mercury output is
|
||||
# compared to hard-coded warnings/errors
|
||||
LC_ALL="C" \
|
||||
PATH="${TWS}"/scripts:"${TWS}"/util:"${S}"/slice:"${PATH}" \
|
||||
TERM="" \
|
||||
WORKSPACE="${TWS}" \
|
||||
WORKSPACE_FLAGS=yes \
|
||||
MERCURY_COMPILER="${TWS}"/compiler/mercury_compile \
|
||||
MMAKE_DIR="${TWS}"/scripts \
|
||||
MERCURY_SUPPRESS_STACK_TRACE=yes \
|
||||
GRADE=${TEST_GRADE} \
|
||||
MERCURY_ALL_LOCAL_C_INCL_DIRS=" -I${TWS}/boehm_gc/include \
|
||||
-I${TWS}/runtime \
|
||||
-I${TWS}/library" \
|
||||
mmake || die "mmake test failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
PARALLEL=${MAKEOPTS} \
|
||||
MMAKEFLAGS="EXTRA_LDFLAGS='${LDFLAGS}' \
|
||||
EXTRA_LD_LIBFLAGS='${LDFLAGS}'" \
|
||||
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
|
||||
INSTALL_PREFIX="${D}"/usr \
|
||||
INSTALL_MAN_DIR="${D}"/usr/share/man \
|
||||
INSTALL_INFO_DIR="${D}"/usr/share/info \
|
||||
INSTALL_HTML_DIR="${D}"/usr/share/doc/${PF}/html \
|
||||
INSTALL_ELISP_DIR="${D}/${SITELISP}"/${PN} \
|
||||
install || die "emake install failed"
|
||||
|
||||
if use emacs; then
|
||||
elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
|
||||
|| die "elisp-site-file-install failed"
|
||||
fi
|
||||
|
||||
dodoc \
|
||||
BUGS HISTORY LIMITATIONS NEWS README README.Linux \
|
||||
README.Linux-Alpha README.Linux-m68k README.Linux-PPC \
|
||||
RELEASE_NOTES TODO VERSION WORK_IN_PROGRESS || die
|
||||
|
||||
if use erlang; then
|
||||
dodoc README.Erlang || die
|
||||
fi
|
||||
|
||||
if use java; then
|
||||
dodoc README.Java || die
|
||||
fi
|
||||
|
||||
if use examples; then
|
||||
insinto /usr/share/doc/${PF}/samples
|
||||
doins samples/{*.m,README,Mmakefile} || die
|
||||
doins -r samples/c_interface \
|
||||
samples/diff \
|
||||
samples/muz \
|
||||
samples/rot13 \
|
||||
samples/solutions \
|
||||
samples/solver_types || die
|
||||
|
||||
if use java; then
|
||||
doins -r samples/java_interface || die
|
||||
fi
|
||||
|
||||
rm -rf $(find "${D}"/usr/share/doc/${PF}/samples \
|
||||
-name CVS -o -name .cvsignore)
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
use emacs && elisp-site-regen
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
use emacs && elisp-site-regen
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
Avoid un-needed objects.inv files drom d'loading for docs build
|
||||
diff -ur Flask-0.9.orig/docs/conf.py Flask-0.9/docs/conf.py
|
||||
--- docs/conf.py 2012-07-01 19:10:19.000000000 +0800
|
||||
+++ docs/conf.py 2013-06-09 00:21:57.757485401 +0800
|
||||
@@ -243,14 +243,6 @@
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
-intersphinx_mapping = {
|
||||
- 'http://docs.python.org/dev': None,
|
||||
- 'http://werkzeug.pocoo.org/docs/': None,
|
||||
- 'http://www.sqlalchemy.org/docs/': None,
|
||||
- 'http://wtforms.simplecodes.com/docs/0.5/': None,
|
||||
- 'http://discorporate.us/projects/Blinker/docs/1.1/': None
|
||||
-}
|
||||
-
|
||||
pygments_style = 'flask_theme_support.FlaskyStyle'
|
||||
|
||||
# fall back if theme is not there
|
@ -0,0 +1 @@
|
||||
DIST google-api-python-client-1.1.tar.gz 71178 SHA256 bc88cae1c40446f22d58923fc5a8dbac77da29d6efbe4ae2276cc2f30f724617 SHA512 750c482e90f83d0b2d53f7d655db9a476686158b5e380cab7a5e92af1b521b26871dcda08a2ee946cd09035f65ca50ad8dcffa8f766d3671fceae009fbdb831e WHIRLPOOL 62d2ebb7f51f58c76b45f748fe79b031cda5f11fd6088d8ea947e7ab9b9b754688e004773f99169cc65fdd2789002faa486bed7717fc07dea0b25994cbede0da
|
@ -0,0 +1,25 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/google-api-python-client/google-api-python-client-1.1.ebuild,v 1.1 2013/06/27 03:12:32 robbat2 Exp $
|
||||
|
||||
EAPI=5
|
||||
PYTHON_COMPAT=( python{2_6,2_7} pypy{1_9,2_0} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Google API Client for Python"
|
||||
HOMEPAGE="http://code.google.com/p/google-api-python-client/"
|
||||
SRC_URI="https://google-api-python-client.googlecode.com/files/${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND="dev-python/python-gflags
|
||||
>=dev-python/httplib2-0.8
|
||||
dev-python/simplejson
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer>
|
||||
<email>robbat2@gentoo.org</email>
|
||||
<name>Robin H. Johnson</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
|
@ -0,0 +1,74 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.13.ebuild,v 1.2 2013/06/27 14:29:10 xmw Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
# pypy: bug #458558 (wrong linker options due to not respecting CC)
|
||||
PYTHON_COMPAT=( python{2_5,2_6,2_7} )
|
||||
|
||||
inherit distutils-r1 multilib
|
||||
|
||||
DESCRIPTION="Various LDAP-related Python modules"
|
||||
HOMEPAGE="http://www.python-ldap.org http://pypi.python.org/pypi/python-ldap"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="PSF-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-solaris"
|
||||
IUSE="doc examples sasl ssl"
|
||||
|
||||
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
|
||||
# python team: Please do not remove python-ldap-2.3.9 from the tree.
|
||||
RDEPEND=">=net-nds/openldap-2.4
|
||||
dev-python/pyasn1[${PYTHON_USEDEP}]
|
||||
sasl? ( dev-libs/cyrus-sasl )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
|
||||
|
||||
python_prepare_all() {
|
||||
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
|
||||
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
|
||||
-i setup.cfg || die "error fixing setup.cfg"
|
||||
|
||||
local mylibs="ldap"
|
||||
if use sasl; then
|
||||
use ssl && mylibs="ldap_r"
|
||||
mylibs="${mylibs} sasl2"
|
||||
else
|
||||
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
|
||||
fi
|
||||
use ssl && mylibs="${mylibs} ssl crypto"
|
||||
use elibc_glibc && mylibs="${mylibs} resolv"
|
||||
|
||||
sed -e "s:^libs = .*:libs = lber ${mylibs}:" \
|
||||
-i setup.cfg || die "error setting up libs in setup.cfg"
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
cd Doc || die
|
||||
sphinx-build -b html -d _build/doctrees . _build/html || die
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
# XXX: the tests supposedly can start local slapd
|
||||
# but it requires some manual config, it seems.
|
||||
|
||||
"${PYTHON}" Tests/t_ldapurl.py || die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
use doc && local HTML_DOCS=( Doc/_build/html/. )
|
||||
|
||||
distutils-r1_python_install_all
|
||||
|
||||
if use examples; then
|
||||
dodoc -r Demo
|
||||
docompress -x /usr/share/doc/${FP}/Demo
|
||||
fi
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.3.ebuild,v 1.6 2012/11/14 08:17:33 xarthisius Exp $
|
||||
|
||||
EAPI="3"
|
||||
PYTHON_DEPEND="2"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
RESTRICT_PYTHON_ABIS="3.* *-jython"
|
||||
|
||||
inherit distutils multilib
|
||||
|
||||
DOC_P="${PN}-docs-html-${PV}"
|
||||
|
||||
DESCRIPTION="Various LDAP-related Python modules"
|
||||
HOMEPAGE="http://www.python-ldap.org/ http://pypi.python.org/pypi/python-ldap"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
|
||||
doc? ( http://www.python-ldap.org/doc/${DOC_P}.tar.gz )"
|
||||
|
||||
LICENSE="PSF-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-solaris"
|
||||
IUSE="doc examples sasl ssl"
|
||||
|
||||
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
|
||||
# python team: Please do not remove python-ldap-2.3.9 from the tree.
|
||||
RDEPEND=">=net-nds/openldap-2.4
|
||||
sasl? ( dev-libs/cyrus-sasl )"
|
||||
DEPEND="${DEPEND}
|
||||
dev-python/setuptools"
|
||||
|
||||
DOCS="CHANGES README"
|
||||
PYTHON_MODNAME="dsml.py ldapurl.py ldif.py ldap"
|
||||
|
||||
src_prepare() {
|
||||
local rpath=
|
||||
# sloppy logic, maybe better check if compiler links with GNU-ld
|
||||
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=${EPREFIX}/usr/$(get_libdir)/sasl2"
|
||||
# Note: we can't add /usr/lib and /usr/lib/sasl2 to library_dirs due to a bug in py2.4
|
||||
sed -e "s:^library_dirs =.*:library_dirs =:" \
|
||||
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
|
||||
-e "s:\(extra_compile_args =\).*:\1\nextra_link_args = ${rpath}:" \
|
||||
-i setup.cfg || die "error fixing setup.cfg"
|
||||
|
||||
local mylibs="ldap"
|
||||
if use sasl; then
|
||||
use ssl && mylibs="ldap_r"
|
||||
mylibs="${mylibs} sasl2"
|
||||
fi
|
||||
use ssl && mylibs="${mylibs} ssl crypto"
|
||||
|
||||
sed -e "s:^libs = .*:libs = lber resolv ${mylibs}:" \
|
||||
-e "s:^compile.*:compile = 0:" \
|
||||
-e "s:^optimize.*:optimize = 0:" \
|
||||
-i setup.cfg || die "error setting up libs in setup.cfg"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
distutils_src_install
|
||||
|
||||
if use doc; then
|
||||
dohtml -r "${WORKDIR}/${DOC_P}"/* || die "dohtml failed"
|
||||
fi
|
||||
|
||||
if use examples; then
|
||||
insinto /usr/share/doc/${PF}
|
||||
doins -r Demo || die "doins failed"
|
||||
fi
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-2.4.9.ebuild,v 1.3 2012/11/14 08:17:33 xarthisius Exp $
|
||||
|
||||
EAPI=4
|
||||
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
RESTRICT_PYTHON_ABIS="3.* *-jython"
|
||||
|
||||
inherit distutils multilib
|
||||
|
||||
DESCRIPTION="Various LDAP-related Python modules"
|
||||
HOMEPAGE="http://www.python-ldap.org http://pypi.python.org/pypi/python-ldap"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="PSF-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-solaris"
|
||||
IUSE="doc examples sasl ssl"
|
||||
|
||||
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
|
||||
# python team: Please do not remove python-ldap-2.3.9 from the tree.
|
||||
RDEPEND=">=net-nds/openldap-2.4
|
||||
dev-python/pyasn1
|
||||
sasl? ( dev-libs/cyrus-sasl )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-python/setuptools
|
||||
doc? ( dev-python/sphinx )"
|
||||
|
||||
DOCS="CHANGES README"
|
||||
PYTHON_MODNAME="dsml.py ldapurl.py ldif.py ldap"
|
||||
|
||||
src_prepare() {
|
||||
local rpath=
|
||||
# sloppy logic, maybe better check if compiler links with GNU-ld
|
||||
[[ ${CHOST} != *-darwin* ]] && rpath="-Wl,-rpath=${EPREFIX}/usr/$(get_libdir)/sasl2"
|
||||
# Note: we can't add /usr/lib and /usr/lib/sasl2 to library_dirs due to a bug in py2.4
|
||||
sed -e "s:^library_dirs =.*:library_dirs =:" \
|
||||
-e "s:^include_dirs =.*:include_dirs = ${EPREFIX}/usr/include ${EPREFIX}/usr/include/sasl:" \
|
||||
-e "s:\(extra_compile_args =\).*:\1\nextra_link_args = ${rpath}:" \
|
||||
-i setup.cfg || die "error fixing setup.cfg"
|
||||
|
||||
local mylibs="ldap"
|
||||
if use sasl; then
|
||||
use ssl && mylibs="ldap_r"
|
||||
mylibs="${mylibs} sasl2"
|
||||
else
|
||||
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
|
||||
fi
|
||||
use ssl && mylibs="${mylibs} ssl crypto"
|
||||
|
||||
sed -e "s:^libs = .*:libs = lber resolv ${mylibs}:" \
|
||||
-e "s:^compile.*:compile = 0:" \
|
||||
-e "s:^optimize.*:optimize = 0:" \
|
||||
-i setup.cfg || die "error setting up libs in setup.cfg"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
distutils_src_compile
|
||||
if use doc; then
|
||||
pushd Doc &> /dev/null
|
||||
PYTHONPATH="$(ls -d ../build-$(PYTHON -f --ABI)/lib*)" \
|
||||
sphinx-build -b html -d _build/doctrees . _build/html
|
||||
popd Doc &> /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
distutils_src_install
|
||||
|
||||
if use examples; then
|
||||
insinto /usr/share/doc/${PF}
|
||||
doins -r Demo
|
||||
fi
|
||||
|
||||
if use doc; then
|
||||
dohtml -r Doc/_build/html/
|
||||
fi
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/python-ldap/python-ldap-9999.ebuild,v 1.1 2013/06/27 14:29:10 xmw Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
# pypy: bug #458558 (wrong linker options due to not respecting CC)
|
||||
PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2} )
|
||||
|
||||
inherit distutils-r1 git-2 multilib
|
||||
|
||||
DESCRIPTION="Various LDAP-related Python modules"
|
||||
HOMEPAGE="http://www.python-ldap.org http://pypi.python.org/pypi/python-ldap"
|
||||
EGIT_REPO_URI="https://github.com/xmw/python-ldap.git"
|
||||
|
||||
LICENSE="PSF-2"
|
||||
SLOT="0"
|
||||
KEYWORDS=""
|
||||
IUSE="doc examples sasl ssl"
|
||||
|
||||
# If you need support for openldap-2.3.x, please use python-ldap-2.3.9.
|
||||
# python team: Please do not remove python-ldap-2.3.9 from the tree.
|
||||
RDEPEND=">=net-nds/openldap-2.4
|
||||
dev-python/pyasn1[${PYTHON_USEDEP}]
|
||||
sasl? ( dev-libs/cyrus-sasl )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
|
||||
|
||||
python_prepare_all() {
|
||||
sed -e "s:^library_dirs =.*:library_dirs = /usr/$(get_libdir) /usr/$(get_libdir)/sasl2:" \
|
||||
-e "s:^include_dirs =.*:include_dirs = \"${EPREFIX}\"/usr/include \"${EPREFIX}\"/usr/include/sasl:" \
|
||||
-i setup.cfg || die "error fixing setup.cfg"
|
||||
|
||||
local mylibs="ldap"
|
||||
if use sasl; then
|
||||
use ssl && mylibs="ldap_r"
|
||||
mylibs="${mylibs} sasl2"
|
||||
else
|
||||
sed -e 's/HAVE_SASL//g' -i setup.cfg || die
|
||||
fi
|
||||
use ssl && mylibs="${mylibs} ssl crypto"
|
||||
use elibc_glibc && mylibs="${mylibs} resolv"
|
||||
|
||||
sed -e "s:^libs = .*:libs = lber ${mylibs}:" \
|
||||
-i setup.cfg || die "error setting up libs in setup.cfg"
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_compile_all() {
|
||||
if use doc; then
|
||||
cd Doc || die
|
||||
sphinx-build -b html -d _build/doctrees . _build/html || die
|
||||
fi
|
||||
}
|
||||
|
||||
python_test() {
|
||||
# XXX: the tests supposedly can start local slapd
|
||||
# but it requires some manual config, it seems.
|
||||
|
||||
"${PYTHON}" Tests/t_ldapurl.py || die "Tests fail with ${EPYTHON}"
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
use doc && local HTML_DOCS=( Doc/_build/html/. )
|
||||
|
||||
distutils-r1_python_install_all
|
||||
|
||||
if use examples; then
|
||||
dodoc -r Demo
|
||||
docompress -x /usr/share/doc/${FP}/Demo
|
||||
fi
|
||||
}
|
@ -0,0 +1 @@
|
||||
DIST simplecv-1.3.tar.gz 42860284 SHA256 3510727fa5e219c811cf89bce21ecf29647bdd4ef48a0a78aa29b10b9f583947 SHA512 47fa3c0bb41057ae17323aeb68711ef4716c4fe6607162218477af9070a1b1a03a7300f38b2c2a5c54ff69b916267504aeeac7c3108d6a45045a1469a93005b8 WHIRLPOOL 0206dfc06627b78e96aa7487b6c3450cde043e1527044e413b6111831aa48b32dd043fbebbb33c61ffb1aab7683187bf76db4f0a641cdcd0c3dbd6c8d36e1b18
|
@ -0,0 +1,111 @@
|
||||
From 164d39c1be66eb35b02fb7c30f65b5929c9e407d Mon Sep 17 00:00:00 2001
|
||||
From: Vijay Mahantesh SM <vijay@vijay.(none)>
|
||||
Date: Sat, 8 Dec 2012 01:55:24 +0530
|
||||
Subject: [PATCH] new support for opencv 2.4.3 added
|
||||
|
||||
---
|
||||
SimpleCV/ImageClass.py | 52 ++++++++++++++++++++++++++++++++------------------
|
||||
1 file changed, 33 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/SimpleCV/ImageClass.py b/SimpleCV/ImageClass.py
|
||||
index a545b50..6fab39a 100644
|
||||
--- a/SimpleCV/ImageClass.py
|
||||
+++ b/SimpleCV/ImageClass.py
|
||||
@@ -7610,11 +7610,12 @@ class Image:
|
||||
new_version = 0
|
||||
#For OpenCV versions till 2.4.0, cv2.__versions__ are of the form "$Rev: 4557 $"
|
||||
if not ver.startswith('$Rev:'):
|
||||
- if int(ver.replace('.','0'))>=20400 :
|
||||
- new_version = 1
|
||||
- if int(ver.replace('.','0'))>=20402 :
|
||||
- new_version = 2
|
||||
-
|
||||
+ if int(ver.replace('.','0'))>=20400:
|
||||
+ new_version = 1
|
||||
+ if int(ver.replace('.','0'))>=20402:
|
||||
+ new_version = 2
|
||||
+ if int(ver.replace('.','0'))>=20403:
|
||||
+ new_version = 3
|
||||
except:
|
||||
logger.warning("Can't run Keypoints without OpenCV >= 2.3.0")
|
||||
return
|
||||
@@ -7622,11 +7623,11 @@ class Image:
|
||||
if( forceReset ):
|
||||
self._mKeyPoints = None
|
||||
self._mKPDescriptors = None
|
||||
-
|
||||
- if( self._mKeyPoints is None or self._mKPFlavor != flavor ):
|
||||
+
|
||||
+ if( not(self._mKeyPoints) or self._mKPFlavor != flavor ):
|
||||
if ( new_version == 0):
|
||||
if( flavor == "SURF" ):
|
||||
- surfer = cv2.SURF(thresh,_extended=highQuality,_upright=1)
|
||||
+ surfer = cv2.SURF(thresh,_extended=highQuality,_upright=1)
|
||||
self._mKeyPoints,self._mKPDescriptors = surfer.detect(self.getGrayNumpy(),None,False)
|
||||
if( len(self._mKPDescriptors) == 0 ):
|
||||
return None, None
|
||||
@@ -7659,10 +7660,9 @@ class Image:
|
||||
self._mKPDescriptors = None
|
||||
self._mKPFlavor = "STAR"
|
||||
del starer
|
||||
-
|
||||
-
|
||||
- elif( new_version == 2 and flavor in ["SURF", "FAST"] ):
|
||||
- if( flavor == "SURF" ):
|
||||
+
|
||||
+ elif( new_version >= 2 and flavor in ["SURF", "FAST"] ):
|
||||
+ if( flavor == "SURF" and new_version==2):
|
||||
surfer = cv2.SURF(hessianThreshold=thresh,extended=highQuality,upright=1)
|
||||
#mask = self.getGrayNumpy()
|
||||
#mask.fill(255)
|
||||
@@ -7678,6 +7678,20 @@ class Image:
|
||||
self._mKPFlavor = "SURF"
|
||||
del surfer
|
||||
|
||||
+ if( flavor == "SURF" and new_version==3):
|
||||
+ surfer = cv2.SURF(hessianThreshold=thresh,extended=highQuality,upright=1)
|
||||
+ self._mKeyPoints,self._mKPDescriptors = surfer.detectAndCompute(self.getGrayNumpy(),None,useProvidedKeypoints = False)
|
||||
+ if( len(self._mKPDescriptors) == 0 ):
|
||||
+ return None, None
|
||||
+
|
||||
+ if( highQuality == 1 ):
|
||||
+ self._mKPDescriptors = self._mKPDescriptors.reshape((-1,128))
|
||||
+ else:
|
||||
+ self._mKPDescriptors = self._mKPDescriptors.reshape((-1,64))
|
||||
+
|
||||
+ self._mKPFlavor = "SURF"
|
||||
+ del surfer
|
||||
+
|
||||
elif( flavor == "FAST" ):
|
||||
faster = cv2.FastFeatureDetector(threshold=int(thresh),nonmaxSuppression=True)
|
||||
self._mKeyPoints = faster.detect(self.getGrayNumpy())
|
||||
@@ -7693,19 +7707,19 @@ class Image:
|
||||
if( len(self._mKPDescriptors) == 0 ):
|
||||
return None, None
|
||||
self._mKPFlavor = flavor
|
||||
- del FeatureDetector
|
||||
+ del FeatureDetector
|
||||
|
||||
elif( new_version >= 1 and flavor in ["FAST", "STAR", "MSER", "Dense"] ):
|
||||
FeatureDetector = cv2.FeatureDetector_create(flavor)
|
||||
self._mKeyPoints = FeatureDetector.detect(self.getGrayNumpy())
|
||||
self._mKPDescriptors = None
|
||||
self._mKPFlavor = flavor
|
||||
- del FeatureDetector
|
||||
-
|
||||
- else:
|
||||
- logger.warning("ImageClass.Keypoints: I don't know the method you want to use")
|
||||
- return None, None
|
||||
-
|
||||
+ del FeatureDetector
|
||||
+
|
||||
+ else:
|
||||
+ logger.warning("ImageClass.Keypoints: I don't know the method you want to use")
|
||||
+ return None, None
|
||||
+
|
||||
return self._mKeyPoints,self._mKPDescriptors
|
||||
|
||||
def _getFLANNMatches(self,sd,td):
|
||||
--
|
||||
1.8.1.5
|
||||
|
@ -0,0 +1,57 @@
|
||||
From d8abe3346d7aa2b192d384476d5f2c89ca9c70e9 Mon Sep 17 00:00:00 2001
|
||||
From: Justin Bronder <jsbronder@gmail.com>
|
||||
Date: Fri, 14 Jun 2013 20:35:11 -0400
|
||||
Subject: [PATCH] remove failing test
|
||||
|
||||
According to the docs, the UserWarning that is raised should not be an
|
||||
issue. Ignore the failure during testings.
|
||||
---
|
||||
SimpleCV/tests/tests.py | 32 --------------------------------
|
||||
1 file changed, 32 deletions(-)
|
||||
|
||||
diff --git a/SimpleCV/tests/tests.py b/SimpleCV/tests/tests.py
|
||||
index 94f4fc7..ce442e3 100644
|
||||
--- a/SimpleCV/tests/tests.py
|
||||
+++ b/SimpleCV/tests/tests.py
|
||||
@@ -1731,38 +1731,6 @@ def test_movement_feature():
|
||||
|
||||
pass
|
||||
|
||||
-def test_keypoint_extraction():
|
||||
- try:
|
||||
- import cv2
|
||||
- except:
|
||||
- pass
|
||||
- return
|
||||
-
|
||||
- img1 = Image("../sampleimages/KeypointTemplate2.png")
|
||||
- img2 = Image("../sampleimages/KeypointTemplate2.png")
|
||||
- img3 = Image("../sampleimages/KeypointTemplate2.png")
|
||||
-
|
||||
- kp1 = img1.findKeypoints()
|
||||
- kp2 = img2.findKeypoints(highQuality=True)
|
||||
- kp3 = img3.findKeypoints(flavor="STAR")
|
||||
- kp1.draw()
|
||||
- kp2.draw()
|
||||
- kp3.draw()
|
||||
- #TODO: Fix FAST binding
|
||||
- #~ kp4 = img.findKeypoints(flavor="FAST",min_quality=10)
|
||||
- if( len(kp1)==190 and
|
||||
- len(kp2)==190 and
|
||||
- len(kp3)==37
|
||||
- #~ and len(kp4)==521
|
||||
- ):
|
||||
- pass
|
||||
- else:
|
||||
- assert False
|
||||
- results = [img1,img2,img3]
|
||||
- name_stem = "test_keypoint_extraction"
|
||||
- perform_diff(results,name_stem,tolerance=3.0)
|
||||
-
|
||||
-
|
||||
def test_keypoint_match():
|
||||
try:
|
||||
import cv2
|
||||
--
|
||||
1.8.1.5
|
||||
|
@ -0,0 +1,301 @@
|
||||
From 77a76251ac911367e94c3b035e1ec243d2846e38 Mon Sep 17 00:00:00 2001
|
||||
From: Justin Bronder <jsbronder@gmail.com>
|
||||
Date: Fri, 14 Jun 2013 20:06:49 -0400
|
||||
Subject: [PATCH] remove failing tests
|
||||
|
||||
---
|
||||
SimpleCV/tests/tests.py | 250 ------------------------------------------------
|
||||
1 file changed, 250 deletions(-)
|
||||
|
||||
diff --git a/SimpleCV/tests/tests.py b/SimpleCV/tests/tests.py
|
||||
index 94f4fc7..d8e79d8 100644
|
||||
--- a/SimpleCV/tests/tests.py
|
||||
+++ b/SimpleCV/tests/tests.py
|
||||
@@ -1649,39 +1649,6 @@ def test_blob_isa_methods():
|
||||
else:
|
||||
assert False
|
||||
|
||||
-def test_findKeypoints():
|
||||
- try:
|
||||
- import cv2
|
||||
- except:
|
||||
- pass
|
||||
- return
|
||||
- img = Image(testimage2)
|
||||
- kp = img.findKeypoints()
|
||||
- for k in kp:
|
||||
- k.getObject()
|
||||
- k.descriptor()
|
||||
- k.quality()
|
||||
- k.octave()
|
||||
- k.flavor()
|
||||
- k.angle()
|
||||
- k.coordinates()
|
||||
- k.draw()
|
||||
- k.distanceFrom()
|
||||
- k.meanColor()
|
||||
- k.area()
|
||||
- k.perimeter()
|
||||
- k.width()
|
||||
- k.height()
|
||||
- k.radius()
|
||||
- k.crop()
|
||||
-
|
||||
- kp.draw()
|
||||
- results = [img]
|
||||
- name_stem = "test_findKeypoints"
|
||||
- #~ perform_diff(results,name_stem)
|
||||
-
|
||||
- pass
|
||||
-
|
||||
def test_movement_feature():
|
||||
current1 = Image("../sampleimages/flow_simple1.png")
|
||||
prev = Image("../sampleimages/flow_simple2.png")
|
||||
@@ -1731,96 +1698,6 @@ def test_movement_feature():
|
||||
|
||||
pass
|
||||
|
||||
-def test_keypoint_extraction():
|
||||
- try:
|
||||
- import cv2
|
||||
- except:
|
||||
- pass
|
||||
- return
|
||||
-
|
||||
- img1 = Image("../sampleimages/KeypointTemplate2.png")
|
||||
- img2 = Image("../sampleimages/KeypointTemplate2.png")
|
||||
- img3 = Image("../sampleimages/KeypointTemplate2.png")
|
||||
-
|
||||
- kp1 = img1.findKeypoints()
|
||||
- kp2 = img2.findKeypoints(highQuality=True)
|
||||
- kp3 = img3.findKeypoints(flavor="STAR")
|
||||
- kp1.draw()
|
||||
- kp2.draw()
|
||||
- kp3.draw()
|
||||
- #TODO: Fix FAST binding
|
||||
- #~ kp4 = img.findKeypoints(flavor="FAST",min_quality=10)
|
||||
- if( len(kp1)==190 and
|
||||
- len(kp2)==190 and
|
||||
- len(kp3)==37
|
||||
- #~ and len(kp4)==521
|
||||
- ):
|
||||
- pass
|
||||
- else:
|
||||
- assert False
|
||||
- results = [img1,img2,img3]
|
||||
- name_stem = "test_keypoint_extraction"
|
||||
- perform_diff(results,name_stem,tolerance=3.0)
|
||||
-
|
||||
-
|
||||
-def test_keypoint_match():
|
||||
- try:
|
||||
- import cv2
|
||||
- except:
|
||||
- pass
|
||||
- return
|
||||
-
|
||||
- template = Image("../sampleimages/KeypointTemplate2.png")
|
||||
- match0 = Image("../sampleimages/kptest0.png")
|
||||
- match1 = Image("../sampleimages/kptest1.png")
|
||||
- match3 = Image("../sampleimages/kptest2.png")
|
||||
- match2 = Image("../sampleimages/aerospace.jpg")# should be none
|
||||
-
|
||||
- fs0 = match0.findKeypointMatch(template)#test zero
|
||||
- fs1 = match1.findKeypointMatch(template,quality=300.00,minDist=0.5,minMatch=0.2)
|
||||
- fs3 = match3.findKeypointMatch(template,quality=300.00,minDist=0.5,minMatch=0.2)
|
||||
- print "This should fail"
|
||||
- fs2 = match2.findKeypointMatch(template,quality=500.00,minDist=0.2,minMatch=0.1)
|
||||
- if( fs0 is not None and fs1 is not None and fs2 is None and fs3 is not None):
|
||||
- fs0.draw()
|
||||
- fs1.draw()
|
||||
- fs3.draw()
|
||||
- f = fs0[0]
|
||||
- f.drawRect()
|
||||
- f.draw()
|
||||
- f.getHomography()
|
||||
- f.getMinRect()
|
||||
- f.meanColor()
|
||||
- f.crop()
|
||||
- f.x
|
||||
- f.y
|
||||
- f.coordinates()
|
||||
- else:
|
||||
- assert False
|
||||
-
|
||||
- results = [match0,match1,match2,match3]
|
||||
- name_stem = "test_find_keypoint_match"
|
||||
- perform_diff(results,name_stem)
|
||||
-
|
||||
-
|
||||
-def test_draw_keypoint_matches():
|
||||
- try:
|
||||
- import cv2
|
||||
- except:
|
||||
- pass
|
||||
- return
|
||||
- template = Image("../sampleimages/KeypointTemplate2.png")
|
||||
- match0 = Image("../sampleimages/kptest0.png")
|
||||
- result = match0.drawKeypointMatches(template,thresh=500.00,minDist=0.15,width=1)
|
||||
-
|
||||
- results = [result]
|
||||
- name_stem = "test_draw_keypoint_matches"
|
||||
- perform_diff(results,name_stem,tolerance=4.0)
|
||||
-
|
||||
-
|
||||
- pass
|
||||
-
|
||||
-
|
||||
def test_basic_palette():
|
||||
img = Image(testimageclr)
|
||||
img._generatePalette(10,False)
|
||||
@@ -2303,29 +2180,6 @@ def test_blob_spatial_relationships():
|
||||
if( not center.contains(inside) ):
|
||||
assert False
|
||||
|
||||
-def test_get_aspectratio():
|
||||
- img = Image("../sampleimages/EdgeTest1.png")
|
||||
- img2 = Image("../sampleimages/EdgeTest2.png")
|
||||
- b = img.findBlobs()
|
||||
- l = img2.findLines()
|
||||
- c = img2.findCircle(thresh=200)
|
||||
- c2 = img2.findCorners()
|
||||
- kp = img2.findKeypoints()
|
||||
- bb = b.aspectRatios()
|
||||
- ll = l.aspectRatios()
|
||||
- cc = c.aspectRatios()
|
||||
- c22 = c2.aspectRatios()
|
||||
- kp2 = kp.aspectRatios()
|
||||
-
|
||||
- if( len(bb) > 0 and
|
||||
- len(ll) > 0 and
|
||||
- len(cc) > 0 and
|
||||
- len(c22) > 0 and
|
||||
- len(kp2) > 0 ):
|
||||
- pass
|
||||
- else:
|
||||
- assert False
|
||||
-
|
||||
def test_line_crop():
|
||||
img = Image("../sampleimages/EdgeTest2.png")
|
||||
l = img.findLines().sortArea()
|
||||
@@ -2391,74 +2245,6 @@ def test_save_kwargs():
|
||||
s80 = os.remove(l80)
|
||||
s70 = os.remove(l70)
|
||||
|
||||
-def test_on_edge():
|
||||
- img1 = "./../sampleimages/EdgeTest1.png"
|
||||
- img2 = "./../sampleimages/EdgeTest2.png"
|
||||
- imgA = Image(img1)
|
||||
- imgB = Image(img2)
|
||||
- imgC = Image(img2)
|
||||
- imgD = Image(img2)
|
||||
- imgE = Image(img2)
|
||||
-
|
||||
- blobs = imgA.findBlobs()
|
||||
- circs = imgB.findCircle(thresh=200)
|
||||
- corners = imgC.findCorners()
|
||||
- kp = imgD.findKeypoints()
|
||||
- lines = imgE.findLines()
|
||||
-
|
||||
- rim = blobs.onImageEdge()
|
||||
- inside = blobs.notOnImageEdge()
|
||||
- rim.draw(color=Color.RED)
|
||||
- inside.draw(color=Color.BLUE)
|
||||
-
|
||||
- rim = circs.onImageEdge()
|
||||
- inside = circs.notOnImageEdge()
|
||||
- rim.draw(color=Color.RED)
|
||||
- inside.draw(color=Color.BLUE)
|
||||
-
|
||||
- #rim = corners.onImageEdge()
|
||||
- inside = corners.notOnImageEdge()
|
||||
- #rim.draw(color=Color.RED)
|
||||
- inside.draw(color=Color.BLUE)
|
||||
-
|
||||
- #rim = kp.onImageEdge()
|
||||
- inside = kp.notOnImageEdge()
|
||||
- #rim.draw(color=Color.RED)
|
||||
- inside.draw(color=Color.BLUE)
|
||||
-
|
||||
- rim = lines.onImageEdge()
|
||||
- inside = lines.notOnImageEdge()
|
||||
- rim.draw(color=Color.RED)
|
||||
- inside.draw(color=Color.BLUE)
|
||||
-
|
||||
- results = [imgA,imgB,imgC,imgD,imgE]
|
||||
- name_stem = "test_onEdge_Features"
|
||||
- #~ perform_diff(results,name_stem,tolerance=8.0)
|
||||
-
|
||||
-def test_feature_angles():
|
||||
- img = Image("../sampleimages/rotation2.png")
|
||||
- img2 = Image("../sampleimages/rotation.jpg")
|
||||
- img3 = Image("../sampleimages/rotation.jpg")
|
||||
- b = img.findBlobs()
|
||||
- l = img2.findLines()
|
||||
- k = img3.findKeypoints()
|
||||
-
|
||||
- for bs in b:
|
||||
- tl = bs.topLeftCorner()
|
||||
- img.drawText(str(bs.angle()),tl[0],tl[1],color=Color.RED)
|
||||
-
|
||||
- for ls in l:
|
||||
- tl = ls.topLeftCorner()
|
||||
- img2.drawText(str(ls.angle()),tl[0],tl[1],color=Color.GREEN)
|
||||
-
|
||||
- for ks in k:
|
||||
- tl = ks.topLeftCorner()
|
||||
- img3.drawText(str(ks.angle()),tl[0],tl[1],color=Color.BLUE)
|
||||
-
|
||||
- results = [img,img2,img3]
|
||||
- name_stem = "test_feature_angles"
|
||||
- perform_diff(results,name_stem,tolerance=9.0)
|
||||
-
|
||||
def test_feature_angles_rotate():
|
||||
img = Image("../sampleimages/rotation2.png")
|
||||
b = img.findBlobs()
|
||||
@@ -2740,42 +2526,6 @@ def test_getSkintoneMask():
|
||||
name_stem = 'test_skintone'
|
||||
perform_diff(masks,name_stem,tolerance=17)
|
||||
|
||||
-def test_findKeypoints_all():
|
||||
- try:
|
||||
- import cv2
|
||||
- except:
|
||||
- pass
|
||||
- return
|
||||
- img = Image(testimage2)
|
||||
- methods = ["ORB", "SIFT", "SURF","FAST", "STAR", "MSER", "Dense"]
|
||||
- for i in methods :
|
||||
- print i
|
||||
- kp = img.findKeypoints(flavor = i)
|
||||
- if kp!=None :
|
||||
- for k in kp:
|
||||
- k.getObject()
|
||||
- k.descriptor()
|
||||
- k.quality()
|
||||
- k.octave()
|
||||
- k.flavor()
|
||||
- k.angle()
|
||||
- k.coordinates()
|
||||
- k.draw()
|
||||
- k.distanceFrom()
|
||||
- k.meanColor()
|
||||
- k.area()
|
||||
- k.perimeter()
|
||||
- k.width()
|
||||
- k.height()
|
||||
- k.radius()
|
||||
- k.crop()
|
||||
- kp.draw()
|
||||
- results = [img]
|
||||
- name_stem = "test_findKeypoints"
|
||||
- #~ perform_diff(results,name_stem,tolerance=8)
|
||||
- pass
|
||||
-
|
||||
-
|
||||
def test_upload_flickr():
|
||||
try:
|
||||
import flickrapi
|
||||
--
|
||||
1.8.1.5
|
||||
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer>
|
||||
<email>jsbronder@gentoo.org</email>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="shell">Enable the iPython SimpleCV shell</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
@ -0,0 +1,49 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-python/simplecv/simplecv-1.3.ebuild,v 1.1 2013/06/26 22:50:48 jsbronder Exp $
|
||||
|
||||
EAPI=5
|
||||
PYTHON_COMPAT=( python2_7 )
|
||||
|
||||
inherit distutils-r1 vcs-snapshot
|
||||
|
||||
MY_PN=SimpleCV
|
||||
|
||||
DESCRIPTION="Python interface to several powerful open source computer vision libraries."
|
||||
HOMEPAGE="http://simplecv.org/"
|
||||
SRC_URI="https://github.com/sightmachine/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="shell test"
|
||||
|
||||
DEPEND="
|
||||
test? ( dev-python/nose[${PYTHON_USEDEP}] )"
|
||||
|
||||
RDEPEND="
|
||||
>=media-libs/opencv-2.2
|
||||
dev-python/numpy[${PYTHON_USEDEP}]
|
||||
sci-libs/scipy[${PYTHON_USEDEP}]
|
||||
dev-python/imaging[${PYTHON_USEDEP}]
|
||||
dev-python/pygame[${PYTHON_USEDEP}]
|
||||
shell? ( dev-python/ipython[${PYTHON_USEDEP}] )"
|
||||
|
||||
# 1. FeatureDetector being called with the wrong number of arguments
|
||||
# 2. Remove test that according to docs shouldn't be an issue
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/new-support-for-opencv-2.4.3-added.patch
|
||||
"${FILESDIR}"/remove-failing-test.patch
|
||||
)
|
||||
|
||||
src_test() {
|
||||
cd "${S}/SimpleCV/tests"
|
||||
nosetests tests.py || die "tests failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
distutils-r1_src_install
|
||||
if ! use shell; then
|
||||
rm -rf "${D}"/usr/bin
|
||||
fi
|
||||
}
|
@ -1 +1,2 @@
|
||||
DIST flog-2.5.3.gem 20480 SHA256 6e78f6de2bf2d216c3639585427c3ea0d3c4a84509a2a4bc934a23ee004ad788 SHA512 cff1c7cb95c02bd498644de0879bbab04f00ac606e5a920a7ebee89870909d2c93878ab354bdd2dc22635521cc8c0631489d33c780e44d2fec9aa0b4cc0992cd WHIRLPOOL 2d537d7a04b2db5df138e685fee65d554e0ec9c8cbe0647ecf97a1c8825187fd170d0294085f9f2b9cfa21f43a0f76818e9a2c451202ddf54cbc9da13618a926
|
||||
DIST flog-3.2.3.gem 22528 SHA256 eb215725d5700eff3e658cc96eb0972452f8a9265bae59d0391a5da44a82f457 SHA512 96d25ab52797362612d65eb318551864a34938ffd7ca2b5b3459be457a2d7bdec81c5f8a4cac2815cfa753bdc598ba13805f3997ca004934a703d5d2908cf4b2 WHIRLPOOL dd22f3eef2c6044dcfdad4ed354659133fc3af14a23b0efaea33fa8f93fa6e8fe06729c6ea0cce16092ed7243c48c8c07ca4420ca128fd173089e09eab77f0b3
|
||||
|
@ -0,0 +1,28 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/flog/flog-3.2.3.ebuild,v 1.1 2013/06/27 06:33:52 graaff Exp $
|
||||
|
||||
EAPI=5
|
||||
USE_RUBY="ruby18 ruby19 jruby"
|
||||
|
||||
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
|
||||
RUBY_FAKEGEM_EXTRADOC="History.txt README.txt"
|
||||
|
||||
inherit ruby-fakegem
|
||||
|
||||
DESCRIPTION="Flog reports the most tortured code in an easy to read pain report."
|
||||
HOMEPAGE="http://ruby.sadi.st/"
|
||||
LICENSE="MIT"
|
||||
|
||||
KEYWORDS="~x86 ~amd64"
|
||||
SLOT="0"
|
||||
IUSE=""
|
||||
|
||||
ruby_add_bdepend "test? ( dev-ruby/minitest )"
|
||||
|
||||
ruby_add_rdepend "=dev-ruby/ruby_parser-3* >dev-ruby/ruby_parser-3.1.0
|
||||
=dev-ruby/sexp_processor-4*"
|
||||
|
||||
each_ruby_test() {
|
||||
${RUBY} -Ilib test/test_flog.rb || die
|
||||
}
|
@ -1 +1,2 @@
|
||||
DIST texlive-20120701-source.tar.xz 131904044 SHA256 9666617d5dac3e82578e696835cc9f251ee0a56d162d86dff08659ac5dcb6c81 SHA512 0e8653aa21094e079900d17256f0768ac5514690a3725d96923d5fdc7633484d611441df1af8c674b38b9ce6a8845a9004976cd00635742dfc6837aa433caf5f WHIRLPOOL 9d570a1bd58cca8baed399ab53eb767c7c3db607c00363ce563e14dfccdd235703c538e6a651aa7f2934adf21f8477775f1547f9e7f3d957b89af644c89bcb57
|
||||
DIST texlive-20130530-source.tar.xz 179963948 SHA256 a905832e4c04dd1cb16db4bb7baacb78fbc19682bd33ac2697a3a85ce78d79d4 SHA512 4aa85273a675af2453f09777b7cb348c18add77410d72f562c6586f6814d4e7c34b6f3690e3453020654fb0a265339fcabf590d9155367d52846224499af334c WHIRLPOOL 3affaf25d3936505d971599092964b0f0e97d107d22dbac6a85ad547e1d2726a6a09c5075fecb0c6ff8c88bc1bd09d78f95902f76eb76c608f8a7bc42dd6bc33
|
||||
|
@ -0,0 +1,37 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-tex/bibtexu/bibtexu-3.71_p20130530.ebuild,v 1.1 2013/06/27 13:15:19 aballier Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
DESCRIPTION="8-bit Implementation of BibTeX 0.99 with a Very Large Capacity"
|
||||
HOMEPAGE="http://tug.org/texlive/"
|
||||
SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND=">=dev-libs/kpathsea-6.1.0_p20120701
|
||||
>=dev-libs/icu-4.4
|
||||
!<app-text/texlive-core-2013"
|
||||
DEPEND="${RDEPEND}
|
||||
virtual/pkgconfig"
|
||||
|
||||
S=${WORKDIR}/texlive-${PV#*_p}-source/texk/bibtex-x
|
||||
|
||||
src_configure() {
|
||||
econf \
|
||||
--with-system-kpathsea \
|
||||
--with-system-icu
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
csfdir="${EPREFIX}/usr/share/texmf-dist/bibtexu/csf/base" \
|
||||
btdocdir="${EPREFIX}/usr/share/doc/${PF}" \
|
||||
install
|
||||
dodoc 00readme.txt ChangeLog csfile.txt HISTORY
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-util/debhelper/debhelper-9.20130626.ebuild,v 1.1 2013/06/27 12:53:44 jer Exp $
|
||||
|
||||
EAPI=5
|
||||
inherit eutils toolchain-funcs
|
||||
|
||||
DESCRIPTION="Collection of programs that can be used to automate common tasks in debian/rules"
|
||||
HOMEPAGE="http://packages.qa.debian.org/d/debhelper.html http://joeyh.name/code/debhelper/"
|
||||
SRC_URI="mirror://debian/pool/main/d/${PN}/${P/-/_}.tar.gz"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux"
|
||||
IUSE="test"
|
||||
DH_LINGUAS=( de es fr )
|
||||
IUSE+=" ${DH_LINGUAS[@]/#/linguas_}"
|
||||
|
||||
NLS_DEPEND=$(
|
||||
printf "linguas_%s? ( >=app-text/po4a-0.24 )\n" ${DH_LINGUAS[@]}
|
||||
)
|
||||
|
||||
RDEPEND="
|
||||
>=dev-lang/perl-5.10
|
||||
app-arch/dpkg
|
||||
dev-perl/TimeDate
|
||||
virtual/perl-Getopt-Long
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
${NLS_DEPEND}
|
||||
test? ( dev-perl/Test-Pod )
|
||||
"
|
||||
|
||||
S=${WORKDIR}/${PN}
|
||||
|
||||
src_compile() {
|
||||
tc-export CC
|
||||
|
||||
local LANGS="" USE_NLS=no lingua
|
||||
for lingua in ${DH_LINGUAS[@]}; do
|
||||
if use linguas_${lingua}; then
|
||||
LANGS+=" ${lingua}"
|
||||
USE_NLS=yes
|
||||
fi
|
||||
done
|
||||
|
||||
emake USE_NLS="${USE_NLS}" LANGS="${LANGS}" build
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
|
||||
dodoc doc/* debian/changelog
|
||||
docinto examples
|
||||
dodoc examples/*
|
||||
local lingua
|
||||
for manfile in *.1 *.7 ; do
|
||||
for lingua in ${DH_LINGUAS[@]}; do
|
||||
case ${manfile} in
|
||||
*.${lingua}.?)
|
||||
use linguas_${lingua} \
|
||||
&& cp ${manfile} "${T}"/${manfile/.${lingua}/} \
|
||||
&& doman -i18n=${lingua} "${T}"/${manfile/.${lingua}/}
|
||||
;;
|
||||
*)
|
||||
doman ${manfile}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
DIST renpy-6.14.1-source.tar.bz2 9806538 SHA256 18be3630d1956131a1f010732d15292cdcec14a2391210af27dc342fafd8197f SHA512 a1f13a5f860e66054012eab29bbd37715bd9721e2dc30fdd9c8d4d8c58dc672c35b3c813e962ad6878cb741502af5a181dff8a05f359892b6b60d2e15bc5a7bc WHIRLPOOL 54018731e136106f328bf2d028841f09424d8ffd8303821eec995c55918b2c8ac7eb97d9ed24785e95ad3d878b794f5bcf96cc9f783955f8d1ace086a3ca9b61
|
||||
DIST renpy-6.15.4-source.tar.bz2 10393987 SHA256 1c32fef5fda6f14134ea5e18f4754934644f86bdd968b4600b03b373f2d8e9cb SHA512 d68d5d64b29bf3eb19a38aa9dc540278e0b054dc2629aaa01866fbf2976cc6a5ffb0027706004526112782b25d0a8aae76a6b3958b5bfdac8a62841ba223554a WHIRLPOOL 008e1e3986d97d24256b6438de00be7ae676c893a67d975037c8bbfc5bfbdb886cb70d28bed3dfbec5c6529906b66071cc990fc617c1b579f8d2f9f9afe20ca8
|
||||
DIST renpy-6.15.5-source.tar.bz2 10433241 SHA256 e174a61d9861144895a8a4334b6c0058c4c18c2405cd8cc7f9418380895c833b SHA512 8d1a1993fd90288a72e64d55d6e0da3f0fcfc513d2cdf63c6f4c3d84404ab7babdfb97db565c6063b057e6331f367c4662a4fc2151e8dc78c126cb19ecdfe893 WHIRLPOOL 71a0c8574f8a3b3c5008c16d20585da5a8e7f8532f66a6839ab1e2309441e70364ae45ac9e5e3088be21ad53c46e21728b1c25e893c392d1c26a200c3ae1406c
|
||||
DIST renpy-6.15.7-source.tar.bz2 10421736 SHA256 b4280b62f7c8f730a37c7e567b16216b4578fc3640fbcdf5df7c65a73ae52e52 SHA512 d79b1d6b931f281ff208b8ece3889c116ceb05c58fe115e9f7f470788e74e63cfeb3df4f804b4a37a4f1da6ba194c883023808fafc8e8beddf864424958204e6 WHIRLPOOL 202ddb045f440f9abd06f5ac02ebd92a7b0300b14f4755271f1fc4e91bdea21cda19a432f45516f68ba3ad7ead98d7491382ad5c633da277a674f799458795f3
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/games-engines/renpy/renpy-6.15.5.ebuild,v 1.1 2013/06/05 12:27:29 hasufell Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/games-engines/renpy/renpy-6.15.7.ebuild,v 1.1 2013/06/27 00:07:22 hasufell Exp $
|
||||
|
||||
EAPI=5
|
||||
PYTHON_COMPAT=( python2_6 python2_7 )
|
@ -1,2 +1 @@
|
||||
DIST OpenCV-2.4.3.tar.bz2 67240491 SHA256 f8fbe985978d4eae73e8c3b526ed40a37d4761d2029a5b035233f58146f6f59b SHA512 5305e726089f3f43b2bac06b09e2b5f021c63421ba0b36eeb10e43a067a6954569fccb5a66ff8971e83ffb2c3829df222b74e6a33117f85286b3389e5add232e WHIRLPOOL a384e7d09ac31638bb4bc93c2c7c6b2bc88d0344a494d44d53110528a1abb84250b7979c46d3be55891b61b952ed780f10cee41478bdb906357d80bf52f52b57
|
||||
DIST opencv-2.4.5.tar.gz 81884985 SHA256 d30beecf4b57977fbd1635af54c5ab3fc00113e9e59a9d58081732260fe06292 SHA512 2e0ab19203cc5d3a4d83633ee9762441d0d12128752edecb351b3c4abddc1714baf4b320b161f8b58e771933506bfa5a192d394a3b6b5b63d914923c6a767a08 WHIRLPOOL 117551edab5837a9382a6d84dec7f84fb693485e3cad7c08d38158baa22951381eb4958caaaa910dcef6ee2b78a0a494d732d0cac88cd18f1f6ebc2d30e3ddf0
|
||||
|
@ -1,182 +0,0 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/media-libs/opencv/opencv-2.4.3.ebuild,v 1.8 2013/04/06 10:17:50 dilfridge Exp $
|
||||
|
||||
EAPI=4
|
||||
PYTHON_DEPEND="2:2.6"
|
||||
|
||||
inherit base toolchain-funcs cmake-utils python
|
||||
|
||||
MY_P=OpenCV-${PV}
|
||||
|
||||
DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
|
||||
HOMEPAGE="http://opencv.willowgarage.com"
|
||||
SRC_URI="mirror://sourceforge/${PN}library/${MY_P}.tar.bz2"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ppc x86 ~amd64-linux"
|
||||
IUSE="cuda doc eigen examples ffmpeg gstreamer gtk ieee1394 ipp jpeg jpeg2k opencl openexr opengl pch png qt4 testprograms threads tiff v4l xine"
|
||||
|
||||
RDEPEND="
|
||||
app-arch/bzip2
|
||||
dev-python/numpy
|
||||
sys-libs/zlib
|
||||
cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2 )
|
||||
eigen? ( dev-cpp/eigen:2 )
|
||||
ffmpeg? ( virtual/ffmpeg )
|
||||
gstreamer? (
|
||||
media-libs/gstreamer:0.10
|
||||
media-libs/gst-plugins-base:0.10
|
||||
)
|
||||
gtk? (
|
||||
dev-libs/glib:2
|
||||
x11-libs/gtk+:2
|
||||
)
|
||||
jpeg? ( virtual/jpeg )
|
||||
jpeg2k? ( media-libs/jasper )
|
||||
ieee1394? (
|
||||
media-libs/libdc1394
|
||||
sys-libs/libraw1394
|
||||
)
|
||||
ipp? ( sci-libs/ipp )
|
||||
opencl? ( virtual/opencl )
|
||||
openexr? ( media-libs/openexr )
|
||||
opengl? ( virtual/glu )
|
||||
png? ( media-libs/libpng:0 )
|
||||
qt4? (
|
||||
dev-qt/qtgui:4
|
||||
dev-qt/qttest:4
|
||||
opengl? ( dev-qt/qtopengl:4 )
|
||||
)
|
||||
threads? ( dev-cpp/tbb )
|
||||
tiff? ( media-libs/tiff )
|
||||
v4l? ( >=media-libs/libv4l-0.8.3 )
|
||||
xine? ( media-libs/xine-lib )
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
virtual/pkgconfig
|
||||
"
|
||||
|
||||
# REQUIRED_USE="opengl? ( qt )"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-2.3.1a-libav-0.7.patch"
|
||||
"${FILESDIR}/${PN}-2.4.3-gcc47.patch"
|
||||
"${FILESDIR}/${PN}-2.4.2-cflags.patch"
|
||||
)
|
||||
|
||||
S=${WORKDIR}/${MY_P}
|
||||
|
||||
pkg_setup() {
|
||||
python_set_active_version 2
|
||||
python_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
base_src_prepare
|
||||
|
||||
# remove bundled stuff
|
||||
rm -rf 3rdparty
|
||||
sed -i \
|
||||
-e '/add_subdirectory(3rdparty)/ d' \
|
||||
CMakeLists.txt || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# please dont sort here, order is the same as in CMakeLists.txt
|
||||
local mycmakeargs=(
|
||||
# the optinal dependency libraries
|
||||
$(cmake-utils_use_with ieee1394 1394)
|
||||
-DWITH_AVFOUNDATION=OFF
|
||||
-DWITH_CARBON=OFF
|
||||
$(cmake-utils_use_with eigen)
|
||||
$(cmake-utils_use_with ffmpeg)
|
||||
$(cmake-utils_use_with gstreamer)
|
||||
$(cmake-utils_use_with gtk)
|
||||
$(cmake-utils_use_with ipp)
|
||||
$(cmake-utils_use_with jpeg2k JASPER)
|
||||
$(cmake-utils_use_with jpeg)
|
||||
$(cmake-utils_use_with opencl)
|
||||
# $(cmake-utils_use_with opencl OPENCLAMDFFT)
|
||||
# $(cmake-utils_use_with opencl OPENCLAMDBLAS)
|
||||
$(cmake-utils_use_with openexr)
|
||||
$(cmake-utils_use_with opengl)
|
||||
-DWITH_OPENNI=OFF # not packaged
|
||||
$(cmake-utils_use_with png)
|
||||
-DWITH_PVAPI=OFF # not packaged
|
||||
$(cmake-utils_use_with qt4 QT)
|
||||
-DWITH_QUICKTIME=OFF
|
||||
$(cmake-utils_use_with threads TBB)
|
||||
$(cmake-utils_use_with tiff)
|
||||
-DWITH_UNICAP=OFF # not packaged
|
||||
$(cmake-utils_use_with v4l V4L)
|
||||
-DWITH_VIDEOINPUT=OFF # windows only
|
||||
-DWITH_XIMEA=OFF # windows only
|
||||
$(cmake-utils_use_with xine)
|
||||
# the build components
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DBUILD_ANDROID_EXAMPLES=OFF
|
||||
$(cmake-utils_use_build doc DOCS)
|
||||
$(cmake-utils_use_build examples)
|
||||
-DBUILD_PERF_TESTS=OFF
|
||||
$(cmake-utils_use_build testprograms TESTS)
|
||||
# install examples
|
||||
$(cmake-utils_use examples INSTALL_C_EXAMPLES)
|
||||
# build options
|
||||
$(cmake-utils_use_enable pch PRECOMPILED_HEADERS)
|
||||
-DENABLE_OMIT_FRAME_POINTER=OFF #
|
||||
-DENABLE_FAST_MATH=OFF #
|
||||
-DENABLE_SSE=OFF # these options do nothing but
|
||||
-DENABLE_SSE2=OFF # add params to CFLAGS
|
||||
-DENABLE_SSE3=OFF
|
||||
-DENABLE_SSSE3=OFF
|
||||
-DENABLE_SSE41=OFF
|
||||
-DENABLE_SSE42=OFF
|
||||
-DOPENCV_EXTRA_FLAGS_RELEASE="" # black magic
|
||||
)
|
||||
|
||||
if use cuda; then
|
||||
if [[ "$(gcc-version)" > "4.6" ]]; then
|
||||
ewarn "CUDA and >=sys-devel/gcc-4.7 do not play well together. Disabling CUDA support."
|
||||
mycmakeargs+=( "-DWITH_CUDA=OFF" )
|
||||
mycmakeargs+=( "-DWITH_CUBLAS=OFF" )
|
||||
mycmakeargs+=( "-DWITH_CUFFT=OFF" )
|
||||
else
|
||||
mycmakeargs+=( "-DWITH_CUDA=ON" )
|
||||
mycmakeargs+=( "-DWITH_CUBLAS=ON" )
|
||||
mycmakeargs+=( "-DWITH_CUFFT=ON" )
|
||||
fi
|
||||
else
|
||||
mycmakeargs+=( "-DWITH_CUDA=OFF" )
|
||||
mycmakeargs+=( "-DWITH_CUBLAS=OFF" )
|
||||
mycmakeargs+=( "-DWITH_CUFFT=OFF" )
|
||||
fi
|
||||
|
||||
if use examples; then
|
||||
mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=ON" )
|
||||
else
|
||||
mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=OFF" )
|
||||
fi
|
||||
|
||||
# things we want to be hard off or not yet figured out
|
||||
mycmakeargs+=(
|
||||
"-DOPENCV_BUILD_3RDPARTY_LIBS=OFF"
|
||||
"-DBUILD_LATEX_DOCS=OFF"
|
||||
"-DBUILD_PACKAGE=OFF"
|
||||
"-DENABLE_PROFILING=OFF"
|
||||
)
|
||||
|
||||
# things we want to be hard enabled not worth useflag
|
||||
mycmakeargs+=(
|
||||
"-DCMAKE_SKIP_RPATH=ON"
|
||||
"-DOPENCV_DOC_INSTALL_PATH=${EPREFIX}/usr/share/doc/${PF}"
|
||||
)
|
||||
|
||||
# hardcode cuda paths
|
||||
mycmakeargs+=(
|
||||
"-DCUDA_NPP_LIBRARY_ROOT_DIR=/opt/cuda"
|
||||
)
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue