Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-freebsd/freebsd-lib/files/, profiles/, sys-freebsd/freebsd-lib/
Date: Fri, 11 Oct 2019 15:16:59
Message-Id: 1570807002.fcffec51617eb1b9863701e7f55f5dcb36c84a99.mgorny@gentoo
1 commit: fcffec51617eb1b9863701e7f55f5dcb36c84a99
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 11 15:15:09 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 11 15:16:42 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcffec51
7
8 sys-freebsd/freebsd-lib: Remove last-rited pkg
9
10 Closes: https://bugs.gentoo.org/683284
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 profiles/info_pkgs | 1 -
14 profiles/package.mask | 1 -
15 sys-freebsd/freebsd-lib/Manifest | 11 -
16 sys-freebsd/freebsd-lib/files/bootpd.confd | 7 -
17 sys-freebsd/freebsd-lib/files/bootpd.initd | 27 -
18 .../files/freebsd-lib-11.0-bsdxml2expat.patch | 39 --
19 .../files/freebsd-lib-11.0-libproc-libcxx.patch | 13 -
20 .../files/freebsd-lib-11.0-workaround.patch | 12 -
21 .../files/freebsd-lib-11.1-elf-nhdr.patch | 10 -
22 .../files/freebsd-lib-11.1-liblink.patch | 142 -----
23 .../files/freebsd-lib-6.0-flex-2.5.31.patch | 13 -
24 .../freebsd-lib/files/freebsd-lib-6.0-pmc.patch | 13 -
25 .../freebsd-lib/files/freebsd-lib-6.1-csu.patch | 20 -
26 .../files/freebsd-lib-7.1-types.h-fix.patch | 15 -
27 .../freebsd-lib/files/freebsd-lib-8.0-gcc45.patch | 28 -
28 .../files/freebsd-lib-9.0-bluetooth.patch | 12 -
29 .../files/freebsd-lib-9.0-cve-2010-2632.patch | 215 -------
30 .../files/freebsd-lib-9.0-liblink.patch | 21 -
31 .../files/freebsd-lib-9.0-netware.patch | 11 -
32 .../files/freebsd-lib-9.0-opieincludes.patch | 122 ----
33 .../files/freebsd-lib-9.1-.eh_frame_hdr-fix.patch | 17 -
34 .../files/freebsd-lib-9.1-aligned_alloc.patch | 51 --
35 .../files/freebsd-lib-9.1-rmgssapi.patch | 16 -
36 .../files/freebsd-lib-add-nossp-cflags.patch | 30 -
37 .../files/freebsd-lib-bsdxml2expat.patch | 26 -
38 .../freebsd-lib/files/freebsd-lib-includes.patch | 13 -
39 .../files/freebsd-sources-9.0-sysctluint.patch | 13 -
40 sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in | 11 -
41 sys-freebsd/freebsd-lib/files/libusb.pc.in | 11 -
42 sys-freebsd/freebsd-lib/files/rquotad.xinetd | 11 -
43 sys-freebsd/freebsd-lib/files/rstatd.xinetd | 11 -
44 sys-freebsd/freebsd-lib/files/rusersd.xinetd | 11 -
45 sys-freebsd/freebsd-lib/files/sprayd.xinetd | 11 -
46 sys-freebsd/freebsd-lib/files/walld.xinetd | 11 -
47 sys-freebsd/freebsd-lib/freebsd-lib-11.1-r1.ebuild | 708 ---------------------
48 sys-freebsd/freebsd-lib/freebsd-lib-9.1-r11.ebuild | 616 ------------------
49 sys-freebsd/freebsd-lib/metadata.xml | 15 -
50 37 files changed, 2315 deletions(-)
51
52 diff --git a/profiles/info_pkgs b/profiles/info_pkgs
53 index b90b3c60115..fc75b02ca9a 100644
54 --- a/profiles/info_pkgs
55 +++ b/profiles/info_pkgs
56 @@ -10,7 +10,6 @@ sys-libs/glibc
57 sys-libs/musl
58 sys-libs/uclibc
59 sys-libs/uclibc-ng
60 -sys-freebsd/freebsd-lib
61 sys-devel/binutils
62 sys-devel/libtool
63 sys-devel/make
64
65 diff --git a/profiles/package.mask b/profiles/package.mask
66 index 9b939a586ee..0c6ff57cd4a 100644
67 --- a/profiles/package.mask
68 +++ b/profiles/package.mask
69 @@ -750,7 +750,6 @@ dev-libs/actor-framework
70 # Removal in 30 days. Bug #683284.
71 sys-freebsd/boot0
72 sys-freebsd/freebsd-cddl
73 -sys-freebsd/freebsd-lib
74
75 # Lars Wendler <polynomial-c@g.o> (2019-09-04)
76 # Unofficial build. Superseded by official 2.49.5 release.
77
78 diff --git a/sys-freebsd/freebsd-lib/Manifest b/sys-freebsd/freebsd-lib/Manifest
79 deleted file mode 100644
80 index 8f845c346af..00000000000
81 --- a/sys-freebsd/freebsd-lib/Manifest
82 +++ /dev/null
83 @@ -1,11 +0,0 @@
84 -DIST freebsd-cddl-9.1.tar.bz2 899348 BLAKE2B 419e475b4c3debacd0d0fbbad4d1b13685c1c5ac741cc8cfb53dadce9d30cf9ddd7132ef8ab897787be538028d34bb9603eb76caf7650f4f50bb3295f19bf035 SHA512 ae0a969e710785bbcf36a2ec22cc5b1dcdb25398be951e047a1237d0c977e38fc9e05504db51f8bf9ed83bc1f68b04fc88ce18fc48a93f785b8a3f8ef481bacd
85 -DIST freebsd-contrib-9.1.tar.bz2 54751432 BLAKE2B 8a30e78021e6388d679637d2dbe0ed3f4896d3902064baaafa79de9c328171cbcb895b0ffd3d0d0cd3ca25c93a73584ed4900b45bd672a73b15b75721de59de5 SHA512 71be13049258c6e6b5e4f63cc16da5d349a89d68f04d87446e4ad33ae8bf2a93ea67d9c256b7bec60b61e65db0487268070cfb77a484c3ac0f8ba368b48c2438
86 -DIST freebsd-crypto-9.1.tar.bz2 5682828 BLAKE2B f6b14f5319932b8680a79abab41ff6b447045464992ad8a22ebc0a6bf89f60559881ed34a26639d5d09af7b66972d2105181186c4cb42c5d6fdbf65b342ae38a SHA512 40c7a8150fb3ddd93488502a976ce03e992e6f4fb28aa3e5e102d4915f8ff49fe9085995ccfecacefc3b665e23c85cc3a0cdeec20a32c79e04458f7cc88630d9
87 -DIST freebsd-etc-9.1.tar.bz2 207776 BLAKE2B 61fbfa11dfcd24c007c20940a4b7cc802dfb9a991e41433840c57f113eaaa9e2b833a15f48d60c706e55d941b0a999baabd0c33197cffd522b67c57eaa9460f1 SHA512 4fbe56fde519cf2f44e39a8869efa26c34f703cf540f4a83389da8d170873d7c6fb18e4010e643b8d793cfc5c55d15eeb198057a5b2a8da9d9e8f791801bf314
88 -DIST freebsd-gnu-9.1.tar.bz2 795778 BLAKE2B a922a8bd2c8a7ddbac757e7db900109918bf214a34988adb45bdb11e5c829445cac9b13b0ed27ec62603aeae1e3230af362682182494db0ec95ff47cbfd7d927 SHA512 b05f2a5a10bdaeef19dfd0e962bc09f1571288a831e9345f404b920037f47db5c0ca3d620d1cbdd138b18bca1c3feab5b211b57e3041727341e5238cb9feb4fd
89 -DIST freebsd-include-9.1.tar.bz2 146881 BLAKE2B 3db8570a8c841ec1c9ceff479bd0ef9b146b2a343d6596892c9d8a9f9193404f6c62712cb96d7416c6e5cc4c46e7fb942421c47e1bc2c707dde534e2050be442 SHA512 779c8315ce2b10b343bb62e331525d510b0d68ce5d665a1672bd6f4d1eff6445bc6b7a0f178b319828aa203c4e4c04c561ce793052703f4f936ce9711280a0c9
90 -DIST freebsd-lib-9.1.tar.bz2 3206685 BLAKE2B 67f93b7951fc03e877ee525d53b81ba49c8c1a70041c30aac97665d5dab7b3f2817fdb3bbb1475be66c33a7f996309e9020f1a3d1154fab8e2f6789f5ae0bb18 SHA512 40d0c36b6b889c404fa0e0afa38ba4e84a55bc88ffa2f98a70afbd7a32c4f32c158617ba770567d082a986d62c09b3ec8db3dc5ab853ee1c9bbe0b90bb82396e
91 -DIST freebsd-libexec-9.1.tar.bz2 304592 BLAKE2B 994543ac910e4703d36682f6c0550596e340605754b9386770660f0ed0e70f8d437185f2010e6be795a8cc508aa7d69c90cc0a0df968c5dd8de4c5c4bb38e8c2 SHA512 7baa4160dda2610250dd52f445e24478e0f1ea10bce21fcd0e5d1b856f399b896adc334114de0c7f61a5637e4349bb1688fdbe5c72798d8568ae791114710b92
92 -DIST freebsd-src-11.1.tar.xz 147661560 BLAKE2B a9e6ba9d0e12c8b56ac58575d5f02931edbb6a3545d9dccae78810d2d0470a29b29dd7f724b03b8afafbca23717a71346e4cfbd3530e0f40118a23609c3f414e SHA512 b97707ec7a601ca6bcb682c45f6d94a38484301ac24630d7285eff6f88b027ce6900c93fc62f8ce36e0cf32c91f73a9d1c999db397b7f8782fd74a8551a03aca
93 -DIST freebsd-sys-9.1.tar.bz2 32588103 BLAKE2B 7f94a4735c6a17b39a86fa0fda0682924b18e4b466dc6319a5df889522aaeaffaa87e1b76582c48ae034df8c20169c8cea93bbd3d6e7abd0526716686f88dfe8 SHA512 7dc9d9e00dde8f592bb171f4386d02b655b73cb4f153fe5ec063d010a148ef0639eae0dcdb3eeb09ecd1e3653c69e49a2d261329fa6d0381d2ddabe258ddde6d
94 -DIST freebsd-usbin-9.1.tar.bz2 2670916 BLAKE2B 353c7e641c0cccf25b99cb454368bd3001cd6b85a15956b1ee2de1ab240c420602e04bf6d0389aca0bdd4f7d1206a6848516e58a17eda4881d849f078b71a139 SHA512 21c234312f70eb35cd2926519efc1f61592892f5d0940786dbeb959c3c5ec7819a51ae95c6e8a1a06aa01f669350fe0fd3dd7c4ec8a84dd6b90f24cb192356ca
95
96 diff --git a/sys-freebsd/freebsd-lib/files/bootpd.confd b/sys-freebsd/freebsd-lib/files/bootpd.confd
97 deleted file mode 100644
98 index 6d238e4d485..00000000000
99 --- a/sys-freebsd/freebsd-lib/files/bootpd.confd
100 +++ /dev/null
101 @@ -1,7 +0,0 @@
102 -# Configuration file for /etc/init.d/bootpd
103 -
104 -# Name of the configuration file for bootpd
105 -# bootptab_file="/etc/bootptab"
106 -
107 -# Options to pass to bootpd. See bootpd(8).
108 -# bootpd_opts=""
109
110 diff --git a/sys-freebsd/freebsd-lib/files/bootpd.initd b/sys-freebsd/freebsd-lib/files/bootpd.initd
111 deleted file mode 100644
112 index 82288ebf19c..00000000000
113 --- a/sys-freebsd/freebsd-lib/files/bootpd.initd
114 +++ /dev/null
115 @@ -1,27 +0,0 @@
116 -#!/sbin/openrc-run
117 -# Copyright 2008 Gentoo Foundation
118 -# Distributed under the terms of the GNU General Public License v2
119 -
120 -depend() {
121 - need net
122 -}
123 -
124 -start() {
125 - local bootptab=${bootptab_file:-/etc/bootptab}
126 -
127 - if ! [ -f "${bootptab}" ]; then
128 - eerror "Unable to find the bootptab file: ${bootptab}"
129 - eend 1
130 - return 1
131 - fi
132 -
133 - ebegin "Starting BOOTP server"
134 - start-stop-daemon --start --exec /usr/libexec/bootpd -- ${bootpd_opts} ${bootptab}
135 - eend $?
136 -}
137 -
138 -stop() {
139 - ebegin "Stopping BOOTP server"
140 - start-stop-daemon --stop --exec /usr/libexec/bootpd
141 - eend $?
142 -}
143
144 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-bsdxml2expat.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-bsdxml2expat.patch
145 deleted file mode 100644
146 index 41a394b815a..00000000000
147 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-bsdxml2expat.patch
148 +++ /dev/null
149 @@ -1,39 +0,0 @@
150 -diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c
151 -index 9dedb8e..d96420c 100644
152 ---- a/lib/libgeom/geom_xml2tree.c
153 -+++ b/lib/libgeom/geom_xml2tree.c
154 -@@ -43,7 +43,7 @@
155 - #include <sys/sbuf.h>
156 - #include <sys/sysctl.h>
157 - #include <err.h>
158 --#include <bsdxml.h>
159 -+#include <expat.h>
160 - #include <libgeom.h>
161 -
162 - struct mystate {
163 -diff --git a/lib/libmt/mtlib.c b/lib/libmt/mtlib.c
164 -index d1fc0b1..89ac55e 100644
165 ---- a/lib/libmt/mtlib.c
166 -+++ b/lib/libmt/mtlib.c
167 -@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD: stable/10/lib/libmt/mtlib.c 280438 2015-03-24 14:36:10Z ken
168 - #include <unistd.h>
169 - #include <stdint.h>
170 - #include <errno.h>
171 --#include <bsdxml.h>
172 -+#include <expat.h>
173 - #include <mtlib.h>
174 -
175 - /*
176 -diff --git a/lib/lib80211/lib80211_regdomain.c b/lib/lib80211/lib80211_regdomain.c
177 -index c500d3f..fe1d37e 100644
178 ---- a/lib/lib80211/lib80211_regdomain.c
179 -+++ b/lib/lib80211/lib80211_regdomain.c
180 -@@ -40,7 +40,7 @@ static const char rcsid[] = "$FreeBSD: stable/11/lib/lib80211/lib80211_regdomain
181 - #include <err.h>
182 - #include <unistd.h>
183 -
184 --#include <bsdxml.h>
185 -+#include <expat.h>
186 -
187 - #include "lib80211_regdomain.h"
188 -
189
190 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-libproc-libcxx.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-libproc-libcxx.patch
191 deleted file mode 100644
192 index 013ad20619e..00000000000
193 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-libproc-libcxx.patch
194 +++ /dev/null
195 @@ -1,13 +0,0 @@
196 -diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile
197 -index e3b2578..acd76e8 100644
198 ---- a/lib/libproc/Makefile
199 -+++ b/lib/libproc/Makefile
200 -@@ -18,7 +18,7 @@ CFLAGS+= -I${.CURDIR}
201 -
202 - .if ${MK_CXX} == "no"
203 - CFLAGS+= -DNO_CXA_DEMANGLE
204 --.elif ${MK_LIBCPLUSPLUS} != "no"
205 -+.elif ${COMPILER_TYPE} == "clang"
206 - LIBADD+= cxxrt
207 - .else
208 - LIBADD+= supcplusplus
209
210 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-workaround.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-workaround.patch
211 deleted file mode 100644
212 index 05f817eeb03..00000000000
213 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.0-workaround.patch
214 +++ /dev/null
215 @@ -1,12 +0,0 @@
216 -diff --git a/lib/libdevdctl/event.cc b/lib/libdevdctl/event.cc
217 -index a8cb447..d56df2e 100644
218 ---- a/lib/libdevdctl/event.cc
219 -+++ b/lib/libdevdctl/event.cc
220 -@@ -50,6 +50,7 @@
221 - #include <syslog.h>
222 - #include <unistd.h>
223 -
224 -+#include <cstdio>
225 - #include <cstdarg>
226 - #include <cstring>
227 - #include <iostream>
228
229 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.1-elf-nhdr.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-11.1-elf-nhdr.patch
230 deleted file mode 100644
231 index a00df5f66f1..00000000000
232 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.1-elf-nhdr.patch
233 +++ /dev/null
234 @@ -1,10 +0,0 @@
235 ---- a/sys/sys/elf_common.h 2018/01/18 20:45:41 328136
236 -+++ b/sys/sys/elf_common.h 2018/01/18 21:19:57 328137
237 -@@ -51,6 +51,7 @@
238 - u_int32_t n_descsz; /* Length of descriptor. */
239 - u_int32_t n_type; /* Type of this note. */
240 - } Elf_Note;
241 -+typedef Elf_Note Elf_Nhdr;
242 -
243 - /*
244 - * Option kinds.
245
246 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.1-liblink.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-11.1-liblink.patch
247 deleted file mode 100644
248 index b1fe7035b12..00000000000
249 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-11.1-liblink.patch
250 +++ /dev/null
251 @@ -1,142 +0,0 @@
252 -diff --git a/lib/libmt/Makefile b/lib/libmt/Makefile
253 -index a6efe28..f60919a 100644
254 ---- a/lib/libmt/Makefile
255 -+++ b/lib/libmt/Makefile
256 -@@ -6,6 +6,7 @@ SHLIBDIR?= /lib
257 - SRCS= mtlib.c
258 - INCS= mtlib.h
259 -
260 -+CFLAGS+= -I${.CURDIR}
261 - LIBADD= sbuf bsdxml
262 -
263 - MAN= mt.3
264 -diff --git a/lib/libsysdecode/Makefile b/lib/libsysdecode/Makefile
265 -index ce89201..ba78ae4 100644
266 ---- a/lib/libsysdecode/Makefile
267 -+++ b/lib/libsysdecode/Makefile
268 -@@ -9,7 +9,7 @@ SRCS= errno.c flags.c ioctl.c signal.c syscallnames.c utrace.c
269 - INCS= sysdecode.h
270 -
271 - CFLAGS+= -I${.OBJDIR}
272 --CFLAGS+= -I${SRCTOP}/sys
273 -+CFLAGS+= -I${SRCTOP}/sys -I${.CURDIR}
274 - CFLAGS+= -I${SRCTOP}/libexec/rtld-elf
275 -
276 - MAN= sysdecode.3 \
277 -
278 -diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile
279 -index 280f7de..d0663b0 100644
280 ---- a/lib/libdpv/Makefile
281 -+++ b/lib/libdpv/Makefile
282 -@@ -11,6 +11,7 @@ LIBADD= dialog figpar util ncursesw
283 -
284 - SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c
285 -
286 --CFLAGS+= -I${.CURDIR}
287 -+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libfigpar
288 -+LDFLAGS+= -L${.OBJDIR}/../libfigpar
289 -
290 - .include <bsd.lib.mk>
291 -diff --git a/lib/libcasper/libcasper/Makefile b/lib/libcasper/libcasper/Makefile
292 -index 1064ada..32a2e66 100644
293 ---- a/lib/libcasper/libcasper/Makefile
294 -+++ b/lib/libcasper/libcasper/Makefile
295 -@@ -18,6 +18,7 @@ INCS+= libcasper_service.h
296 - LIBADD= nv
297 -
298 - CFLAGS+=-I${.CURDIR}
299 -+LDFLAGS+=-L${.OBJDIR}/../../libnv
300 -
301 - MAN+= libcasper.3
302 -
303 -diff --git a/lib/libcasper/services/cap_dns/Makefile b/lib/libcasper/services/cap_dns/Makefile
304 -index bf6bed5..baeecbe 100644
305 ---- a/lib/libcasper/services/cap_dns/Makefile
306 -+++ b/lib/libcasper/services/cap_dns/Makefile
307 -@@ -14,5 +14,6 @@ INCS= cap_dns.h
308 - LIBADD= nv
309 -
310 - CFLAGS+=-I${.CURDIR}
311 -+LDFLAGS+=-L${.OBJDIR}/../../../libnv
312 -
313 - .include <bsd.lib.mk>
314 -diff --git a/lib/libcasper/services/cap_grp/Makefile b/lib/libcasper/services/cap_grp/Makefile
315 -index 78a860a..dfb4911 100644
316 ---- a/lib/libcasper/services/cap_grp/Makefile
317 -+++ b/lib/libcasper/services/cap_grp/Makefile
318 -@@ -14,5 +14,6 @@ INCS= cap_grp.h
319 - LIBADD= nv
320 -
321 - CFLAGS+=-I${.CURDIR}
322 -+LDFLAGS+=-L${.OBJDIR}/../../../libnv
323 -
324 - .include <bsd.lib.mk>
325 -diff --git a/lib/libcasper/services/cap_pwd/Makefile b/lib/libcasper/services/cap_pwd/Makefile
326 -index e4df38b..64d7709 100644
327 ---- a/lib/libcasper/services/cap_pwd/Makefile
328 -+++ b/lib/libcasper/services/cap_pwd/Makefile
329 -@@ -14,5 +14,6 @@ INCS= cap_pwd.h
330 - LIBADD= nv
331 -
332 - CFLAGS+=-I${.CURDIR}
333 -+LDFLAGS+=-L${.OBJDIR}/../../../libnv
334 -
335 - .include <bsd.lib.mk>
336 -diff --git a/lib/libcasper/services/cap_random/Makefile b/lib/libcasper/services/cap_random/Makefile
337 -index d69c160..658be9c 100644
338 ---- a/lib/libcasper/services/cap_random/Makefile
339 -+++ b/lib/libcasper/services/cap_random/Makefile
340 -@@ -14,5 +14,6 @@ INCS= cap_random.h
341 - LIBADD= nv
342 -
343 - CFLAGS+=-I${.CURDIR}
344 -+LDFLAGS+=-L${.OBJDIR}/../../../libnv
345 -
346 - .include <bsd.lib.mk>
347 -diff --git a/lib/libcasper/services/cap_sysctl/Makefile b/lib/libcasper/services/cap_sysctl/Makefile
348 -index 2471e65..b20a342 100644
349 ---- a/lib/libcasper/services/cap_sysctl/Makefile
350 -+++ b/lib/libcasper/services/cap_sysctl/Makefile
351 -@@ -14,5 +14,6 @@ INCS= cap_sysctl.h
352 - LIBADD= nv
353 -
354 - CFLAGS+=-I${.CURDIR}
355 -+LDFLAGS+=-L${.OBJDIR}/../../../libnv
356 -
357 - .include <bsd.lib.mk>
358 -diff --git a/lib/libc/Makefile b/lib/libc/Makefile
359 -index 1cf73a7..f1c2bc8 100644
360 ---- a/lib/libc/Makefile
361 -+++ b/lib/libc/Makefile
362 -@@ -51,6 +51,7 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
363 - #
364 - LDFLAGS+= -nodefaultlibs
365 - LIBADD+= compiler_rt
366 -+LDFLAGS+= -L${.OBJDIR}/../libcompiler_rt
367 -
368 - .if ${MK_SSP} != "no"
369 - LIBADD+= ssp_nonshared
370 -diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
371 -index 4da1166..b34297a 100644
372 ---- a/lib/libcompiler_rt/Makefile
373 -+++ b/lib/libcompiler_rt/Makefile
374 -@@ -11,6 +11,7 @@ CFLAGS+= ${PICFLAG}
375 - CFLAGS+= -fvisibility=hidden
376 - CFLAGS+= -DVISIBILITY_HIDDEN
377 - CFLAGS+= -I${SRCTOP}/contrib/libcxxrt
378 -+LDFLAGS+= -L${.OBJDIR}/../libc
379 -
380 - .if ${COMPILER_TYPE} == "clang"
381 - CWARNFLAGS.gcc_personality_v0.c+= -Wno-typedef-redefinition
382 -diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile
383 -index 310c9a2..86a5e8c 100644
384 ---- a/lib/libcam/Makefile
385 -+++ b/lib/libcam/Makefile
386 -@@ -40,6 +40,7 @@ MLINKS+= cam.3 cam_open_device.3 \
387 - ${SRCTOP}/sys/cam
388 -
389 - CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys
390 -+LDFLAGS+= -L${.OBJDIR}/../libsbuf
391 -
392 - SHLIB_MAJOR= 7
393 -
394
395 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-flex-2.5.31.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-flex-2.5.31.patch
396 deleted file mode 100644
397 index 00de8a6debb..00000000000
398 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-flex-2.5.31.patch
399 +++ /dev/null
400 @@ -1,13 +0,0 @@
401 -Index: fbsd-6/lib/libipsec/policy_token.l
402 -===================================================================
403 ---- fbsd-6.orig/lib/libipsec/policy_token.l
404 -+++ fbsd-6/lib/libipsec/policy_token.l
405 -@@ -138,8 +138,6 @@ void
406 - __policy__strbuffer__init__(msg)
407 - char *msg;
408 - {
409 -- if (yy_current_buffer)
410 -- yy_delete_buffer(yy_current_buffer);
411 - strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg);
412 - yy_switch_to_buffer(strbuffer);
413 -
414
415 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-pmc.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-pmc.patch
416 deleted file mode 100644
417 index 2f6de465282..00000000000
418 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-pmc.patch
419 +++ /dev/null
420 @@ -1,13 +0,0 @@
421 -Index: freebsd-6.0_beta4/lib/libpmc/Makefile
422 -===================================================================
423 ---- freebsd-6.0_beta4.orig/lib/libpmc/Makefile
424 -+++ freebsd-6.0_beta4/lib/libpmc/Makefile
425 -@@ -9,6 +9,8 @@ WARNS?= 6
426 -
427 - MAN= pmc.3 pmclog.3
428 -
429 -+CFLAGS+= -I${.CURDIR}
430 -+
431 - MLINKS+= \
432 - pmc.3 pmc_allocate.3 \
433 - pmc.3 pmc_attach.3 \
434
435 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.1-csu.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.1-csu.patch
436 deleted file mode 100644
437 index 075f2780e69..00000000000
438 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.1-csu.patch
439 +++ /dev/null
440 @@ -1,20 +0,0 @@
441 ---- lib/csu/amd64/Makefile.orig 2006-07-04 07:49:58 -0300
442 -+++ lib/csu/amd64/Makefile 2006-07-04 07:50:15 -0300
443 -@@ -16,6 +16,7 @@
444 - ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c
445 -
446 - realinstall:
447 -+ ${INSTALL} -d ${DESTDIR}${LIBDIR}
448 - ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
449 - ${OBJS} ${DESTDIR}${LIBDIR}
450 -
451 ---- lib/csu/sparc64/Makefile.orig 2006-10-06 15:13:55 +0100
452 -+++ lib/csu/sparc64/Makefile 2006-10-06 15:15:06 +0100
453 -@@ -15,6 +15,7 @@
454 - ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC}
455 -
456 - realinstall:
457 -+ ${INSTALL} -d ${DESTDIR}${LIBDIR}
458 - ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
459 - ${OBJS} ${DESTDIR}${LIBDIR}
460 -
461
462 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch
463 deleted file mode 100644
464 index 8de5df2d16a..00000000000
465 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch
466 +++ /dev/null
467 @@ -1,15 +0,0 @@
468 -Fixes a compile error if XOPEN_SOURCE 600 is defined.
469 -
470 -See: http://www.mailinglistarchive.com/freebsd-current@×××××××.org/msg15011.html
471 -
472 ---- sys/sys/types.h.orig
473 -+++ sys/sys/types.h
474 -@@ -46,7 +46,7 @@
475 -
476 - #include <sys/_pthreadtypes.h>
477 -
478 --#if __BSD_VISIBLE
479 -+#ifndef _POSIX_SOURCE
480 - typedef unsigned char u_char;
481 - typedef unsigned short u_short;
482 - typedef unsigned int u_int;
483
484 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-gcc45.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-gcc45.patch
485 deleted file mode 100644
486 index 2ddb9eadb90..00000000000
487 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-8.0-gcc45.patch
488 +++ /dev/null
489 @@ -1,28 +0,0 @@
490 -diff -Nur work.orig/include/rpcsvc/nis.x work/include/rpcsvc/nis.x
491 ---- work.orig/include/rpcsvc/nis.x 2009-10-25 10:10:29.000000000 +0900
492 -+++ work/include/rpcsvc/nis.x 2011-04-13 21:25:13.000000000 +0900
493 -@@ -399,10 +399,7 @@
494 - %#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
495 - %#define WORLD_DEFAULT (NIS_READ_ACC)
496 - %#define GROUP_DEFAULT (NIS_READ_ACC << 8)
497 --%#define OWNER_DEFAULT ((NIS_READ_ACC +\
498 -- NIS_MODIFY_ACC +\
499 -- NIS_CREATE_ACC +\
500 -- NIS_DESTROY_ACC) << 16)
501 -+%#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC + NIS_DESTROY_ACC) << 16)
502 - %#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
503 - %
504 - %/* Result manipulation defines ... */
505 -@@ -431,10 +428,8 @@
506 - % * these definitions they take an nis_object *, and an int and return
507 - % * a u_char * for Value, and an int for length.
508 - % */
509 --%#define ENTRY_VAL(obj, col) \
510 -- (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
511 --%#define ENTRY_LEN(obj, col) \
512 -- (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
513 -+%#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
514 -+%#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
515 - %
516 - %#ifdef __cplusplus
517 - %}
518
519 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-bluetooth.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-bluetooth.patch
520 deleted file mode 100644
521 index cf1172ab633..00000000000
522 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-bluetooth.patch
523 +++ /dev/null
524 @@ -1,12 +0,0 @@
525 -diff -Nur lib.orig/libsdp/Makefile lib/libsdp/Makefile
526 ---- lib.orig/libsdp/Makefile 2012-12-25 20:28:50.000000000 +0900
527 -+++ lib/libsdp/Makefile 2012-12-25 20:31:19.000000000 +0900
528 -@@ -5,7 +5,7 @@
529 - MAN= sdp.3
530 -
531 - WARNS?= 2
532 --CFLAGS+= -I${.CURDIR}
533 -+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libbluetooth
534 -
535 - SHLIB_MAJOR= 4
536 -
537
538 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-cve-2010-2632.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-cve-2010-2632.patch
539 deleted file mode 100644
540 index ad9b9608f42..00000000000
541 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-cve-2010-2632.patch
542 +++ /dev/null
543 @@ -1,215 +0,0 @@
544 -Index: lib/libc/gen/glob.c
545 -===================================================================
546 ---- lib/libc/gen/glob.c (revision 246357)
547 -+++ lib/libc/gen/glob.c (working copy)
548 -@@ -94,6 +94,25 @@ __FBSDID("$FreeBSD$");
549 -
550 - #include "collate.h"
551 -
552 -+/*
553 -+ * glob(3) expansion limits. Stop the expansion if any of these limits
554 -+ * is reached. This caps the runtime in the face of DoS attacks. See
555 -+ * also CVE-2010-2632
556 -+ */
557 -+#define GLOB_LIMIT_BRACE 128 /* number of brace calls */
558 -+#define GLOB_LIMIT_PATH 65536 /* number of path elements */
559 -+#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */
560 -+#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */
561 -+#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */
562 -+
563 -+struct glob_limit {
564 -+ size_t l_brace_cnt;
565 -+ size_t l_path_lim;
566 -+ size_t l_readdir_cnt;
567 -+ size_t l_stat_cnt;
568 -+ size_t l_string_cnt;
569 -+};
570 -+
571 - #define DOLLAR '$'
572 - #define DOT '.'
573 - #define EOS '\0'
574 -@@ -153,15 +172,18 @@ static const Char *g_strchr(const Char *, wchar_t)
575 - static Char *g_strcat(Char *, const Char *);
576 - #endif
577 - static int g_stat(Char *, struct stat *, glob_t *);
578 --static int glob0(const Char *, glob_t *, size_t *);
579 --static int glob1(Char *, glob_t *, size_t *);
580 --static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *);
581 --static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *);
582 --static int globextend(const Char *, glob_t *, size_t *);
583 --static const Char *
584 -+static int glob0(const Char *, glob_t *, struct glob_limit *);
585 -+static int glob1(Char *, glob_t *, struct glob_limit *);
586 -+static int glob2(Char *, Char *, Char *, Char *, glob_t *,
587 -+ struct glob_limit *);
588 -+static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *,
589 -+ struct glob_limit *);
590 -+static int globextend(const Char *, glob_t *, struct glob_limit *);
591 -+static const Char *
592 - globtilde(const Char *, Char *, size_t, glob_t *);
593 --static int globexp1(const Char *, glob_t *, size_t *);
594 --static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *);
595 -+static int globexp1(const Char *, glob_t *, struct glob_limit *);
596 -+static int globexp2(const Char *, const Char *, glob_t *, int *,
597 -+ struct glob_limit *);
598 - static int match(Char *, Char *, Char *);
599 - #ifdef DEBUG
600 - static void qprintf(const char *, Char *);
601 -@@ -171,8 +193,8 @@ int
602 - glob(const char * __restrict pattern, int flags,
603 - int (*errfunc)(const char *, int), glob_t * __restrict pglob)
604 - {
605 -+ struct glob_limit limit = { 0, 0, 0, 0, 0 };
606 - const char *patnext;
607 -- size_t limit;
608 - Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot;
609 - mbstate_t mbs;
610 - wchar_t wc;
611 -@@ -186,11 +208,10 @@ glob(const char * __restrict pattern, int flags,
612 - pglob->gl_offs = 0;
613 - }
614 - if (flags & GLOB_LIMIT) {
615 -- limit = pglob->gl_matchc;
616 -- if (limit == 0)
617 -- limit = ARG_MAX;
618 -- } else
619 -- limit = 0;
620 -+ limit.l_path_lim = pglob->gl_matchc;
621 -+ if (limit.l_path_lim == 0)
622 -+ limit.l_path_lim = GLOB_LIMIT_PATH;
623 -+ }
624 - pglob->gl_flags = flags & ~GLOB_MAGCHAR;
625 - pglob->gl_errfunc = errfunc;
626 - pglob->gl_matchc = 0;
627 -@@ -243,11 +264,17 @@ glob(const char * __restrict pattern, int flags,
628 - * characters
629 - */
630 - static int
631 --globexp1(const Char *pattern, glob_t *pglob, size_t *limit)
632 -+globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
633 - {
634 - const Char* ptr = pattern;
635 - int rv;
636 -
637 -+ if ((pglob->gl_flags & GLOB_LIMIT) &&
638 -+ limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) {
639 -+ errno = 0;
640 -+ return (GLOB_NOSPACE);
641 -+ }
642 -+
643 - /* Protect a single {}, for find(1), like csh */
644 - if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
645 - return glob0(pattern, pglob, limit);
646 -@@ -266,7 +293,8 @@ static int
647 - * If it fails then it tries to glob the rest of the pattern and returns.
648 - */
649 - static int
650 --globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit)
651 -+globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv,
652 -+ struct glob_limit *limit)
653 - {
654 - int i;
655 - Char *lm, *ls;
656 -@@ -436,7 +464,7 @@ globtilde(const Char *pattern, Char *patbuf, size_
657 - * if things went well, nonzero if errors occurred.
658 - */
659 - static int
660 --glob0(const Char *pattern, glob_t *pglob, size_t *limit)
661 -+glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
662 - {
663 - const Char *qpatnext;
664 - int err;
665 -@@ -529,7 +557,7 @@ compare(const void *p, const void *q)
666 - }
667 -
668 - static int
669 --glob1(Char *pattern, glob_t *pglob, size_t *limit)
670 -+glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit)
671 - {
672 - Char pathbuf[MAXPATHLEN];
673 -
674 -@@ -547,7 +575,7 @@ static int
675 - */
676 - static int
677 - glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern,
678 -- glob_t *pglob, size_t *limit)
679 -+ glob_t *pglob, struct glob_limit *limit)
680 - {
681 - struct stat sb;
682 - Char *p, *q;
683 -@@ -563,6 +591,15 @@ glob2(Char *pathbuf, Char *pathend, Char *pathend_
684 - if (g_lstat(pathbuf, &sb, pglob))
685 - return(0);
686 -
687 -+ if ((pglob->gl_flags & GLOB_LIMIT) &&
688 -+ limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) {
689 -+ errno = 0;
690 -+ if (pathend + 1 > pathend_last)
691 -+ return (GLOB_ABORTED);
692 -+ *pathend++ = SEP;
693 -+ *pathend = EOS;
694 -+ return (GLOB_NOSPACE);
695 -+ }
696 - if (((pglob->gl_flags & GLOB_MARK) &&
697 - pathend[-1] != SEP) && (S_ISDIR(sb.st_mode)
698 - || (S_ISLNK(sb.st_mode) &&
699 -@@ -606,7 +643,7 @@ glob2(Char *pathbuf, Char *pathend, Char *pathend_
700 - static int
701 - glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
702 - Char *pattern, Char *restpattern,
703 -- glob_t *pglob, size_t *limit)
704 -+ glob_t *pglob, struct glob_limit *limit)
705 - {
706 - struct dirent *dp;
707 - DIR *dirp;
708 -@@ -652,6 +689,19 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_
709 - size_t clen;
710 - mbstate_t mbs;
711 -
712 -+ if ((pglob->gl_flags & GLOB_LIMIT) &&
713 -+ limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) {
714 -+ errno = 0;
715 -+ if (pathend + 1 > pathend_last)
716 -+ err = GLOB_ABORTED;
717 -+ else {
718 -+ *pathend++ = SEP;
719 -+ *pathend = EOS;
720 -+ err = GLOB_NOSPACE;
721 -+ }
722 -+ break;
723 -+ }
724 -+
725 - /* Initial DOT must be matched literally. */
726 - if (dp->d_name[0] == DOT && *pattern != DOT)
727 - continue;
728 -@@ -702,14 +752,15 @@ glob3(Char *pathbuf, Char *pathend, Char *pathend_
729 - * gl_pathv points to (gl_offs + gl_pathc + 1) items.
730 - */
731 - static int
732 --globextend(const Char *path, glob_t *pglob, size_t *limit)
733 -+globextend(const Char *path, glob_t *pglob, struct glob_limit *limit)
734 - {
735 - char **pathv;
736 - size_t i, newsize, len;
737 - char *copy;
738 - const Char *p;
739 -
740 -- if (*limit && pglob->gl_pathc > *limit) {
741 -+ if ((pglob->gl_flags & GLOB_LIMIT) &&
742 -+ pglob->gl_matchc > limit->l_path_lim) {
743 - errno = 0;
744 - return (GLOB_NOSPACE);
745 - }
746 -@@ -737,6 +788,12 @@ static int
747 - for (p = path; *p++;)
748 - continue;
749 - len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */
750 -+ limit->l_string_cnt += len;
751 -+ if ((pglob->gl_flags & GLOB_LIMIT) &&
752 -+ limit->l_string_cnt >= GLOB_LIMIT_STRING) {
753 -+ errno = 0;
754 -+ return (GLOB_NOSPACE);
755 -+ }
756 - if ((copy = malloc(len)) != NULL) {
757 - if (g_Ctoc(path, copy, len)) {
758 - free(copy);
759
760 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-liblink.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-liblink.patch
761 deleted file mode 100644
762 index f8e470736c6..00000000000
763 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-liblink.patch
764 +++ /dev/null
765 @@ -1,21 +0,0 @@
766 -diff -uNr lib.ol/libproc/Makefile lib/libproc/Makefile
767 ---- lib.ol/libproc/Makefile 2011-11-02 14:02:17.000000000 +0000
768 -+++ lib/libproc/Makefile 2011-11-02 14:03:09.000000000 +0000
769 -@@ -16,5 +16,6 @@
770 - SHLIB_MAJOR= 2
771 -
772 - WITHOUT_MAN=
773 -+LDADD+=-lelf
774 -
775 - .include <bsd.lib.mk>
776 -diff -uNr lib.ol/librtld_db/Makefile lib/librtld_db/Makefile
777 ---- lib.ol/librtld_db/Makefile 2011-11-02 14:02:13.000000000 +0000
778 -+++ lib/librtld_db/Makefile 2011-11-02 14:04:00.000000000 +0000
779 -@@ -10,5 +10,7 @@
780 - INCS= rtld_db.h
781 -
782 - CFLAGS+= -I${.CURDIR}
783 -+LDADD+=-lutil -lproc
784 -+LDFLAGS+=-L${.OBJDIR}/../libutil -L${.OBJDIR}/../libproc
785 -
786 - .include <bsd.lib.mk>
787
788 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-netware.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-netware.patch
789 deleted file mode 100644
790 index c1c2a0e0456..00000000000
791 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-netware.patch
792 +++ /dev/null
793 @@ -1,11 +0,0 @@
794 -diff -Nur lib.orig/libncp/Makefile lib/libncp/Makefile
795 ---- lib.orig/libncp/Makefile 2012-12-25 20:35:16.000000000 +0900
796 -+++ lib/libncp/Makefile 2012-12-25 20:36:23.000000000 +0900
797 -@@ -6,6 +6,7 @@
798 -
799 - DPADD= ${LIBIPX}
800 - LDADD= -lipx
801 -+LDFLAGS+=-L${.OBJDIR}/../libipx
802 -
803 - SRCS= ncpl_subr.c ncpl_bind.c ncpl_queue.c ncpl_file.c ncpl_misc.c \
804 - ncpl_net.c ncpl_rcfile.c ncpl_conn.c ncpl_nls.c ncpl_msg.c \
805
806 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-opieincludes.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-opieincludes.patch
807 deleted file mode 100644
808 index bf77a0a5219..00000000000
809 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.0-opieincludes.patch
810 +++ /dev/null
811 @@ -1,122 +0,0 @@
812 -Fixes warnings like:
813 -/var/tmp/portage/sys-freebsd/freebsd-lib-9.0-r2/work/lib/libopie/../../contrib/opie/libopie/randomchallenge.c:43:5:
814 -warning: incompatible implicit declaration of built-in function ‘strcpy’
815 -
816 -diff -uNr contrib.old/opie/libopie/accessfile.c contrib/opie/libopie/accessfile.c
817 ---- contrib.old/opie/libopie/accessfile.c 2012-05-25 08:54:33.000000000 -0400
818 -+++ contrib/opie/libopie/accessfile.c 2012-05-25 09:12:34.000000000 -0400
819 -@@ -46,6 +46,7 @@
820 - #ifdef DEBUG
821 - #include <syslog.h>
822 - #endif /* DEBUG */
823 -+#include <ctype.h>
824 -
825 - #include "opie.h"
826 -
827 -diff -uNr contrib.old/opie/libopie/generator.c contrib/opie/libopie/generator.c
828 ---- contrib.old/opie/libopie/generator.c 2012-05-25 08:54:33.000000000 -0400
829 -+++ contrib/opie/libopie/generator.c 2012-05-25 08:58:10.000000000 -0400
830 -@@ -50,6 +50,7 @@
831 - #include <syslog.h>
832 - #endif /* DEBUG */
833 - #include "opie.h"
834 -+#include <stdio.h>
835 -
836 - static char *algids[] = { NULL, NULL, NULL, "sha1", "md4", "md5" };
837 -
838 -diff -uNr contrib.old/opie/libopie/lookup.c contrib/opie/libopie/lookup.c
839 ---- contrib.old/opie/libopie/lookup.c 2012-05-25 08:54:33.000000000 -0400
840 -+++ contrib/opie/libopie/lookup.c 2012-05-25 09:15:08.000000000 -0400
841 -@@ -14,6 +14,7 @@
842 - #include "opie_cfg.h"
843 - #include <stdio.h>
844 - #include "opie.h"
845 -+#include <string.h>
846 -
847 - int opielookup FUNCTION((opie, principal), struct opie *opie AND char *principal)
848 - {
849 -diff -uNr contrib.old/opie/libopie/newseed.c contrib/opie/libopie/newseed.c
850 ---- contrib.old/opie/libopie/newseed.c 2012-05-25 08:54:33.000000000 -0400
851 -+++ contrib/opie/libopie/newseed.c 2012-05-25 09:14:37.000000000 -0400
852 -@@ -36,6 +36,9 @@
853 - #include <syslog.h>
854 - #endif /* DEBUG */
855 - #include "opie.h"
856 -+#include <stdio.h>
857 -+#include <stdlib.h>
858 -+#include <time.h>
859 -
860 - int opienewseed FUNCTION((seed), char *seed)
861 - {
862 -diff -uNr contrib.old/opie/libopie/parsechallenge.c contrib/opie/libopie/parsechallenge.c
863 ---- contrib.old/opie/libopie/parsechallenge.c 2012-05-25 08:54:33.000000000 -0400
864 -+++ contrib/opie/libopie/parsechallenge.c 2012-05-25 09:15:54.000000000 -0400
865 -@@ -20,6 +20,8 @@
866 - #include <string.h>
867 - #endif /* HAVE_STRING_H */
868 - #include "opie.h"
869 -+#include <stdlib.h>
870 -+#include <ctype.h>
871 -
872 - struct algorithm {
873 - char *name;
874 -diff -uNr contrib.old/opie/libopie/passwd.c contrib/opie/libopie/passwd.c
875 ---- contrib.old/opie/libopie/passwd.c 2012-05-25 08:54:33.000000000 -0400
876 -+++ contrib/opie/libopie/passwd.c 2012-05-25 09:13:45.000000000 -0400
877 -@@ -22,6 +22,7 @@
878 -
879 - #include "opie_cfg.h"
880 - #include "opie.h"
881 -+#include <string.h>
882 -
883 - int opiepasswd FUNCTION((old, flags, principal, n, seed, ks), struct opie *old AND int flags AND char *principal AND int n AND char *seed AND char *ks)
884 - {
885 -diff -uNr contrib.old/opie/libopie/randomchallenge.c contrib/opie/libopie/randomchallenge.c
886 ---- contrib.old/opie/libopie/randomchallenge.c 2012-05-25 08:54:33.000000000 -0400
887 -+++ contrib/opie/libopie/randomchallenge.c 2012-05-25 09:00:27.000000000 -0400
888 -@@ -28,6 +28,9 @@
889 -
890 - #include "opie_cfg.h"
891 - #include "opie.h"
892 -+#include <stdio.h>
893 -+#include <string.h>
894 -+#include <stdlib.h>
895 -
896 - static char *algids[] = { 0, 0, 0, "sha1", "md4", "md5" };
897 -
898 -diff -uNr contrib.old/opie/libopie/verify.c contrib/opie/libopie/verify.c
899 ---- contrib.old/opie/libopie/verify.c 2012-05-25 08:54:33.000000000 -0400
900 -+++ contrib/opie/libopie/verify.c 2012-05-25 09:12:09.000000000 -0400
901 -@@ -25,6 +25,7 @@
902 - #include <string.h>
903 - #endif /* HAVE_STRING_H */
904 - #include "opie.h"
905 -+#include <ctype.h>
906 -
907 - #define RESPONSE_STANDARD 0
908 - #define RESPONSE_WORD 1
909 -diff -uNr contrib.old/opie/libopie/version.c contrib/opie/libopie/version.c
910 ---- contrib.old/opie/libopie/version.c 2012-05-25 08:54:33.000000000 -0400
911 -+++ contrib/opie/libopie/version.c 2012-05-25 09:13:15.000000000 -0400
912 -@@ -19,6 +19,8 @@
913 - */
914 - #include "opie_cfg.h"
915 - #include "opie.h"
916 -+#include <stdio.h>
917 -+#include <stdlib.h>
918 -
919 - VOIDRET opieversion FUNCTION_NOARGS
920 - {
921 -diff -uNr contrib.old/opie/opie.h contrib/opie/opie.h
922 ---- contrib.old/opie/opie.h 2012-05-25 08:54:33.000000000 -0400
923 -+++ contrib/opie/opie.h 2012-05-25 09:21:28.000000000 -0400
924 -@@ -158,6 +158,9 @@
925 - int __opiereadrec __P((struct opie *));
926 - int __opiewriterec __P((struct opie *));
927 - int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts));
928 -+VOIDRET opiehashlen FUNCTION((algorithm, in, out, n), int algorithm AND VOIDPTR in AND struct opie_otpkey *out AND int n);
929 -+int opieinsecure FUNCTION_NOARGS;
930 -+int opienewseed FUNCTION((seed), char *seed);
931 - __END_DECLS
932 -
933 - #define opiestrncpy(dst, src, n) \
934
935 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-.eh_frame_hdr-fix.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-.eh_frame_hdr-fix.patch
936 deleted file mode 100644
937 index fdb7e16f6e0..00000000000
938 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-.eh_frame_hdr-fix.patch
939 +++ /dev/null
940 @@ -1,17 +0,0 @@
941 -Fix "no .eh_frame_hdr table will be created" error.
942 -
943 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47829
944 -http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4a0e0cd7377c45dc21d5c71bcab931b5e5727e74
945 -
946 -diff -Nur lib.orig/csu/i386-elf/Makefile lib/csu/i386-elf/Makefile
947 ---- lib.orig/csu/i386-elf/Makefile 2013-03-06 01:07:57.000000000 +0900
948 -+++ lib/csu/i386-elf/Makefile 2013-03-06 01:10:09.000000000 +0900
949 -@@ -10,6 +10,8 @@
950 - FILESDIR= ${LIBDIR}
951 - CFLAGS+= -I${.CURDIR}/../common \
952 - -I${.CURDIR}/../../libc/include
953 -+CFLAGS+= -fno-omit-frame-pointer
954 -+CFLAGS+= -fno-asynchronous-unwind-tables
955 - CLEANFILES= ${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
956 - CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s
957 -
958
959 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-aligned_alloc.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-aligned_alloc.patch
960 deleted file mode 100644
961 index 97ac14160b8..00000000000
962 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-aligned_alloc.patch
963 +++ /dev/null
964 @@ -1,51 +0,0 @@
965 -Backport aligned_alloc for C++11 support.
966 -
967 -http://lists.freebsd.org/pipermail/svn-src-stable-9/2012-November/003313.html
968 -
969 -diff -uNr lib.old/libc/stdlib/Symbol.map lib/libc/stdlib/Symbol.map
970 ---- lib.old/libc/stdlib/Symbol.map 2013-05-24 17:03:55.000000000 -0400
971 -+++ lib/libc/stdlib/Symbol.map 2013-05-24 17:06:03.000000000 -0400
972 -@@ -97,6 +97,7 @@
973 - atoi_l;
974 - atol_l;
975 - atoll_l;
976 -+ aligned_alloc;
977 - at_quick_exit;
978 - quick_exit;
979 - strtod_l;
980 -diff -uNr lib.old/libc/stdlib/malloc.c lib/libc/stdlib/malloc.c
981 ---- lib.old/libc/stdlib/malloc.c 2013-05-24 17:03:55.000000000 -0400
982 -+++ lib/libc/stdlib/malloc.c 2013-05-24 17:05:40.000000000 -0400
983 -@@ -6046,6 +6046,21 @@
984 - }
985 -
986 - void *
987 -+aligned_alloc(size_t alignment, size_t size)
988 -+{
989 -+ void *memptr;
990 -+ int ret;
991 -+
992 -+ ret = posix_memalign(&memptr, alignment, size);
993 -+ if (ret != 0) {
994 -+ errno = ret;
995 -+ return (NULL);
996 -+ }
997 -+ return (memptr);
998 -+}
999 -+
1000 -+
1001 -+void *
1002 - calloc(size_t num, size_t size)
1003 - {
1004 - void *ret;
1005 -diff -uNr includeold/stdlib.h include/stdlib.h
1006 ---- includeold/stdlib.h 2013-05-24 17:03:46.000000000 -0400
1007 -+++ include/stdlib.h 2013-05-24 17:04:46.000000000 -0400
1008 -@@ -155,6 +155,7 @@
1009 - * If we're in a mode greater than C99, expose C1x functions.
1010 - */
1011 - #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
1012 -+void * aligned_alloc(size_t, size_t);
1013 - _Noreturn void
1014 - quick_exit(int);
1015 - int at_quick_exit(void (*)(void));
1016
1017 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-rmgssapi.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-rmgssapi.patch
1018 deleted file mode 100644
1019 index 62357e0830d..00000000000
1020 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-9.1-rmgssapi.patch
1021 +++ /dev/null
1022 @@ -1,16 +0,0 @@
1023 ---- include/Makefile.orig 2013-06-16 10:47:52.000000000 +0200
1024 -+++ include/Makefile 2013-06-16 10:47:37.000000000 +0200
1025 -@@ -6,11 +6,11 @@
1026 - .include <bsd.own.mk>
1027 -
1028 - CLEANFILES= osreldate.h version vers.c
1029 -+SUBDIR= arpa protocols rpcsvc rpc xlocale
1030 --SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale
1031 - INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
1032 - db.h \
1033 - dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
1034 -+ fts.h ftw.h getopt.h glob.h grp.h \
1035 -- fts.h ftw.h getopt.h glob.h grp.h gssapi.h \
1036 - ieeefp.h ifaddrs.h \
1037 - inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
1038 - locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
1039
1040 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-add-nossp-cflags.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-add-nossp-cflags.patch
1041 deleted file mode 100644
1042 index 00b39f750ec..00000000000
1043 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-add-nossp-cflags.patch
1044 +++ /dev/null
1045 @@ -1,30 +0,0 @@
1046 -Please do not disable this patch.
1047 -All commands will be non-executable.
1048 -Abort trap: 6 (core dumped) is displayed...
1049 -
1050 -Details see Gentoo Bug #511698.
1051 -https://bugs.gentoo.org/show_bug.cgi?id=511698
1052 -
1053 -diff --git a/lib/libc/Makefile b/lib/libc/Makefile
1054 -index 1cc23b7..7dd458e 100644
1055 ---- a/lib/libc/Makefile
1056 -+++ b/lib/libc/Makefile
1057 -@@ -149,6 +149,6 @@ CWARNFLAGS:= ${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/:C/^$/-w/}
1058 - # in the future to circumvent this.
1059 - SSP_CFLAGS:= ${SSP_CFLAGS:S/^-fstack-protector-all$/-fstack-protector/}
1060 - # Disable stack protection for SSP symbols.
1061 --SSP_CFLAGS:= ${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/}
1062 -+SSP_CFLAGS:= ${.IMPSRC:N*/stack_protector.c:C/^.+$/${SSP_CFLAGS}/:C/^$/-fno-stack-protector/}
1063 - # Generate stack unwinding tables for cancellation points
1064 - CANCELPOINTS_CFLAGS:= ${.IMPSRC:Mcancelpoints_*:C/^.+$/${CANCELPOINTS_CFLAGS}/:C/^$//}
1065 -diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc
1066 -index f92d87d..7a3a2f3 100644
1067 ---- a/lib/csu/Makefile.inc
1068 -+++ b/lib/csu/Makefile.inc
1069 -@@ -1,5 +1,5 @@
1070 - # $FreeBSD: release/9.1.0/lib/csu/Makefile.inc 204757 2010-03-05 13:29:05Z uqs $
1071 -
1072 --SSP_CFLAGS=
1073 -+SSP_CFLAGS= -fno-stack-protector
1074 -
1075 - .include "../Makefile.inc"
1076
1077 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml2expat.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml2expat.patch
1078 deleted file mode 100644
1079 index 1b4e79129bf..00000000000
1080 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-bsdxml2expat.patch
1081 +++ /dev/null
1082 @@ -1,26 +0,0 @@
1083 -diff -ur lib/libgeom.old/Makefile lib/libgeom/Makefile
1084 ---- lib/libgeom.old/Makefile 2011-07-10 14:23:51.000000000 +0000
1085 -+++ lib/libgeom/Makefile 2011-07-10 15:12:39.000000000 +0000
1086 -@@ -13,8 +13,8 @@
1087 -
1088 - WARNS?= 3
1089 -
1090 --DPADD= ${LIBBSDXML} ${LIBSBUF}
1091 --LDADD= -lbsdxml -lsbuf
1092 -+DPADD= ${LIBSBUF}
1093 -+LDADD= -lexpat -lsbuf
1094 -
1095 - MAN= libgeom.3
1096 -
1097 -diff -ur lib/libgeom.old/geom_xml2tree.c lib/libgeom/geom_xml2tree.c
1098 ---- lib/libgeom.old/geom_xml2tree.c 2010-12-21 17:09:25.000000000 +0000
1099 -+++ lib/libgeom/geom_xml2tree.c 2011-07-10 15:12:52.000000000 +0000
1100 -@@ -43,7 +43,7 @@
1101 - #include <sys/sbuf.h>
1102 - #include <sys/sysctl.h>
1103 - #include <err.h>
1104 --#include <bsdxml.h>
1105 -+#include <expat.h>
1106 - #include <libgeom.h>
1107 -
1108 - struct mystate {
1109
1110 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-includes.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-includes.patch
1111 deleted file mode 100644
1112 index c2cf1421ea9..00000000000
1113 --- a/sys-freebsd/freebsd-lib/files/freebsd-lib-includes.patch
1114 +++ /dev/null
1115 @@ -1,13 +0,0 @@
1116 -Fix headers dependencies so that they can be included alone.
1117 -
1118 ---- include/ifaddrs.h.old 2009-05-15 13:50:10 +0000
1119 -+++ include/ifaddrs.h 2009-05-15 13:50:23 +0000
1120 -@@ -28,6 +28,8 @@
1121 - #ifndef _IFADDRS_H_
1122 - #define _IFADDRS_H_
1123 -
1124 -+#include <sys/types.h>
1125 -+
1126 - struct ifaddrs {
1127 - struct ifaddrs *ifa_next;
1128 - char *ifa_name;
1129
1130 diff --git a/sys-freebsd/freebsd-lib/files/freebsd-sources-9.0-sysctluint.patch b/sys-freebsd/freebsd-lib/files/freebsd-sources-9.0-sysctluint.patch
1131 deleted file mode 100644
1132 index 751a77c843b..00000000000
1133 --- a/sys-freebsd/freebsd-lib/files/freebsd-sources-9.0-sysctluint.patch
1134 +++ /dev/null
1135 @@ -1,13 +0,0 @@
1136 -u_int is defined in sys/types.h
1137 -makes header usable alone.
1138 -
1139 ---- sys/sys/sysctl.h.old 2012-05-25 11:08:53.000000000 -0400
1140 -+++ sys/sys/sysctl.h 2012-05-25 11:09:16.000000000 -0400
1141 -@@ -788,6 +788,7 @@
1142 - struct sysctl_req *);
1143 - #else /* !_KERNEL */
1144 - #include <sys/cdefs.h>
1145 -+#include <sys/types.h> /* for u_int */
1146 -
1147 - __BEGIN_DECLS
1148 - int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
1149
1150 diff --git a/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in b/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in
1151 deleted file mode 100644
1152 index 058ecb4384a..00000000000
1153 --- a/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in
1154 +++ /dev/null
1155 @@ -1,11 +0,0 @@
1156 -prefix=/usr
1157 -exec_prefix=${prefix}
1158 -libdir=@LIBDIR@
1159 -includedir=${prefix}/include
1160 -
1161 -Name: libusb
1162 -Description: USB access library (FreeBSD version)
1163 -Version: 1.0.1
1164 -Libs: -L${libdir} -lusb
1165 -Cflags: -I${includedir}
1166 -
1167
1168 diff --git a/sys-freebsd/freebsd-lib/files/libusb.pc.in b/sys-freebsd/freebsd-lib/files/libusb.pc.in
1169 deleted file mode 100644
1170 index f63c6e39981..00000000000
1171 --- a/sys-freebsd/freebsd-lib/files/libusb.pc.in
1172 +++ /dev/null
1173 @@ -1,11 +0,0 @@
1174 -prefix=/usr
1175 -exec_prefix=${prefix}
1176 -libdir=@LIBDIR@
1177 -includedir=${prefix}/include
1178 -
1179 -Name: libusb
1180 -Description: USB access library (FreeBSD version)
1181 -Version: 0.1.12
1182 -Libs: -L${libdir} -lusb
1183 -Cflags: -I${includedir}
1184 -
1185
1186 diff --git a/sys-freebsd/freebsd-lib/files/rquotad.xinetd b/sys-freebsd/freebsd-lib/files/rquotad.xinetd
1187 deleted file mode 100644
1188 index 876cd16c53c..00000000000
1189 --- a/sys-freebsd/freebsd-lib/files/rquotad.xinetd
1190 +++ /dev/null
1191 @@ -1,11 +0,0 @@
1192 -service rquotad
1193 -{
1194 - type = rpc
1195 - socket_type = dgram
1196 - protocol = udp
1197 - wait = yes
1198 - user = root
1199 - server = /usr/libexec/rpc.rquotad
1200 - rpc_version = 1
1201 - disabled = yes
1202 -}
1203
1204 diff --git a/sys-freebsd/freebsd-lib/files/rstatd.xinetd b/sys-freebsd/freebsd-lib/files/rstatd.xinetd
1205 deleted file mode 100644
1206 index ba1b819851e..00000000000
1207 --- a/sys-freebsd/freebsd-lib/files/rstatd.xinetd
1208 +++ /dev/null
1209 @@ -1,11 +0,0 @@
1210 -service rstatd
1211 -{
1212 - type = rpc
1213 - socket_type = dgram
1214 - protocol = udp
1215 - wait = yes
1216 - user = root
1217 - server = /usr/libexec/rpc.rstatd
1218 - rpc_version = 1-3
1219 - disabled = yes
1220 -}
1221
1222 diff --git a/sys-freebsd/freebsd-lib/files/rusersd.xinetd b/sys-freebsd/freebsd-lib/files/rusersd.xinetd
1223 deleted file mode 100644
1224 index 5cbe091881e..00000000000
1225 --- a/sys-freebsd/freebsd-lib/files/rusersd.xinetd
1226 +++ /dev/null
1227 @@ -1,11 +0,0 @@
1228 -service rusersd
1229 -{
1230 - type = rpc
1231 - socket_type = dgram
1232 - protocol = udp
1233 - wait = yes
1234 - user = root
1235 - server = /usr/libexec/rpc.rusersd
1236 - rpc_version = 1-2
1237 - disabled = yes
1238 -}
1239
1240 diff --git a/sys-freebsd/freebsd-lib/files/sprayd.xinetd b/sys-freebsd/freebsd-lib/files/sprayd.xinetd
1241 deleted file mode 100644
1242 index 7be55771ac2..00000000000
1243 --- a/sys-freebsd/freebsd-lib/files/sprayd.xinetd
1244 +++ /dev/null
1245 @@ -1,11 +0,0 @@
1246 -service sprayd
1247 -{
1248 - type = rpc
1249 - socket_type = dgram
1250 - protocol = udp
1251 - wait = yes
1252 - user = root
1253 - server = /usr/libexec/rpc.sprayd
1254 - rpc_version = 1
1255 - disabled = yes
1256 -}
1257
1258 diff --git a/sys-freebsd/freebsd-lib/files/walld.xinetd b/sys-freebsd/freebsd-lib/files/walld.xinetd
1259 deleted file mode 100644
1260 index 800b84fa21e..00000000000
1261 --- a/sys-freebsd/freebsd-lib/files/walld.xinetd
1262 +++ /dev/null
1263 @@ -1,11 +0,0 @@
1264 -service walld
1265 -{
1266 - type = rpc
1267 - socket_type = dgram
1268 - protocol = udp
1269 - wait = yes
1270 - user = root
1271 - server = /usr/libexec/rpc.rwalld
1272 - rpc_version = 1
1273 - disabled = yes
1274 -}
1275
1276 diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-11.1-r1.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-11.1-r1.ebuild
1277 deleted file mode 100644
1278 index 68bc1432a8a..00000000000
1279 --- a/sys-freebsd/freebsd-lib/freebsd-lib-11.1-r1.ebuild
1280 +++ /dev/null
1281 @@ -1,708 +0,0 @@
1282 -# Copyright 1999-2018 Gentoo Foundation
1283 -# Distributed under the terms of the GNU General Public License v2
1284 -
1285 -EAPI=5
1286 -
1287 -inherit bsdmk freebsd flag-o-matic multilib toolchain-funcs eutils multibuild multilib-build usr-ldscript
1288 -
1289 -DESCRIPTION="FreeBSD's base system libraries"
1290 -SLOT="0"
1291 -LICENSE="BSD GPL-2 zfs? ( CDDL )"
1292 -
1293 -# Security Advisory and Errata patches.
1294 -# UPSTREAM_PATCHES=()
1295 -
1296 -# Crypto is needed to have an internal OpenSSL header
1297 -# sys is needed for libalias, probably we can just extract that instead of
1298 -# extracting the whole tarball
1299 -if [[ ${PV} != *9999* ]]; then
1300 - KEYWORDS="~amd64-fbsd ~x86-fbsd"
1301 - SRC_URI="${SRC_URI}
1302 - $(freebsd_upstream_patches)"
1303 -fi
1304 -
1305 -EXTRACTONLY="
1306 - lib/
1307 - contrib/
1308 - crypto/
1309 - libexec/
1310 - etc/
1311 - include/
1312 - usr.bin/
1313 - usr.sbin/
1314 - gnu/
1315 - secure/
1316 -"
1317 -
1318 -if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then
1319 - RDEPEND="ssl? ( dev-libs/openssl:0= )
1320 - kerberos? ( app-crypt/heimdal )
1321 - pam? ( virtual/pam )
1322 - usb? ( !dev-libs/libusb )
1323 - zfs? ( =sys-freebsd/freebsd-cddl-${RV}* )
1324 - >=dev-libs/expat-2.0.1
1325 - >=dev-util/dialog-1.2.20150225
1326 - !sys-freebsd/freebsd-libexec
1327 - !sys-libs/libutempter
1328 - !dev-libs/libelf
1329 - !dev-libs/libexecinfo
1330 - !dev-libs/libiconv
1331 - !sys-freebsd/freebsd-headers"
1332 - DEPEND="${RDEPEND}
1333 - >=sys-devel/flex-2.5.31-r2
1334 - =sys-freebsd/freebsd-sources-${RV}*"
1335 - RDEPEND="${RDEPEND}
1336 - =sys-freebsd/freebsd-share-${RV}*
1337 - xinetd? ( sys-apps/xinetd )
1338 - >=virtual/libiconv-0-r2"
1339 -else
1340 - EXTRACTONLY+="sys/ "
1341 -fi
1342 -
1343 -DEPEND="${DEPEND}
1344 - userland_GNU? ( sys-apps/mtree )
1345 - =sys-freebsd/freebsd-mk-defs-${RV}*"
1346 -
1347 -S="${WORKDIR}/lib"
1348 -
1349 -export CTARGET=${CTARGET:-${CHOST}}
1350 -if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then
1351 - export CTARGET=${CATEGORY/cross-}
1352 -fi
1353 -
1354 -IUSE="atm bluetooth ssl ipv6 kerberos usb netware
1355 - build headers-only zfs pam xinetd
1356 - userland_GNU userland_BSD"
1357 -
1358 -QA_DT_NEEDED="lib/libc.so.7 usr/lib32/libc.so.7"
1359 -
1360 -pkg_setup() {
1361 - # Add the required source files.
1362 - use build && EXTRACTONLY+="sys/ "
1363 - use zfs && EXTRACTONLY+="cddl/ "
1364 -
1365 - [ -c /dev/zero ] || \
1366 - die "You forgot to mount /dev; the compiled libc would break."
1367 -
1368 - if ! use ssl && use kerberos; then
1369 - eerror "If you want kerberos support you need to enable ssl support, too."
1370 - fi
1371 -
1372 - use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
1373 - use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= "
1374 - mymakeopts="${mymakeopts} WITHOUT_HESIOD= "
1375 - use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6_SUPPORT= "
1376 - use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= WITHOUT_GSSAPI= "
1377 - use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
1378 - use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
1379 - use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
1380 - use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
1381 -
1382 - mymakeopts="${mymakeopts} WITHOUT_SENDMAIL= WITHOUT_CLANG= WITHOUT_LIBCPLUSPLUS= WITHOUT_LDNS= WITHOUT_UNBOUND= WITHOUT_BSNMP= "
1383 -
1384 - if [ "${CTARGET}" != "${CHOST}" ]; then
1385 - mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
1386 - mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
1387 - fi
1388 -
1389 - # Taken from freebsd-libexec.
1390 - use pam || mymakeopts="${mymakeopts} WITHOUT_PAM_SUPPORT= "
1391 - if has_version "<sys-freebsd/freebsd-ubin-11.0"; then
1392 - mymakeopts="${mymakeopts} WITHOUT_MAN_UTILS= "
1393 - fi
1394 -}
1395 -
1396 -PATCHES=(
1397 - "${FILESDIR}/${PN}-6.0-pmc.patch"
1398 - "${FILESDIR}/${PN}-9.0-bluetooth.patch"
1399 - "${FILESDIR}/${PN}-11.0-workaround.patch"
1400 - "${FILESDIR}/${PN}-11.0-bsdxml2expat.patch"
1401 - "${FILESDIR}/${PN}-11.0-libproc-libcxx.patch"
1402 - "${FILESDIR}/${PN}-11.1-liblink.patch"
1403 - "${FILESDIR}/${PN}-add-nossp-cflags.patch"
1404 - )
1405 -# Here we disable and remove source which we don't need or want
1406 -# In order:
1407 -# - ncurses stuff
1408 -# - libexpat creates a bsdxml library which is the same as expat
1409 -# - archiving libraries (have their own ebuild)
1410 -# - sendmail libraries (they are installed by sendmail)
1411 -# - SNMP library and dependency (have their own ebuilds)
1412 -# - libstand: static library, 32bits on amd64 used for boot0, we build it from
1413 -# boot0 instead.
1414 -#
1415 -# The rest are libraries we already have somewhere else because
1416 -# they are contribution.
1417 -REMOVE_SUBDIRS="ncurses \
1418 - libexpat \
1419 - libz libbz2 libarchive liblzma \
1420 - libsm libsmdb libsmutil \
1421 - libbegemot libbsnmp \
1422 - libpam libpcap libwrap libmagic \
1423 - libcom_err
1424 - libedit
1425 - libstand
1426 - libgssapi"
1427 -
1428 -# Are we building a cross-compiler?
1429 -is_crosscompile() {
1430 - [ "${CATEGORY#*cross-}" != "${CATEGORY}" ]
1431 -}
1432 -
1433 -src_prepare() {
1434 - # If gcc-5.0 or later, apply a workaround to fix a critical issue. bug 573358
1435 - [[ "$(gcc-major-version)" -ge 5 ]] && replace-flags -O? -O1
1436 -
1437 - sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
1438 -
1439 - # Upstream Display Managers default to using VT7
1440 - # We should make FreeBSD allow this by default
1441 - local x=
1442 - for x in "${WORKDIR}"/etc/etc.*/ttys ; do
1443 - sed -i.bak \
1444 - -e '/ttyv5[[:space:]]/ a\
1445 -# Display Managers default to VT7.\
1446 -# If you use the xdm init script, keep ttyv6 commented out\
1447 -# unless you force a different VT for the DM being used.' \
1448 - -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \
1449 - || die "Failed to sed ${x}"
1450 - rm "${x}".bak
1451 - done
1452 -
1453 - # This one is here because it also
1454 - # patches "${WORKDIR}/include"
1455 - cd "${WORKDIR}"
1456 - epatch "${FILESDIR}/${PN}-includes.patch"
1457 -
1458 - # Don't install the hesiod man page or header
1459 - rm "${WORKDIR}"/include/hesiod.h || die
1460 - sed -i.bak -e 's:hesiod.h::' "${WORKDIR}"/include/Makefile || die
1461 - sed -i.bak -e 's:hesiod.c::' -e 's:hesiod.3::' \
1462 - "${WORKDIR}"/lib/libc/net/Makefile.inc || die
1463 -
1464 - # Fix the Makefiles of these few libraries that will overwrite our LDADD.
1465 - cd "${S}"
1466 - for dir in libradius libtacplus libcam libdevstat libfetch libgeom libmemstat libopie \
1467 - libsmb libprocstat libulog; do sed -i.bak -e 's:LDADD=:LDADD+=:g' "${dir}/Makefile" || \
1468 - die "Problem fixing \"${dir}/Makefile"
1469 - done
1470 - # Call LD with LDFLAGS, rename them to RAW_LDFLAGS
1471 - sed -e 's/LDFLAGS/RAW_LDFLAGS/g' \
1472 - -i "${S}/csu/i386/Makefile" || die
1473 -
1474 - if install --version 2> /dev/null | grep -q GNU; then
1475 - sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
1476 - fi
1477 -
1478 - # libsysdecode requires the latest headers.
1479 - need_bootstrap && \
1480 - sed -i "s:\${DESTDIR}\${INCLUDEDIR}:${WORKDIR}/include_proper_${ABI}:g" "${S}/libsysdecode/Makefile"
1481 -
1482 - # Taken from freebsd-libexec.
1483 - cd "${WORKDIR}/libexec"
1484 - dummy_mk smrsh mail.local tcpd telnetd rshd rlogind ftpd
1485 - # The old version of yacc doesn't support YFLAGS="-i".
1486 - if has_version "<sys-freebsd/freebsd-ubin-11.0"; then
1487 - sed -i -e '/^YFLAGS/d' "${WORKDIR}/libexec/dma/dmagent/Makefile"
1488 - fi
1489 -
1490 - # Try to fix sed calls for GNU sed. Do it only with GNU userland and force
1491 - # BSD's sed on BSD.
1492 - cd "${S}"
1493 - if [[ ${CBUILD:-${CHOST}} != *bsd* ]]; then
1494 - find . -name Makefile -exec sed -ibak 's/sed -i /sed -i/' {} \;
1495 - sed -i -e 's/-i ""/-i""/' "${S}/csu/Makefile.inc" || die
1496 - fi
1497 -
1498 - if use build; then
1499 - cd "${WORKDIR}"
1500 - # This patch has to be applied on ${WORKDIR}/sys, so we do it here since it
1501 - # shouldn't be a symlink to /usr/src/sys (which should be already patched)
1502 - epatch "${FILESDIR}"/freebsd-sources-9.0-sysctluint.patch
1503 - epatch "${FILESDIR}/${PN}-11.1-elf-nhdr.patch"
1504 - return 0
1505 - fi
1506 -
1507 - if ! is_crosscompile ; then
1508 - if [[ ! -e "${WORKDIR}/sys" ]]; then
1509 - ln -s "${SYSROOT}/usr/src/sys" "${WORKDIR}/sys" || die "Couldn't make sys symlink!"
1510 - fi
1511 - else
1512 - sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
1513 - "${S}/libc/rpc/Makefile.inc" \
1514 - "${S}/libc/yp/Makefile.inc"
1515 - fi
1516 -}
1517 -
1518 -bootstrap_lib() {
1519 - for i ; do
1520 - cd "${WORKDIR}/${i}" || die "missing ${i}"
1521 - freebsd_src_compile
1522 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/${i}"
1523 - done
1524 -}
1525 -
1526 -get_csudir() {
1527 - if [ -d "${WORKDIR}/lib/csu/$1-elf" ]; then
1528 - echo "lib/csu/$1-elf"
1529 - else
1530 - echo "lib/csu/$1"
1531 - fi
1532 -}
1533 -
1534 -bootstrap_csu() {
1535 - local csudir="$(get_csudir $(tc-arch-kernel ${CTARGET}))"
1536 - export RAW_LDFLAGS=$(raw-ldflags)
1537 - bootstrap_lib "${csudir}"
1538 -
1539 - CFLAGS="${CFLAGS} -B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}"
1540 - append-ldflags "-B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}"
1541 -
1542 - bootstrap_lib "gnu/lib/csu"
1543 -
1544 - cd "${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/csu"
1545 - for i in *.So ; do
1546 - ln -s $i ${i%.So}S.o
1547 - done
1548 - CFLAGS="${CFLAGS} -B ${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/csu"
1549 - append-ldflags "-B ${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/csu"
1550 -}
1551 -
1552 -# Compile libssp_nonshared.a and add it's path to LDFLAGS.
1553 -bootstrap_libssp_nonshared() {
1554 - bootstrap_lib "gnu/lib/libssp/libssp_nonshared"
1555 -}
1556 -
1557 -# We should call this function to compile itself correctly.
1558 -# A better solution is very welcome.
1559 -bootstrap_libc() {
1560 - mkdir "${WORKDIR}/bootstrap_libc_${ABI}" || die
1561 - append-ldflags "-L${WORKDIR}/bootstrap_libc_${ABI}"
1562 -
1563 - bootstrap_lib "lib/libc" "lib/libc_nonshared"
1564 - echo "GROUP ( ${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libc/libc.so.7 ${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libc_nonshared/libc_nonshared.a ${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/libssp/libssp_nonshared/libssp_nonshared.a )" > "${WORKDIR}/bootstrap_libc_${ABI}/libc.so" || die
1565 -}
1566 -
1567 -bootstrap_libgcc() {
1568 - bootstrap_lib "lib/libcompiler_rt"
1569 - cd "${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libcompiler_rt" || die
1570 - ln -s libcompiler_rt.a libgcc.a || die
1571 -
1572 - bootstrap_libc
1573 - bootstrap_lib "gnu/lib/libgcc"
1574 -}
1575 -
1576 -bootstrap_libthr() {
1577 - bootstrap_lib "lib/libthr"
1578 - cd "${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libthr" || die
1579 - ln -s libthr.so libpthread.so
1580 -}
1581 -
1582 -# What to build for a cross-compiler.
1583 -# We also need the csu but this has to be handled separately.
1584 -CROSS_SUBDIRS="lib/libc lib/msun gnu/lib/libssp/libssp_nonshared lib/libthr lib/libutil lib/librt lib/libc_nonshared lib/libcompiler_rt"
1585 -
1586 -# What to build for non-default ABIs.
1587 -NON_NATIVE_SUBDIRS="${CROSS_SUBDIRS} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt lib/libsbuf lib/libcam lib/libelf lib/libiconv_modules"
1588 -
1589 -# Subdirs for a native build:
1590 -NATIVE_SUBDIRS="lib gnu/lib/libssp/libssp_nonshared gnu/lib/libregex gnu/lib/csu gnu/lib/libgcc lib/libiconv_modules"
1591 -
1592 -# Is my $ABI native ?
1593 -is_native_abi() {
1594 - is_crosscompile && return 1
1595 - multilib_is_native_abi
1596 -}
1597 -
1598 -# Do we need to bootstrap the csu and libssp_nonshared?
1599 -need_bootstrap() {
1600 - is_crosscompile || use build || { ! is_native_abi && ! has_version '>=sys-freebsd/freebsd-lib-9.1-r8[multilib]' && ! has_version ">=sys-freebsd/freebsd-lib-9.1-r11[${MULTILIB_USEDEP}]" ; } || has_version "<${CATEGORY}/${P}"
1601 -}
1602 -
1603 -# Get the subdirs we are building.
1604 -get_subdirs() {
1605 - local ret=""
1606 - if is_native_abi ; then
1607 - # If we are building for the native ABI, build everything
1608 - ret="${NATIVE_SUBDIRS}"
1609 - elif is_crosscompile ; then
1610 - # With a cross-compiler we only build the very core parts.
1611 - ret="${CROSS_SUBDIRS}"
1612 - if [ "${EBUILD_PHASE}" = "install" ]; then
1613 - # Add the csu dir first when installing. We treat it separately for
1614 - # compiling.
1615 - ret="$(get_csudir $(tc-arch-kernel ${CTARGET})) ${ret}"
1616 - fi
1617 - else
1618 - # For the non-native ABIs we only build the csu parts and very core
1619 - # libraries for now.
1620 - ret="${NON_NATIVE_SUBDIRS} $(get_csudir $(tc-arch-kernel ${CHOST}))"
1621 - fi
1622 - echo "${ret}"
1623 -}
1624 -
1625 -# Bootstrap the core libraries and setup the flags so that the other parts can
1626 -# build against it.
1627 -do_bootstrap() {
1628 - einfo "Bootstrapping on ${CHOST} for ${CTARGET}"
1629 - if ! is_crosscompile ; then
1630 - # Pre-install headers, but not when building a cross-compiler since we
1631 - # assume they have been installed in the previous pass.
1632 - einfo "Pre-installing includes in include_proper_${ABI}"
1633 - mkdir "${WORKDIR}/include_proper_${ABI}" || die
1634 - CTARGET="${CHOST}" install_includes "/include_proper_${ABI}"
1635 - CFLAGS="${CFLAGS} -isystem ${WORKDIR}/include_proper_${ABI}"
1636 - [[ $(tc-getCXX) = *clang++* ]] && CXXFLAGS="${CXXFLAGS} -isystem /usr/include/c++/v1"
1637 - CXXFLAGS="${CXXFLAGS} -isystem ${WORKDIR}/include_proper_${ABI}"
1638 - mymakeopts="${mymakeopts} RPCDIR=${WORKDIR}/include_proper_${ABI}/rpcsvc"
1639 - fi
1640 - bootstrap_csu
1641 - bootstrap_libssp_nonshared
1642 - if is_crosscompile ; then
1643 - bootstrap_lib "lib/libcompiler_rt"
1644 - bootstrap_libc
1645 - else
1646 - is_native_abi || bootstrap_libgcc
1647 - is_native_abi && has_version "<=sys-freebsd/freebsd-lib-10.0" && bootstrap_libgcc
1648 - fi
1649 - is_native_abi || bootstrap_libthr
1650 -}
1651 -
1652 -# Taken from freebsd-libexec.
1653 -libexec_setup_multilib_vars() {
1654 - export mymakeopts="${mymakeopts} WITHOUT_RCMDS= WITHOUT_PF= "
1655 - need_bootstrap && CFLAGS="${CFLAGS} -isystem ${WORKDIR}/include_proper_${ABI}"
1656 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libc"
1657 - if ! multilib_is_native_abi ; then
1658 - cd "${WORKDIR}/libexec/rtld-elf" || die
1659 - export mymakeopts="${mymakeopts} PROG=ld-elf32.so.1 "
1660 - else
1661 - cd "${WORKDIR}/libexec" || die
1662 - fi
1663 - "$@"
1664 -}
1665 -
1666 -# Compile it. Assume we have the toolchain setup correctly.
1667 -do_compile() {
1668 - # Bootstrap if needed, otherwise assume the system headers are in
1669 - # /usr/include.
1670 - if need_bootstrap ; then
1671 - do_bootstrap
1672 - else
1673 - CFLAGS="${CFLAGS} -isystem /usr/include"
1674 - [[ $(tc-getCXX) = *clang++* ]] && CXXFLAGS="${CXXFLAGS} -isystem /usr/include/c++/v1"
1675 - fi
1676 -
1677 - export RAW_LDFLAGS=$(raw-ldflags)
1678 -
1679 - # Everything is now setup, build it!
1680 - for i in $(get_subdirs) ; do
1681 - einfo "Building in ${i}... with CC=${CC} and CFLAGS=${CFLAGS}"
1682 - cd "${WORKDIR}/${i}/" || die "missing ${i}."
1683 - freebsd_src_compile || die "make ${i} failed"
1684 - done
1685 -}
1686 -
1687 -src_compile() {
1688 - # Does not work with GNU sed
1689 - # Force BSD's sed on BSD.
1690 - if [[ ${CBUILD:-${CHOST}} == *bsd* ]]; then
1691 - export ESED=/usr/bin/sed
1692 - unalias sed
1693 - fi
1694 -
1695 - use usb && export NON_NATIVE_SUBDIRS="${NON_NATIVE_SUBDIRS} lib/libusb lib/libusbhid"
1696 -
1697 - cd "${WORKDIR}/include"
1698 - $(freebsd_get_bmake) CC="$(tc-getCC)" SRCTOP="${WORKDIR}" || die "make include failed"
1699 -
1700 - use headers-only && return 0
1701 -
1702 - # Bug #270098
1703 - append-flags $(test-flags -fno-strict-aliasing)
1704 -
1705 - # Bug #324445
1706 - append-flags $(test-flags -fno-strict-overflow)
1707 -
1708 - # strip flags and do not do it later, we only add safe, and in fact
1709 - # needed flags after all
1710 - strip-flags
1711 - export NOFLAGSTRIP=yes
1712 - if is_crosscompile ; then
1713 - export YACC='yacc -by'
1714 - CHOST=${CTARGET} tc-export CC LD CXX RANLIB
1715 - mymakeopts="${mymakeopts} NLS="
1716 - CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include"
1717 - CXXFLAGS="${CXXFLAGS} -isystem /usr/${CTARGET}/usr/include"
1718 - append-ldflags "-L${WORKDIR}/${CHOST}/${WORKDIR}/lib/libc"
1719 - fi
1720 -
1721 - if is_crosscompile ; then
1722 - do_compile
1723 - else
1724 - local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
1725 - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper do_compile
1726 - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper libexec_setup_multilib_vars freebsd_src_compile
1727 - fi
1728 -}
1729 -
1730 -gen_libc_ldscript() {
1731 - # Parameters:
1732 - # $1 = target libdir
1733 - # $2 = source libc dir
1734 - # $3 = source libssp_nonshared dir
1735 -
1736 - # Clear the symlink.
1737 - rm -f "${DESTDIR}/$2/libc.so" || die
1738 -
1739 - # Move the library if needed
1740 - if [ "$1" != "$2" ] ; then
1741 - mv "${DESTDIR}/$2/libc.so.7" "${DESTDIR}/$1/" || die
1742 - fi
1743 -
1744 - # Generate libc.so ldscript for inclusion of libssp_nonshared.a when linking
1745 - # this is done to avoid having to touch gcc spec file as it is currently
1746 - # done on FreeBSD upstream, mostly because their binutils aren't able to
1747 - # cope with linker scripts yet.
1748 - # Taken from toolchain-funcs.eclass:
1749 - local output_format
1750 - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
1751 - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
1752 -
1753 - # The iconv symbol is provided by libc_nonshared.a.
1754 - # http://svnweb.freebsd.org/base?view=revision&amp;revision=258283
1755 - cat > "${DESTDIR}/$2/libc.so" <<-END_LDSCRIPT
1756 -/* GNU ld script
1757 - SSP (-fstack-protector) requires __stack_chk_fail_local to be local.
1758 - GCC invokes this symbol in a non-PIC way, which results in TEXTRELs if
1759 - this symbol was provided by a shared libc. So we link in
1760 - libssp_nonshared.a from here.
1761 - */
1762 -${output_format}
1763 -GROUP ( /$1/libc.so.7 /$3/libc_nonshared.a /$3/libssp_nonshared.a )
1764 -END_LDSCRIPT
1765 -}
1766 -
1767 -header_list=""
1768 -
1769 -move_header() {
1770 - local dirname=$(dirname ${1})
1771 - local filename=$(basename ${1})
1772 -
1773 - if [ ! -d "${dirname}/${ABI}" ] ; then
1774 - mkdir "${dirname}/${ABI}" || die
1775 - fi
1776 -
1777 - mv "${1}" "${dirname}/${ABI}/" || die
1778 -
1779 - export header_list="${header_list} ${1}"
1780 -}
1781 -
1782 -make_header_template() {
1783 - cat <<-END_HEADER
1784 -/*
1785 - * Wrapped header for multilib support.
1786 - * See the real headers included below.
1787 - */
1788 -
1789 -#if defined(__x86_64__)
1790 - @ABI_amd64_fbsd@
1791 -#elif defined(__i386__)
1792 - @ABI_x86_fbsd@
1793 -#else
1794 - @ABI_${DEFAULT_ABI}@
1795 -#endif
1796 -END_HEADER
1797 -}
1798 -
1799 -wrap_header() {
1800 - local dirname=$(dirname ${1})
1801 - local filename=$(basename ${1})
1802 -
1803 - if [ -n "${dirname#.}" ] ; then
1804 - dirname="${dirname}/${2}"
1805 - else
1806 - dirname="${2}"
1807 - fi
1808 -
1809 - if [ -f "${dirname}/${filename}" ] ; then
1810 - sed -e "s:@ABI_${2}@:#include <${dirname}/${filename}>:" ${1}
1811 - else
1812 - cat ${1}
1813 - fi
1814 -}
1815 -
1816 -wrap_header_end() {
1817 - sed -e "s:@ABI_.*@:#error \"Sorry, no support for your ABI.\":" ${1}
1818 -}
1819 -
1820 -do_install() {
1821 - if is_crosscompile ; then
1822 - INCLUDEDIR="/usr/${CTARGET}/usr/include"
1823 - else
1824 - INCLUDEDIR="/usr/include"
1825 - fi
1826 -
1827 - dodir ${INCLUDEDIR}
1828 - CTARGET="${CHOST}" \
1829 - install_includes ${INCLUDEDIR}
1830 -
1831 - is_crosscompile && use headers-only && return 0
1832 -
1833 - # Install a libusb.pc for better compat with Linux's libusb
1834 - if use usb ; then
1835 - dodir /usr/$(get_libdir)/pkgconfig
1836 - sed -i.bkp "s:^libdir=.*:libdir=/usr/$(get_libdir):g" "${S}"/libusb/libusb-*.pc
1837 - fi
1838 -
1839 - for i in $(get_subdirs) ; do
1840 - if [[ ${i} != *libiconv_modules* ]] ; then
1841 - einfo "Installing in ${i}..."
1842 - cd "${WORKDIR}/${i}/" || die "missing ${i}."
1843 - freebsd_src_install || die "Install ${i} failed"
1844 - fi
1845 - done
1846 -
1847 - if ! is_crosscompile; then
1848 - local mymakeopts_save="${mymakeopts}"
1849 - mymakeopts="${mymakeopts} SHLIBDIR=/usr/$(get_libdir)/i18n LIBDIR=/usr/$(get_libdir)/i18n"
1850 -
1851 - einfo "Installing in lib/libiconv_modules..."
1852 - cd "${WORKDIR}/lib/libiconv_modules/" || die "missing libiconv_modules."
1853 - freebsd_src_install || die "Install lib/libiconv_modules failed"
1854 -
1855 - mymakeopts="${mymakeopts_save}"
1856 - fi
1857 -
1858 - if ! is_crosscompile ; then
1859 - if ! multilib_is_native_abi ; then
1860 - DESTDIR="${D}" gen_libc_ldscript "usr/$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)"
1861 - else
1862 - dodir "$(get_libdir)"
1863 - DESTDIR="${D}" gen_libc_ldscript "$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)"
1864 - fi
1865 - else
1866 - CHOST=${CTARGET} DESTDIR="${D}/usr/${CTARGET}/" gen_libc_ldscript "usr/lib" "usr/lib" "usr/lib"
1867 - # We're done for the cross libc here.
1868 - return 0
1869 - fi
1870 -
1871 - # Generate ldscripts for core libraries that will go in /
1872 - multilib_is_native_abi && \
1873 - gen_usr_ldscript -a alias cam geom ipsec jail kiconv \
1874 - kvm m md procstat sbuf thr ufs util elf
1875 -
1876 - if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]] ; then
1877 - cd "${D}/usr/include"
1878 - for i in machine/*.h fenv.h ; do
1879 - move_header ${i}
1880 - done
1881 - if multilib_is_native_abi ; then
1882 - # Supposedly the last one!
1883 - local uniq_headers="$(echo ${header_list} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')"
1884 - for j in ${uniq_headers} ; do
1885 - make_header_template > ${j}
1886 - for i in $(get_all_abis) ; do
1887 - wrap_header ${j} ${i} > ${j}.new
1888 - cp ${j}.new ${j}
1889 - rm -f ${j}.new
1890 - done
1891 - wrap_header_end ${j} > ${j}.new
1892 - cp ${j}.new ${j}
1893 - rm -f ${j}.new
1894 - done
1895 - fi
1896 - fi
1897 -}
1898 -
1899 -src_install() {
1900 - if is_crosscompile ; then
1901 - einfo "Installing for ${CTARGET} in ${CHOST}.."
1902 - # From this point we need to force: get stripped with the correct tools,
1903 - # get tc-arch-kernel to return the right value, etc.
1904 - export CHOST=${CTARGET}
1905 -
1906 - mymakeopts="${mymakeopts} WITHOUT_MAN= \
1907 - INCLUDEDIR=/usr/${CTARGET}/usr/include \
1908 - SHLIBDIR=/usr/${CTARGET}/usr/lib \
1909 - LIBDIR=/usr/${CTARGET}/usr/lib"
1910 -
1911 - dosym "usr/include" "/usr/${CTARGET}/sys-include"
1912 - do_install
1913 -
1914 - return 0
1915 - else
1916 - export STRIP_MASK="*/usr/lib*/*crt*.o"
1917 - local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
1918 - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper do_install
1919 -
1920 - # Taken from freebsd-libexec.
1921 - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper libexec_setup_multilib_vars freebsd_src_install
1922 - insinto /etc
1923 - doins "${WORKDIR}/etc/gettytab"
1924 - newinitd "${FILESDIR}/bootpd.initd" bootpd
1925 - newconfd "${FILESDIR}/bootpd.confd" bootpd
1926 -
1927 - if use xinetd; then
1928 - for rpcd in rstatd rusersd walld rquotad sprayd; do
1929 - insinto /etc/xinetd.d
1930 - newins "${FILESDIR}/${rpcd}.xinetd" ${rpcd}
1931 - done
1932 - fi
1933 - fi
1934 -
1935 - cd "${WORKDIR}/etc/"
1936 - insinto /etc
1937 - doins nls.alias mac.conf netconfig
1938 -
1939 - # Install ttys file
1940 - local MACHINE="$(tc-arch-kernel)"
1941 - doins "etc.${MACHINE}"/*
1942 -}
1943 -
1944 -install_includes()
1945 -{
1946 - local INCLUDEDIR="$1"
1947 -
1948 - # The idea is to be called from either install or unpack.
1949 - # During unpack it's required to install them as portage's user.
1950 - if [[ "${EBUILD_PHASE}" == "install" ]]; then
1951 - local DESTDIR="${D}"
1952 - BINOWN="root"
1953 - BINGRP="wheel"
1954 - else
1955 - local DESTDIR="${WORKDIR}"
1956 - [[ -z "${USER}" ]] && USER="portage"
1957 - BINOWN="${USER}"
1958 - [[ -z "${GROUPS}" ]] && GROUPS="portage"
1959 - BINGRP="${GROUPS}"
1960 - fi
1961 -
1962 - # Must exist before we use it.
1963 - [[ -d "${DESTDIR}${INCLUDEDIR}" ]] || die "dodir or mkdir ${INCLUDEDIR} before using install_includes."
1964 - cd "${WORKDIR}/include"
1965 -
1966 - local MACHINE="$(tc-arch-kernel)"
1967 -
1968 - einfo "Installing includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
1969 - $(freebsd_get_bmake) installincludes \
1970 - MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \
1971 - DESTDIR="${DESTDIR}" \
1972 - INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
1973 - BINGRP="${BINGRP}" \
1974 - WITHOUT_GSSAPI= \
1975 - $(usex zfs "WITH_CDDL=" "WITHOUT_CDDL=") \
1976 - SRCTOP="${WORKDIR}"|| die "install_includes() failed"
1977 - einfo "includes installed ok."
1978 - EXTRA_INCLUDES="lib/librtld_db lib/libutil lib/msun gnu/lib/libregex lib/libcasper lib/libmp"
1979 - for i in $EXTRA_INCLUDES; do
1980 - einfo "Installing $i includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
1981 - cd "${WORKDIR}/$i" || die
1982 - $(freebsd_get_bmake) installincludes DESTDIR="${DESTDIR}" \
1983 - MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \
1984 - INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
1985 - BINGRP="${BINGRP}" \
1986 - SRCTOP="${WORKDIR}" || die "problem installing $i includes."
1987 - einfo "$i includes installed ok."
1988 - done
1989 -}
1990
1991 diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-9.1-r11.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-9.1-r11.ebuild
1992 deleted file mode 100644
1993 index 354d1d40f72..00000000000
1994 --- a/sys-freebsd/freebsd-lib/freebsd-lib-9.1-r11.ebuild
1995 +++ /dev/null
1996 @@ -1,616 +0,0 @@
1997 -# Copyright 1999-2018 Gentoo Foundation
1998 -# Distributed under the terms of the GNU General Public License v2
1999 -
2000 -EAPI=5
2001 -
2002 -inherit bsdmk freebsd flag-o-matic multilib toolchain-funcs eutils multibuild multilib-build usr-ldscript
2003 -
2004 -DESCRIPTION="FreeBSD's base system libraries"
2005 -SLOT="0"
2006 -KEYWORDS="~amd64-fbsd ~x86-fbsd"
2007 -
2008 -# Crypto is needed to have an internal OpenSSL header
2009 -# sys is needed for libalias, probably we can just extract that instead of
2010 -# extracting the whole tarball
2011 -SRC_URI="mirror://gentoo/${LIB}.tar.bz2
2012 - mirror://gentoo/${CONTRIB}.tar.bz2
2013 - mirror://gentoo/${CRYPTO}.tar.bz2
2014 - mirror://gentoo/${LIBEXEC}.tar.bz2
2015 - mirror://gentoo/${ETC}.tar.bz2
2016 - mirror://gentoo/${INCLUDE}.tar.bz2
2017 - mirror://gentoo/${USBIN}.tar.bz2
2018 - mirror://gentoo/${GNU}.tar.bz2
2019 - build? (
2020 - mirror://gentoo/${SYS}.tar.bz2 )
2021 - zfs? (
2022 - mirror://gentoo/${CDDL}.tar.bz2 )"
2023 -
2024 -if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then
2025 - RDEPEND="ssl? ( dev-libs/openssl )
2026 - kerberos? ( app-crypt/heimdal )
2027 - usb? ( !dev-libs/libusb )
2028 - zfs? ( =sys-freebsd/freebsd-cddl-${RV}* )
2029 - >=dev-libs/expat-2.0.1
2030 - !sys-libs/libutempter
2031 - !sys-freebsd/freebsd-headers"
2032 - DEPEND="${RDEPEND}
2033 - >=sys-devel/flex-2.5.31-r2
2034 - =sys-freebsd/freebsd-sources-${RV}*"
2035 -else
2036 - SRC_URI="${SRC_URI}
2037 - mirror://gentoo/${SYS}.tar.bz2"
2038 -fi
2039 -
2040 -DEPEND="${DEPEND}
2041 - userland_GNU? ( sys-apps/mtree )
2042 - =sys-freebsd/freebsd-mk-defs-${RV}*"
2043 -
2044 -S="${WORKDIR}/lib"
2045 -
2046 -export CTARGET=${CTARGET:-${CHOST}}
2047 -if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then
2048 - export CTARGET=${CATEGORY/cross-}
2049 -fi
2050 -
2051 -IUSE="atm bluetooth ssl ipv6 kerberos usb netware
2052 - build headers-only zfs
2053 - userland_GNU userland_BSD"
2054 -
2055 -QA_DT_NEEDED="lib/libc.so.7 usr/lib32/libc.so.7"
2056 -
2057 -pkg_setup() {
2058 - [ -c /dev/zero ] || \
2059 - die "You forgot to mount /dev; the compiled libc would break."
2060 -
2061 - if ! use ssl && use kerberos; then
2062 - eerror "If you want kerberos support you need to enable ssl support, too."
2063 - fi
2064 -
2065 - use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
2066 - use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= "
2067 - mymakeopts="${mymakeopts} WITHOUT_HESIOD= "
2068 - use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6_SUPPORT= "
2069 - use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= WITHOUT_GSSAPI= "
2070 - use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
2071 - use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
2072 - use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
2073 - use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
2074 -
2075 - mymakeopts="${mymakeopts} WITHOUT_BIND= WITHOUT_BIND_LIBS= WITHOUT_SENDMAIL= WITHOUT_CLANG= "
2076 -
2077 - if [ "${CTARGET}" != "${CHOST}" ]; then
2078 - mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
2079 - mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
2080 - fi
2081 -}
2082 -
2083 -PATCHES=(
2084 - "${FILESDIR}/${PN}-6.0-pmc.patch"
2085 - "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
2086 - "${FILESDIR}/${PN}-6.1-csu.patch"
2087 - "${FILESDIR}/${PN}-9.0-liblink.patch"
2088 - "${FILESDIR}/${PN}-bsdxml2expat.patch"
2089 - "${FILESDIR}/${PN}-9.0-netware.patch"
2090 - "${FILESDIR}/${PN}-9.0-cve-2010-2632.patch"
2091 - "${FILESDIR}/${PN}-9.0-bluetooth.patch"
2092 - "${FILESDIR}/${PN}-9.1-.eh_frame_hdr-fix.patch"
2093 - "${FILESDIR}/${PN}-add-nossp-cflags.patch"
2094 - )
2095 -
2096 -# Here we disable and remove source which we don't need or want
2097 -# In order:
2098 -# - ncurses stuff
2099 -# - libexpat creates a bsdxml library which is the same as expat
2100 -# - archiving libraries (have their own ebuild)
2101 -# - sendmail libraries (they are installed by sendmail)
2102 -# - SNMP library and dependency (have their own ebuilds)
2103 -# - libstand: static library, 32bits on amd64 used for boot0, we build it from
2104 -# boot0 instead.
2105 -#
2106 -# The rest are libraries we already have somewhere else because
2107 -# they are contribution.
2108 -# Note: libtelnet is an internal lib used by telnet and telnetd programs
2109 -# as it's not used in freebsd-lib package itself, it's pointless building
2110 -# it here.
2111 -REMOVE_SUBDIRS="ncurses \
2112 - libexpat \
2113 - libz libbz2 libarchive liblzma \
2114 - libsm libsmdb libsmutil \
2115 - libbegemot libbsnmp \
2116 - libpam libpcap bind libwrap libmagic \
2117 - libcom_err libtelnet
2118 - libelf libedit
2119 - libstand
2120 - libgssapi"
2121 -
2122 -# Are we building a cross-compiler?
2123 -is_crosscompile() {
2124 - [ "${CATEGORY#*cross-}" != "${CATEGORY}" ]
2125 -}
2126 -
2127 -src_prepare() {
2128 - sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
2129 -
2130 - # Upstream Display Managers default to using VT7
2131 - # We should make FreeBSD allow this by default
2132 - local x=
2133 - for x in "${WORKDIR}"/etc/etc.*/ttys ; do
2134 - sed -i.bak \
2135 - -e '/ttyv5[[:space:]]/ a\
2136 -# Display Managers default to VT7.\
2137 -# If you use the xdm init script, keep ttyv6 commented out\
2138 -# unless you force a different VT for the DM being used.' \
2139 - -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \
2140 - || die "Failed to sed ${x}"
2141 - rm "${x}".bak
2142 - done
2143 -
2144 - # This one is here because it also
2145 - # patches "${WORKDIR}/include"
2146 - cd "${WORKDIR}"
2147 - epatch "${FILESDIR}/${PN}-includes.patch"
2148 - epatch "${FILESDIR}/${PN}-8.0-gcc45.patch"
2149 - epatch "${FILESDIR}/${PN}-9.0-opieincludes.patch"
2150 - epatch "${FILESDIR}/${PN}-9.1-aligned_alloc.patch"
2151 - epatch "${FILESDIR}/${PN}-9.1-rmgssapi.patch"
2152 -
2153 - # Don't install the hesiod man page or header
2154 - rm "${WORKDIR}"/include/hesiod.h || die
2155 - sed -i.bak -e 's:hesiod.h::' "${WORKDIR}"/include/Makefile || die
2156 - sed -i.bak -e 's:hesiod.c::' -e 's:hesiod.3::' \
2157 - "${WORKDIR}"/lib/libc/net/Makefile.inc || die
2158 -
2159 - # Fix the Makefiles of these few libraries that will overwrite our LDADD.
2160 - cd "${S}"
2161 - for dir in libradius libtacplus libcam libdevstat libfetch libgeom libmemstat libopie \
2162 - libsmb libprocstat libulog; do sed -i.bak -e 's:LDADD=:LDADD+=:g' "${dir}/Makefile" || \
2163 - die "Problem fixing \"${dir}/Makefile"
2164 - done
2165 - # Call LD with LDFLAGS, rename them to RAW_LDFLAGS
2166 - sed -e 's/LDFLAGS/RAW_LDFLAGS/g' \
2167 - -i "${S}/csu/i386-elf/Makefile" \
2168 - -i "${S}/csu/ia64/Makefile" || die
2169 - if use build; then
2170 - cd "${WORKDIR}"
2171 - # This patch has to be applied on ${WORKDIR}/sys, so we do it here since it
2172 - # shouldn't be a symlink to /usr/src/sys (which should be already patched)
2173 - epatch "${FILESDIR}"/${PN}-7.1-types.h-fix.patch
2174 - epatch "${FILESDIR}"/freebsd-sources-9.0-sysctluint.patch
2175 - return 0
2176 - fi
2177 -
2178 - if ! is_crosscompile ; then
2179 - ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys" || die "Couldn't make sys symlink!"
2180 - else
2181 - sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
2182 - "${S}/libc/rpc/Makefile.inc" \
2183 - "${S}/libc/yp/Makefile.inc"
2184 - fi
2185 -
2186 - if install --version 2> /dev/null | grep -q GNU; then
2187 - sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
2188 - fi
2189 -
2190 - # Try to fix sed calls for GNU sed. Do it only with GNU userland and force
2191 - # BSD's sed on BSD.
2192 - cd "${S}"
2193 - if use userland_GNU; then
2194 - find . -name Makefile -exec sed -ibak 's/sed -i /sed -i/' {} \;
2195 - fi
2196 -}
2197 -
2198 -get_csudir() {
2199 - if [ -d "${WORKDIR}/lib/csu/$1-elf" ]; then
2200 - echo "lib/csu/$1-elf"
2201 - else
2202 - echo "lib/csu/$1"
2203 - fi
2204 -}
2205 -
2206 -bootstrap_csu() {
2207 - local csudir="$(get_csudir $(tc-arch-kernel ${CTARGET}))"
2208 - export RAW_LDFLAGS=$(raw-ldflags)
2209 - cd "${WORKDIR}/${csudir}" || die "Missing ${csudir}."
2210 - freebsd_src_compile
2211 -
2212 - CFLAGS="${CFLAGS} -B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}"
2213 - append-ldflags "-B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}"
2214 -
2215 - cd "${WORKDIR}/gnu/lib/csu" || die
2216 - freebsd_src_compile
2217 - cd "${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/csu"
2218 - for i in *.So ; do
2219 - ln -s $i ${i%.So}S.o
2220 - done
2221 - CFLAGS="${CFLAGS} -B ${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/csu"
2222 - append-ldflags "-B ${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/csu"
2223 -}
2224 -
2225 -# Compile libssp_nonshared.a and add it's path to LDFLAGS.
2226 -bootstrap_libssp_nonshared() {
2227 - cd "${WORKDIR}/gnu/lib/libssp/libssp_nonshared/" || die "missing libssp."
2228 - freebsd_src_compile
2229 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/libssp/libssp_nonshared/"
2230 - export LDADD="-lssp_nonshared"
2231 -}
2232 -
2233 -bootstrap_libc() {
2234 - cd "${WORKDIR}/lib/libc" || die
2235 - freebsd_src_compile
2236 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libc"
2237 -}
2238 -
2239 -bootstrap_libgcc() {
2240 - cd "${WORKDIR}/lib/libcompiler_rt" || die
2241 - freebsd_src_compile
2242 - cd "${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libcompiler_rt" || die
2243 - ln -s libcompiler_rt.a libgcc.a || die
2244 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libcompiler_rt"
2245 -
2246 - bootstrap_libc
2247 -
2248 - cd "${WORKDIR}/gnu/lib/libgcc" || die
2249 - freebsd_src_compile
2250 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/libgcc"
2251 -}
2252 -
2253 -bootstrap_libthr() {
2254 - cd "${WORKDIR}/lib/libthr" || die
2255 - freebsd_src_compile
2256 - append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libthr"
2257 - cd "${MAKEOBJDIRPREFIX}/${WORKDIR}/lib/libthr" || die
2258 - ln -s libthr.so libpthread.so
2259 -}
2260 -
2261 -# What to build for a cross-compiler.
2262 -# We also need the csu but this has to be handled separately.
2263 -CROSS_SUBDIRS="lib/libc lib/msun gnu/lib/libssp/libssp_nonshared lib/libthr lib/libutil lib/librt"
2264 -
2265 -# What to build for non-default ABIs.
2266 -NON_NATIVE_SUBDIRS="${CROSS_SUBDIRS} gnu/lib/csu lib/libcompiler_rt gnu/lib/libgcc lib/libmd lib/libcrypt"
2267 -
2268 -# Subdirs for a native build:
2269 -NATIVE_SUBDIRS="lib gnu/lib/libssp/libssp_nonshared gnu/lib/libregex gnu/lib/csu gnu/lib/libgcc"
2270 -
2271 -# Is my $ABI native ?
2272 -is_native_abi() {
2273 - is_crosscompile && return 1
2274 - multilib_is_native_abi
2275 -}
2276 -
2277 -# Do we need to bootstrap the csu and libssp_nonshared?
2278 -need_bootstrap() {
2279 - is_crosscompile || use build || { ! is_native_abi && ! has_version '>=sys-freebsd/freebsd-lib-9.1-r8[multilib]' && ! has_version ">=sys-freebsd/freebsd-lib-9.1-r11[${MULTILIB_USEDEP}]" ; } || has_version "<${CATEGORY}/${P}"
2280 -}
2281 -
2282 -# Get the subdirs we are building.
2283 -get_subdirs() {
2284 - local ret=""
2285 - if is_native_abi ; then
2286 - # If we are building for the native ABI, build everything
2287 - ret="${NATIVE_SUBDIRS}"
2288 - elif is_crosscompile ; then
2289 - # With a cross-compiler we only build the very core parts.
2290 - ret="${CROSS_SUBDIRS}"
2291 - if [ "${EBUILD_PHASE}" = "install" ]; then
2292 - # Add the csu dir first when installing. We treat it separately for
2293 - # compiling.
2294 - ret="$(get_csudir $(tc-arch-kernel ${CTARGET})) ${ret}"
2295 - fi
2296 - else
2297 - # For the non-native ABIs we only build the csu parts and very core
2298 - # libraries for now.
2299 - ret="${NON_NATIVE_SUBDIRS} $(get_csudir $(tc-arch-kernel ${CHOST}))"
2300 - fi
2301 - echo "${ret}"
2302 -}
2303 -
2304 -# Bootstrap the core libraries and setup the flags so that the other parts can
2305 -# build against it.
2306 -do_bootstrap() {
2307 - einfo "Bootstrapping on ${CHOST} for ${CTARGET}"
2308 - if ! is_crosscompile ; then
2309 - # Pre-install headers, but not when building a cross-compiler since we
2310 - # assume they have been installed in the previous pass.
2311 - einfo "Pre-installing includes in include_proper_${ABI}"
2312 - mkdir "${WORKDIR}/include_proper_${ABI}" || die
2313 - CTARGET="${CHOST}" install_includes "/include_proper_${ABI}"
2314 - CFLAGS="${CFLAGS} -isystem ${WORKDIR}/include_proper_${ABI}"
2315 - fi
2316 - bootstrap_csu
2317 - bootstrap_libssp_nonshared
2318 - is_crosscompile && bootstrap_libc
2319 - is_crosscompile || is_native_abi || bootstrap_libgcc
2320 - is_native_abi || bootstrap_libthr
2321 -}
2322 -
2323 -# Compile it. Assume we have the toolchain setup correctly.
2324 -do_compile() {
2325 - # Bootstrap if needed, otherwise assume the system headers are in
2326 - # /usr/include.
2327 - if need_bootstrap ; then
2328 - do_bootstrap
2329 - else
2330 - CFLAGS="${CFLAGS} -isystem /usr/include"
2331 - fi
2332 -
2333 - export RAW_LDFLAGS=$(raw-ldflags)
2334 -
2335 - # Everything is now setup, build it!
2336 - for i in $(get_subdirs) ; do
2337 - einfo "Building in ${i}... with CC=${CC} and CFLAGS=${CFLAGS}"
2338 - cd "${WORKDIR}/${i}/" || die "missing ${i}."
2339 - freebsd_src_compile || die "make ${i} failed"
2340 - done
2341 -}
2342 -
2343 -src_compile() {
2344 - # Does not work with GNU sed
2345 - # Force BSD's sed on BSD.
2346 - if use userland_BSD ; then
2347 - export ESED=/usr/bin/sed
2348 - unalias sed
2349 - fi
2350 -
2351 - use usb && export NON_NATIVE_SUBDIRS="${NON_NATIVE_SUBDIRS} lib/libusb lib/libusbhid"
2352 -
2353 - cd "${WORKDIR}/include"
2354 - $(freebsd_get_bmake) CC="$(tc-getCC)" || die "make include failed"
2355 -
2356 - use headers-only && return 0
2357 -
2358 - # Bug #270098
2359 - append-flags $(test-flags -fno-strict-aliasing)
2360 -
2361 - # Bug #324445
2362 - append-flags $(test-flags -fno-strict-overflow)
2363 -
2364 - # strip flags and do not do it later, we only add safe, and in fact
2365 - # needed flags after all
2366 - strip-flags
2367 - export NOFLAGSTRIP=yes
2368 - if is_crosscompile ; then
2369 - export YACC='yacc -by'
2370 - CHOST=${CTARGET} tc-export CC LD CXX RANLIB
2371 - mymakeopts="${mymakeopts} NLS="
2372 - CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include"
2373 - append-ldflags "-L${WORKDIR}/${CHOST}/${WORKDIR}/lib/libc"
2374 - fi
2375 -
2376 - if is_crosscompile ; then
2377 - do_compile
2378 - else
2379 - local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
2380 - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper do_compile
2381 - fi
2382 -}
2383 -
2384 -gen_libc_ldscript() {
2385 - # Parameters:
2386 - # $1 = target libdir
2387 - # $2 = source libc dir
2388 - # $3 = source libssp_nonshared dir
2389 -
2390 - # Clear the symlink.
2391 - rm -f "${D}/$2/libc.so" || die
2392 -
2393 - # Move the library if needed
2394 - if [ "$1" != "$2" ] ; then
2395 - mv "${D}/$2/libc.so.7" "${D}/$1/" || die
2396 - fi
2397 -
2398 - # Generate libc.so ldscript for inclusion of libssp_nonshared.a when linking
2399 - # this is done to avoid having to touch gcc spec file as it is currently
2400 - # done on FreeBSD upstream, mostly because their binutils aren't able to
2401 - # cope with linker scripts yet.
2402 - # Taken from toolchain-funcs.eclass:
2403 - local output_format
2404 - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
2405 - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
2406 -
2407 - cat > "${D}/$2/libc.so" <<-END_LDSCRIPT
2408 -/* GNU ld script
2409 - SSP (-fstack-protector) requires __stack_chk_fail_local to be local.
2410 - GCC invokes this symbol in a non-PIC way, which results in TEXTRELs if
2411 - this symbol was provided by a shared libc. So we link in
2412 - libssp_nonshared.a from here.
2413 - */
2414 -${output_format}
2415 -GROUP ( /$1/libc.so.7 /$3/libssp_nonshared.a )
2416 -END_LDSCRIPT
2417 -}
2418 -
2419 -header_list=""
2420 -
2421 -move_header() {
2422 - local dirname=$(dirname ${1})
2423 - local filename=$(basename ${1})
2424 -
2425 - if [ ! -d "${dirname}/${ABI}" ] ; then
2426 - mkdir "${dirname}/${ABI}" || die
2427 - fi
2428 -
2429 - mv "${1}" "${dirname}/${ABI}/" || die
2430 -
2431 - export header_list="${header_list} ${1}"
2432 -}
2433 -
2434 -make_header_template() {
2435 - cat <<-END_HEADER
2436 -/*
2437 - * Wrapped header for multilib support.
2438 - * See the real headers included below.
2439 - */
2440 -
2441 -#if defined(__x86_64__)
2442 - @ABI_amd64_fbsd@
2443 -#elif defined(__i386__)
2444 - @ABI_x86_fbsd@
2445 -#else
2446 - @ABI_${DEFAULT_ABI}@
2447 -#endif
2448 -END_HEADER
2449 -}
2450 -
2451 -wrap_header() {
2452 - local dirname=$(dirname ${1})
2453 - local filename=$(basename ${1})
2454 -
2455 - if [ -n "${dirname#.}" ] ; then
2456 - dirname="${dirname}/${2}"
2457 - else
2458 - dirname="${2}"
2459 - fi
2460 -
2461 - if [ -f "${dirname}/${filename}" ] ; then
2462 - sed -e "s:@ABI_${2}@:#include <${dirname}/${filename}>:" ${1}
2463 - else
2464 - cat ${1}
2465 - fi
2466 -}
2467 -
2468 -wrap_header_end() {
2469 - sed -e "s:@ABI_.*@:#error \"Sorry, no support for your ABI.\":" ${1}
2470 -}
2471 -
2472 -do_install() {
2473 - if is_crosscompile ; then
2474 - INCLUDEDIR="/usr/${CTARGET}/usr/include"
2475 - else
2476 - INCLUDEDIR="/usr/include"
2477 - fi
2478 -
2479 - dodir ${INCLUDEDIR}
2480 - CTARGET="${CHOST}" \
2481 - install_includes ${INCLUDEDIR}
2482 -
2483 - is_crosscompile && use headers-only && return 0
2484 -
2485 - for i in $(get_subdirs) ; do
2486 - einfo "Installing in ${i}..."
2487 - cd "${WORKDIR}/${i}/" || die "missing ${i}."
2488 - freebsd_src_install || die "Install ${i} failed"
2489 - done
2490 -
2491 - if ! is_crosscompile ; then
2492 - if ! multilib_is_native_abi ; then
2493 - gen_libc_ldscript "usr/$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)"
2494 - else
2495 - dodir "$(get_libdir)"
2496 - gen_libc_ldscript "$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)"
2497 - fi
2498 - else
2499 - CHOST=${CTARGET} gen_libc_ldscript "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib"
2500 - fi
2501 -
2502 - # Install a libusb.pc for better compat with Linux's libusb
2503 - if use usb ; then
2504 - dodir /usr/$(get_libdir)/pkgconfig
2505 - sed -e "s:@LIBDIR@:/usr/$(get_libdir):" "${FILESDIR}/libusb.pc.in" > "${D}/usr/$(get_libdir)/pkgconfig/libusb.pc" || die
2506 - sed -e "s:@LIBDIR@:/usr/$(get_libdir):" "${FILESDIR}/libusb-1.0.pc.in" > "${D}/usr/$(get_libdir)/pkgconfig/libusb-1.0.pc" || die
2507 - fi
2508 -
2509 - # Generate ldscripts for core libraries that will go in /
2510 - multilib_is_native_abi && \
2511 - gen_usr_ldscript -a alias cam geom ipsec jail kiconv \
2512 - kvm m md procstat sbuf thr ufs util
2513 -
2514 - if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]] ; then
2515 - cd "${D}/usr/include"
2516 - for i in machine/*.h fenv.h ; do
2517 - move_header ${i}
2518 - done
2519 - if multilib_is_native_abi ; then
2520 - # Supposedly the last one!
2521 - local uniq_headers="$(echo ${header_list} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')"
2522 - for j in ${uniq_headers} ; do
2523 - make_header_template > ${j}
2524 - for i in $(get_all_abis) ; do
2525 - wrap_header ${j} ${i} > ${j}.new
2526 - cp ${j}.new ${j}
2527 - rm -f ${j}.new
2528 - done
2529 - wrap_header_end ${j} > ${j}.new
2530 - cp ${j}.new ${j}
2531 - rm -f ${j}.new
2532 - done
2533 - fi
2534 - fi
2535 -}
2536 -
2537 -src_install() {
2538 - if is_crosscompile ; then
2539 - einfo "Installing for ${CTARGET} in ${CHOST}.."
2540 - # From this point we need to force: get stripped with the correct tools,
2541 - # get tc-arch-kernel to return the right value, etc.
2542 - export CHOST=${CTARGET}
2543 -
2544 - mymakeopts="${mymakeopts} NO_MAN= \
2545 - INCLUDEDIR=/usr/${CTARGET}/usr/include \
2546 - SHLIBDIR=/usr/${CTARGET}/usr/lib \
2547 - LIBDIR=/usr/${CTARGET}/usr/lib"
2548 -
2549 - dosym "usr/include" "/usr/${CTARGET}/sys-include"
2550 - do_install
2551 -
2552 - return 0
2553 - else
2554 - export STRIP_MASK="*/usr/lib*/*crt*.o"
2555 - local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
2556 - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper do_install
2557 - fi
2558 -
2559 - cd "${WORKDIR}/etc/"
2560 - insinto /etc
2561 - doins nls.alias mac.conf netconfig
2562 -
2563 - # Install ttys file
2564 - local MACHINE="$(tc-arch-kernel)"
2565 - doins "etc.${MACHINE}"/*
2566 -
2567 - # unset to run QA check properly
2568 - unset ESED
2569 -}
2570 -
2571 -install_includes()
2572 -{
2573 - local INCLUDEDIR="$1"
2574 -
2575 - # The idea is to be called from either install or unpack.
2576 - # During unpack it's required to install them as portage's user.
2577 - if [[ "${EBUILD_PHASE}" == "install" ]]; then
2578 - local DESTDIR="${D}"
2579 - BINOWN="root"
2580 - BINGRP="wheel"
2581 - else
2582 - local DESTDIR="${WORKDIR}"
2583 - [[ -z "${USER}" ]] && USER="portage"
2584 - BINOWN="${USER}"
2585 - [[ -z "${GROUPS}" ]] && GROUPS="portage"
2586 - BINGRP="${GROUPS}"
2587 - fi
2588 -
2589 - # Must exist before we use it.
2590 - [[ -d "${DESTDIR}${INCLUDEDIR}" ]] || die "dodir or mkdir ${INCLUDEDIR} before using install_includes."
2591 - cd "${WORKDIR}/include"
2592 -
2593 - local MACHINE="$(tc-arch-kernel)"
2594 -
2595 - einfo "Installing includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
2596 - $(freebsd_get_bmake) installincludes \
2597 - MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \
2598 - DESTDIR="${DESTDIR}" \
2599 - INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
2600 - BINGRP="${BINGRP}" || die "install_includes() failed"
2601 - einfo "includes installed ok."
2602 - EXTRA_INCLUDES="lib/librtld_db lib/libutil lib/msun gnu/lib/libregex"
2603 - for i in $EXTRA_INCLUDES; do
2604 - einfo "Installing $i includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
2605 - cd "${WORKDIR}/$i" || die
2606 - $(freebsd_get_bmake) installincludes DESTDIR="${DESTDIR}" \
2607 - MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \
2608 - INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
2609 - BINGRP="${BINGRP}" || die "problem installing $i includes."
2610 - einfo "$i includes installed ok."
2611 - done
2612 -}
2613
2614 diff --git a/sys-freebsd/freebsd-lib/metadata.xml b/sys-freebsd/freebsd-lib/metadata.xml
2615 deleted file mode 100644
2616 index 4fa69d85349..00000000000
2617 --- a/sys-freebsd/freebsd-lib/metadata.xml
2618 +++ /dev/null
2619 @@ -1,15 +0,0 @@
2620 -<?xml version="1.0" encoding="UTF-8"?>
2621 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
2622 -<pkgmetadata>
2623 - <maintainer type="project">
2624 - <email>bsd@g.o</email>
2625 - <name>BSD Project</name>
2626 - </maintainer>
2627 - <use>
2628 - <flag name="netware">
2629 - Build libraries and tools to work with NetWare protocols (IPX
2630 - and NCP).
2631 - </flag>
2632 - <flag name="zfs">Enable ZFS support.</flag>
2633 - </use>
2634 -</pkgmetadata>