Gentoo Archives: gentoo-commits

From: "Lars Wendler (polynomial-c)" <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-libs/libhugetlbfs: libhugetlbfs-2.19.ebuild ChangeLog libhugetlbfs-2.16.ebuild libhugetlbfs-2.17.ebuild
Date: Fri, 29 May 2015 07:33:04
Message-Id: 20150529073254.5D3FAA04@oystercatcher.gentoo.org
1 polynomial-c 15/05/29 07:32:54
2
3 Modified: ChangeLog
4 Added: libhugetlbfs-2.19.ebuild
5 Removed: libhugetlbfs-2.16.ebuild libhugetlbfs-2.17.ebuild
6 Log:
7 Version bump. Removed old
8
9 (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)
10
11 Revision Changes Path
12 1.14 sys-libs/libhugetlbfs/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog?rev=1.14&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog?rev=1.14&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog?r1=1.13&r2=1.14
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v
21 retrieving revision 1.13
22 retrieving revision 1.14
23 diff -u -r1.13 -r1.14
24 --- ChangeLog 25 Apr 2014 08:48:48 -0000 1.13
25 +++ ChangeLog 29 May 2015 07:32:54 -0000 1.14
26 @@ -1,6 +1,13 @@
27 # ChangeLog for sys-libs/libhugetlbfs
28 -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.13 2014/04/25 08:48:48 radhermit Exp $
30 +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
31 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.14 2015/05/29 07:32:54 polynomial-c Exp $
32 +
33 +*libhugetlbfs-2.19 (29 May 2015)
34 +
35 + 29 May 2015; Lars Wendler <polynomial-c@g.o>
36 + -libhugetlbfs-2.16.ebuild, -libhugetlbfs-2.17.ebuild,
37 + +libhugetlbfs-2.19.ebuild:
38 + Version bump. Removed old.
39
40 *libhugetlbfs-2.18 (25 Apr 2014)
41
42
43
44
45 1.1 sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild?rev=1.1&content-type=text/plain
49
50 Index: libhugetlbfs-2.19.ebuild
51 ===================================================================
52 # Copyright 1999-2015 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild,v 1.1 2015/05/29 07:32:54 polynomial-c Exp $
55
56 EAPI="4"
57
58 inherit eutils multilib toolchain-funcs
59
60 DESCRIPTION="easy hugepage access"
61 HOMEPAGE="http://libhugetlbfs.sourceforge.net/"
62 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
63
64 LICENSE="GPL-2"
65 SLOT="0"
66 KEYWORDS="~amd64 ~ppc64 ~x86"
67 IUSE="static-libs"
68
69 src_prepare() {
70 epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
71 epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
72 epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
73 sed -i \
74 -e '/^PREFIX/s:/local::' \
75 -e '1iBUILDTYPE = NATIVEONLY' \
76 -e '1iV = 1' \
77 -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
78 -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
79 Makefile
80 if [ "$(get_libdir)" == "lib64" ]; then
81 sed -i \
82 -e "/^LIB\(32\)/s:=.*:= lib32:" \
83 Makefile
84 fi
85 }
86
87 src_compile() {
88 tc-export AR
89 emake CC="$(tc-getCC)" libs tools
90 }
91
92 src_install() {
93 default
94 use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.a
95 rm "${D}"/usr/bin/oprofile* || die
96 }
97
98 src_test_alloc_one() {
99 hugeadm="$1"
100 sign="$2"
101 pagesize="$3"
102 pagecount="$4"
103 ${hugeadm} \
104 --pool-pages-max ${pagesize}:${sign}${pagecount} \
105 && \
106 ${hugeadm} \
107 --pool-pages-min ${pagesize}:${sign}${pagecount}
108 return $?
109 }
110
111 # die is NOT allowed in this src_test block after the marked point, so that we
112 # can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
113 src_test() {
114 [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
115 einfo "Building testsuite"
116 emake -j1 tests || die "Failed to build tests"
117
118 hugeadm='obj/hugeadm'
119 allocated=''
120 rc=0
121 # the testcases need 64MiB per pagesize.
122 MIN_HUGEPAGE_RAM=$((64*1024*1024))
123
124 einfo "Planning allocation"
125 PAGESIZES="$(${hugeadm} --page-sizes-all)"
126
127 # Need to do this before we can create the mountpoints.
128 for pagesize in ${PAGESIZES} ; do
129 # The kernel depends on the location :-(
130 mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
131 addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
132 done
133 addwrite /proc/sys/vm/
134 addwrite /proc/sys/kernel/shmall
135 addwrite /proc/sys/kernel/shmmax
136 addwrite /proc/sys/kernel/shmmni
137
138 einfo "Checking HugeTLB mountpoints"
139 ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
140
141 # -----------------------------------------------------
142 # --------- die is unsafe after this point. -----------
143 # -----------------------------------------------------
144
145 einfo "Starting allocation"
146 for pagesize in ${PAGESIZES} ; do
147 pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
148 einfo " ${pagecount} @ ${pagesize}"
149 addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
150 src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
151 rc=$?
152 if [[ $rc -eq 0 ]]; then
153 allocated="${allocated} ${pagesize}:${pagecount}"
154 else
155 eerror "Failed to add ${pagecount} pages of size ${pagesize}"
156 fi
157 done
158
159 einfo "Allocation status"
160 ${hugeadm} --pool-list
161
162 if [[ -n "${allocated}" ]]; then
163 # All our allocations worked, so time to run.
164 einfo "Starting tests"
165 cd "${S}"/tests
166 TESTOPTS="-t func"
167 case $ARCH in
168 amd64|ppc64)
169 TESTOPTS="${TESTOPTS} -b 64"
170 ;;
171 x86)
172 TESTOPTS="${TESTOPTS} -b 32"
173 ;;
174 esac
175 # This needs a bit of work to give a nice exit code still.
176 ./run_tests.py ${TESTOPTS}
177 rc=$?
178 else
179 eerror "Failed to make HugeTLB allocations."
180 rc=1
181 fi
182
183 einfo "Cleaning up memory"
184 cd "${S}"
185 # Cleanup memory allocation
186 for alloc in ${allocated} ; do
187 pagesize="${alloc/:*}"
188 pagecount="${alloc/*:}"
189 einfo " ${pagecount} @ ${pagesize}"
190 src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
191 done
192
193 # ---------------------------------------------------------
194 # --------- die is safe again after this point. -----------
195 # ---------------------------------------------------------
196
197 return $rc
198 }