summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuta SATOH <nigoro.dev@gmail.com>2016-09-28 20:57:21 +0900
committerYuta SATOH <nigoro.dev@gmail.com>2016-09-28 20:57:21 +0900
commit7808fa178a26089ff2fc0c338a3e1835b290ffea (patch)
tree5c0ed322a3a07b6937d6406c785d218f008f57be /sys-freebsd/freebsd-ubin/files
parentsys-freebsd: remove 10.3_rc3 ebuilds (diff)
downloadgentoo-bsd-7808fa178a26089ff2fc0c338a3e1835b290ffea.tar.gz
gentoo-bsd-7808fa178a26089ff2fc0c338a3e1835b290ffea.tar.bz2
gentoo-bsd-7808fa178a26089ff2fc0c338a3e1835b290ffea.zip
sys-freebsd: import 10.3 from latest tree
Diffstat (limited to 'sys-freebsd/freebsd-ubin/files')
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-atf.patch15
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-dtc-gcc46.patch25
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-kdump-ioctl.patch26
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-mandoc.patch13
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.1-kdump-workaround.patch13
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-bsdxml.patch13
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-talk-workaround.patch12
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.3-bmake-workaround.patch13
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-bsdcmp.patch13
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-fixmakefiles.patch35
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-kdump-ioctl.patch28
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-bsdar.patch21
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-xinstall.patch26
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.2-compress.patch55
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.0-fixmakefiles.patch11
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-ar-libarchive3.patch19
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-bsdar.patch25
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-grep.patch17
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-kdump-ioctl.patch24
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-minigzip.patch10
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-lint-stdarg.patch24
-rw-r--r--sys-freebsd/freebsd-ubin/files/freebsd-ubin-setXid.patch129
-rw-r--r--sys-freebsd/freebsd-ubin/files/locate-updatedb-cron6
-rw-r--r--sys-freebsd/freebsd-ubin/files/login.1.pamd4
-rw-r--r--sys-freebsd/freebsd-ubin/files/login.pamd20
-rw-r--r--sys-freebsd/freebsd-ubin/files/passwd.1.pamd9
-rw-r--r--sys-freebsd/freebsd-ubin/files/passwd.pamd11
-rw-r--r--sys-freebsd/freebsd-ubin/files/su.1.pamd17
-rw-r--r--sys-freebsd/freebsd-ubin/files/su.pamd17
29 files changed, 651 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-atf.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-atf.patch
new file mode 100644
index 0000000..d758c48
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-atf.patch
@@ -0,0 +1,15 @@
+diff --git a/usr.bin/atf/atf-sh/Makefile b/usr.bin/atf/atf-sh/Makefile
+index 4ebdc33..37ff8fa 100644
+--- a/usr.bin/atf/atf-sh/Makefile
++++ b/usr.bin/atf/atf-sh/Makefile
+@@ -33,8 +33,8 @@ PROG_CXX= atf-sh
+ SRCS= atf-sh.cpp
+ MAN= atf-sh.1 atf-sh-api.3
+
+-CFLAGS+= -DHAVE_CONFIG_H
+-CFLAGS+= -I${ATF}
++CXXFLAGS+= -DHAVE_CONFIG_H
++CXXFLAGS+= -I${ATF}
+
+ DPADD+= ${LIBATF_C} ${LIBATF_CXX}
+ LDADD+= -latf-c++ -latf-c
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-dtc-gcc46.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-dtc-gcc46.patch
new file mode 100644
index 0000000..1125238
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-dtc-gcc46.patch
@@ -0,0 +1,25 @@
+diff --git a/usr.bin/dtc/string.hh b/usr.bin/dtc/string.hh
+index 45bc4fd..6eaf8e4 100644
+--- a/usr.bin/dtc/string.hh
++++ b/usr.bin/dtc/string.hh
+@@ -32,6 +32,8 @@
+
+ #ifndef _STRING_HH_
+ #define _STRING_HH_
++#include <cstdio>
++#include <cstring>
+ #include "input_buffer.hh"
+
+ namespace dtc
+diff --git a/usr.bin/dtc/util.hh b/usr.bin/dtc/util.hh
+index 7f2ec67..8e13b1c 100644
+--- a/usr.bin/dtc/util.hh
++++ b/usr.bin/dtc/util.hh
+@@ -33,6 +33,7 @@
+ #ifndef _UTIL_HH_
+ #define _UTIL_HH_
+
++#include <stdint.h>
+ #include <vector>
+
+ // If we aren't using C++11, then just ignore static asserts.
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-kdump-ioctl.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-kdump-ioctl.patch
new file mode 100644
index 0000000..e106852
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-kdump-ioctl.patch
@@ -0,0 +1,26 @@
+diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile
+index 38e9df6..5e831c6 100644
+--- a/usr.bin/kdump/Makefile
++++ b/usr.bin/kdump/Makefile
+@@ -22,7 +22,7 @@ CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c
+
+ ioctl.c: mkioctls
+ env MACHINE=${MACHINE} CPP="${CPP}" \
+- sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET}
++ sh ${.CURDIR}/mkioctls print ${.CURDIR}/../../include > ${.TARGET}
+
+ kdump_subr.h: mksubr
+ sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \
+diff --git a/usr.bin/truss/Makefile b/usr.bin/truss/Makefile
+index 7a49497..bc8b61f 100644
+--- a/usr.bin/truss/Makefile
++++ b/usr.bin/truss/Makefile
+@@ -24,7 +24,7 @@ syscalls.h: syscalls.master
+
+ ioctl.c: ${.CURDIR}/../kdump/mkioctls
+ env MACHINE=${MACHINE} CPP="${CPP}" \
+- /bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}/usr/include > ${.TARGET}
++ /bin/sh ${.CURDIR}/../kdump/mkioctls return ${.CURDIR}/../../include > ${.TARGET}
+
+ .if ${MACHINE_CPUARCH} == "i386"
+ SRCS+= i386-linux.c linux_syscalls.h
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-mandoc.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-mandoc.patch
new file mode 100644
index 0000000..c5f7706
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.0-mandoc.patch
@@ -0,0 +1,13 @@
+diff --git a/usr.bin/mandoc/Makefile b/usr.bin/mandoc/Makefile
+index 0995534..1bcb3e0 100644
+--- a/usr.bin/mandoc/Makefile
++++ b/usr.bin/mandoc/Makefile
+@@ -1,7 +1,7 @@
+ # $FreeBSD$
+
+ MDOCMLDIR= ${.CURDIR}/../../contrib/mdocml
+-LIBMANDOC= ${.OBJDIR}/../../lib/libmandoc/libmandoc.a
++LIBMANDOC= ${.CURDIR}/../../lib/libmandoc/libmandoc.a
+ .PATH: ${MDOCMLDIR}
+
+ PROG= mandoc
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.1-kdump-workaround.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.1-kdump-workaround.patch
new file mode 100644
index 0000000..064647c
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.1-kdump-workaround.patch
@@ -0,0 +1,13 @@
+diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile
+index cbf31d0..fa0d04d 100644
+--- a/usr.bin/kdump/Makefile
++++ b/usr.bin/kdump/Makefile
+@@ -8,7 +8,7 @@ SFX= 32
+ .PATH: ${.CURDIR}/../ktrace
+
+ PROG= kdump
+-SRCS= kdump_subr.c kdump.c ioctl.c subr.c
++SRCS= kdump_subr.h kdump_subr.c kdump.c ioctl.c subr.c
+ DPSRCS= kdump_subr.h
+ CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
+
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-bsdxml.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-bsdxml.patch
new file mode 100644
index 0000000..6064717
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-bsdxml.patch
@@ -0,0 +1,13 @@
+diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c
+index af6562b..3121c81 100644
+--- a/usr.bin/mt/mt.c
++++ b/usr.bin/mt/mt.c
+@@ -92,7 +92,7 @@ __FBSDID("$FreeBSD: stable/10/usr.bin/mt/mt.c 280438 2015-03-24 14:36:10Z ken $"
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <errno.h>
+-#include <bsdxml.h>
++#include <expat.h>
+ #include <mtlib.h>
+
+ #include <cam/cam.h>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-talk-workaround.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-talk-workaround.patch
new file mode 100644
index 0000000..3a65b37
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.2-talk-workaround.patch
@@ -0,0 +1,12 @@
+diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c
+index 4daad7a..1fb9105 100644
+--- a/usr.bin/talk/io.c
++++ b/usr.bin/talk/io.c
+@@ -50,6 +50,7 @@ static const char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <wctype.h>
+ #define _XOPEN_SOURCE_EXTENDED
+ #include <curses.h>
+
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.3-bmake-workaround.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.3-bmake-workaround.patch
new file mode 100644
index 0000000..c0ca444
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-10.3-bmake-workaround.patch
@@ -0,0 +1,13 @@
+diff --git a/usr.bin/bmake/Makefile b/usr.bin/bmake/Makefile
+index 6c6d8c2..22fec7a 100644
+--- a/usr.bin/bmake/Makefile
++++ b/usr.bin/bmake/Makefile
+@@ -5,7 +5,7 @@
+
+ .sinclude "Makefile.inc"
+
+-SRCTOP?= ${.CURDIR:H:H}
++SRCTOP= ${.CURDIR:H:H}
+
+ # look here first for config.h
+ CFLAGS+= -I${.CURDIR}
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-bsdcmp.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-bsdcmp.patch
new file mode 100644
index 0000000..1a85529
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-bsdcmp.patch
@@ -0,0 +1,13 @@
+Index: fbsd-6.0/usr.bin/cmp/Makefile
+===================================================================
+--- fbsd-6.0.orig/usr.bin/cmp/Makefile
++++ fbsd-6.0/usr.bin/cmp/Makefile
+@@ -1,7 +1,7 @@
+ # @(#)Makefile 8.1 (Berkeley) 6/6/93
+ # $FreeBSD: src/usr.bin/cmp/Makefile,v 1.6.14.1 2005/09/17 11:33:41 brian Exp $
+
+-PROG= cmp
++PROG= bsdcmp
+ SRCS= cmp.c link.c misc.c regular.c special.c
+
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-fixmakefiles.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-fixmakefiles.patch
new file mode 100644
index 0000000..b135a82
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-fixmakefiles.patch
@@ -0,0 +1,35 @@
+Index: usr.bin/calendar/Makefile
+===================================================================
+--- usr.bin/calendar/Makefile.orig
++++ usr.bin/calendar/Makefile
+@@ -10,6 +10,7 @@ FR_LINKS= fr_FR.ISO8859-15
+ TEXTMODE?= 444
+
+ beforeinstall:
++ ${INSTALL} -d ${DESTDIR}${SHAREDIR}/calendar
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${TEXTMODE} \
+ ${.CURDIR}/calendars/calendar.* ${DESTDIR}${SHAREDIR}/calendar
+ .for lang in ${INTER}
+Index: usr.bin/ee/Makefile
+===================================================================
+--- usr.bin/ee/Makefile.orig
++++ usr.bin/ee/Makefile
+@@ -12,12 +12,12 @@ LDADD= -lncurses
+ NLS= en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \
+ uk_UA.KOI8-U ru_RU.KOI8-R
+
+-NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15
+-NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
+- fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 fr_CH.ISO8859-15 \
+- fr_FR.ISO8859-15
+-NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
+- de_CH.ISO8859-15 de_DE.ISO8859-15
++#NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15
++#NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
++# fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 fr_CH.ISO8859-15 \
++# fr_FR.ISO8859-15
++#NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
++# de_CH.ISO8859-15 de_DE.ISO8859-15
+
+ NLSSRCFILES=ee.msg
+ .for lang in ${NLS}
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-kdump-ioctl.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-kdump-ioctl.patch
new file mode 100644
index 0000000..a89cf52
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-6.0-kdump-ioctl.patch
@@ -0,0 +1,28 @@
+By default the mkioctl program that generates code for kdump does look for
+ioctls in the whole /usr/include tree, but this does break when xorg is merged.
+This patch allows to look for include files only in the source tree.
+
+Index: fbsd-6/usr.bin/kdump/Makefile
+===================================================================
+--- fbsd-6.orig/usr.bin/kdump/Makefile
++++ fbsd-6/usr.bin/kdump/Makefile
+@@ -10,6 +10,6 @@ CFLAGS+= -I${.CURDIR}/../ktrace -I${.CUR
+ CLEANFILES= ioctl.c
+
+ ioctl.c: mkioctls
+- sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
++ sh ${.CURDIR}/mkioctls ${.CURDIR}/../../include > ${.TARGET}
+
+ .include <bsd.prog.mk>
+Index: fbsd-6/usr.bin/truss/Makefile
+===================================================================
+--- fbsd-6.orig/usr.bin/truss/Makefile
++++ fbsd-6/usr.bin/truss/Makefile
+@@ -29,6 +29,6 @@ syscalls.h: syscalls.master
+ ${.CURDIR}/i386.conf
+
+ ioctl.c: ${.CURDIR}/../kdump/mkioctls
+- sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
++ sh ${.CURDIR}/../kdump/mkioctls ${.CURDIR}/../../include > ${.TARGET}
+
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-bsdar.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-bsdar.patch
new file mode 100644
index 0000000..c966b9b
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-bsdar.patch
@@ -0,0 +1,21 @@
+--- usr.bin/ar/Makefile.old 2010-03-12 14:50:30 +0100
++++ usr.bin/ar/Makefile 2010-03-12 14:50:53 +0100
+@@ -1,6 +1,6 @@
+ # $FreeBSD: src/usr.bin/ar/Makefile,v 1.22.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $
+
+-PROG= ar
++PROG= freebsd-ar
+ SRCS= ar.c acplex.l acpyacc.y read.c util.c write.c y.tab.h
+
+ WARNS?= 5
+@@ -10,8 +10,7 @@
+
+ CFLAGS+=-I. -I${.CURDIR}
+
+-NO_SHARED?= yes
+-LINKS= ${BINDIR}/ar ${BINDIR}/ranlib
+-MLINKS= ar.1 ranlib.1
++LINKS= ${BINDIR}/freebsd-ar ${BINDIR}/freebsd-ranlib
++MLINKS= freebsd-ar.1 freebsd-ranlib.1
+
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-xinstall.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-xinstall.patch
new file mode 100644
index 0000000..e8f978a
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.0-xinstall.patch
@@ -0,0 +1,26 @@
+Parallel make installs often cause 2 concurrent install -d to fail
+while they are creating the path to the target dirs.
+This patch changes the failure to a warning so that a make -j6 install doesn't
+fails as often as it does on Gentoo/FreeBSD, if it uses /usr/bin/install.
+
+--- usr.bin/xinstall/xinstall.c.orig
++++ usr.bin/xinstall/xinstall.c
+@@ -748,9 +748,17 @@
+ ch = *p;
+ *p = '\0';
+ if (stat(path, &sb)) {
+- if (errno != ENOENT || mkdir(path, 0755) < 0) {
++ if (errno != ENOENT) {
+ err(EX_OSERR, "mkdir %s", path);
+ /* NOTREACHED */
++ } else if (mkdir(path, 0755) < 0) {
++ /* Previous errno from stat() says that the directory didn't exist (ENOENT)
++ * But if errno is now EEXIST, then we just hit a parallel make bug.
++ */
++ if (errno == EEXIST)
++ warn("mkdir: %s now exists!", path); /* let me know when this happens */
++ else
++ err(EX_OSERR, "mkdir %s", path);
+ } else if (verbose)
+ (void)printf("install: mkdir %s\n",
+ path);
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.2-compress.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.2-compress.patch
new file mode 100644
index 0000000..5bd1d55
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-8.2-compress.patch
@@ -0,0 +1,55 @@
+Index: usr.bin/compress/zopen.c
+===================================================================
+--- usr.bin/compress/zopen.c (revision 225020)
++++ usr.bin/compress/zopen.c (working copy)
+@@ -486,7 +486,7 @@ zread(void *cookie, char *rbp, int num)
+ block_compress = maxbits & BLOCK_MASK;
+ maxbits &= BIT_MASK;
+ maxmaxcode = 1L << maxbits;
+- if (maxbits > BITS) {
++ if (maxbits > BITS || maxbits < 12) {
+ errno = EFTYPE;
+ return (-1);
+ }
+@@ -513,17 +513,28 @@ zread(void *cookie, char *rbp, int num)
+ for (code = 255; code >= 0; code--)
+ tab_prefixof(code) = 0;
+ clear_flg = 1;
+- free_ent = FIRST - 1;
+- if ((code = getcode(zs)) == -1) /* O, untimely death! */
+- break;
++ free_ent = FIRST;
++ oldcode = -1;
++ continue;
+ }
+ incode = code;
+
+- /* Special case for KwKwK string. */
++ /* Special case for kWkWk string. */
+ if (code >= free_ent) {
++ if (code > free_ent || oldcode == -1) {
++ /* Bad stream. */
++ errno = EINVAL;
++ return (-1);
++ }
+ *stackp++ = finchar;
+ code = oldcode;
+ }
++ /*
++ * The above condition ensures that code < free_ent.
++ * The construction of tab_prefixof in turn guarantees that
++ * each iteration decreases code and therefore stack usage is
++ * bound by 1 << BITS - 256.
++ */
+
+ /* Generate output characters in reverse order. */
+ while (code >= 256) {
+@@ -540,7 +551,7 @@ middle: do {
+ } while (stackp > de_stack);
+
+ /* Generate the new entry. */
+- if ((code = free_ent) < maxmaxcode) {
++ if ((code = free_ent) < maxmaxcode && oldcode != -1) {
+ tab_prefixof(code) = (u_short) oldcode;
+ tab_suffixof(code) = finchar;
+ free_ent = code + 1;
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.0-fixmakefiles.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.0-fixmakefiles.patch
new file mode 100644
index 0000000..d34eb9e
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.0-fixmakefiles.patch
@@ -0,0 +1,11 @@
+diff -uNr usr.bin.old/calendar/Makefile usr.bin/calendar/Makefile
+--- usr.bin.old/calendar/Makefile 2011-11-02 18:22:09.000000000 +0000
++++ usr.bin/calendar/Makefile 2011-11-02 18:22:48.000000000 +0000
+@@ -15,6 +15,7 @@
+ WARNS?= 7
+
+ beforeinstall:
++ ${INSTALL} -d ${DESTDIR}${SHAREDIR}/calendar
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${TEXTMODE} \
+ ${.CURDIR}/calendars/calendar.* ${DESTDIR}${SHAREDIR}/calendar
+ .for lang in ${INTER}
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-ar-libarchive3.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-ar-libarchive3.patch
new file mode 100644
index 0000000..d4d89e1
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-ar-libarchive3.patch
@@ -0,0 +1,19 @@
+diff -Nur usr.bin.orig/ar/ar.c usr.bin/ar/ar.c
+--- usr.bin.orig/ar/ar.c 2012-01-03 12:23:45.000000000 +0900
++++ usr.bin/ar/ar.c 2012-12-25 20:50:29.000000000 +0900
+@@ -386,13 +386,13 @@
+ static void
+ bsdar_version(void)
+ {
+- (void)printf("BSD ar %s - %s\n", BSDAR_VERSION, archive_version());
++ (void)printf("BSD ar %s - %s\n", BSDAR_VERSION, archive_version_string());
+ exit(EX_OK);
+ }
+
+ static void
+ ranlib_version(void)
+ {
+- (void)printf("ranlib %s - %s\n", BSDAR_VERSION, archive_version());
++ (void)printf("ranlib %s - %s\n", BSDAR_VERSION, archive_version_string());
+ exit(EX_OK);
+ }
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-bsdar.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-bsdar.patch
new file mode 100644
index 0000000..a65185f
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-bsdar.patch
@@ -0,0 +1,25 @@
+diff -Nur work.orig/usr.bin/ar/Makefile work/usr.bin/ar/Makefile
+--- work.orig/usr.bin/ar/Makefile 2012-07-16 03:59:48.000000000 +0900
++++ work/usr.bin/ar/Makefile 2012-07-16 04:02:38.000000000 +0900
+@@ -2,7 +2,7 @@
+
+ .include <bsd.own.mk>
+
+-PROG= ar
++PROG= freebsd-ar
+ SRCS= ar.c acplex.l acpyacc.y read.c util.c write.c y.tab.h
+
+ DPADD= ${LIBARCHIVE} ${LIBELF}
+@@ -10,10 +10,7 @@
+
+ CFLAGS+=-I. -I${.CURDIR}
+
+-.if ${MK_SHARED_TOOLCHAIN} == "no"
+-NO_SHARED?= yes
+-.endif
+-LINKS= ${BINDIR}/ar ${BINDIR}/ranlib
+-MLINKS= ar.1 ranlib.1
++LINKS= ${BINDIR}/freebsd-ar ${BINDIR}/freebsd-ranlib
++MLINKS= freebsd-ar.1 freebsd-ranlib.1
+
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-grep.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-grep.patch
new file mode 100644
index 0000000..06cc5d2
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-grep.patch
@@ -0,0 +1,17 @@
+diff -Nur work.orig/usr.bin/grep/Makefile work/usr.bin/grep/Makefile
+--- work.orig/usr.bin/grep/Makefile 2012-07-16 04:59:01.000000000 +0900
++++ work/usr.bin/grep/Makefile 2012-07-16 05:00:15.000000000 +0900
+@@ -40,13 +40,6 @@
+ grep.1 lzfgrep.1
+ .endif
+
+-LINKS+= ${BINDIR}/${PROG} ${BINDIR}/xzgrep \
+- ${BINDIR}/${PROG} ${BINDIR}/xzegrep \
+- ${BINDIR}/${PROG} ${BINDIR}/xzfgrep \
+- ${BINDIR}/${PROG} ${BINDIR}/lzgrep \
+- ${BINDIR}/${PROG} ${BINDIR}/lzegrep \
+- ${BINDIR}/${PROG} ${BINDIR}/lzfgrep
+-
+ LDADD= -lz -llzma
+ DPADD= ${LIBZ} ${LIBLZMA}
+
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-kdump-ioctl.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-kdump-ioctl.patch
new file mode 100644
index 0000000..d98e599
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-kdump-ioctl.patch
@@ -0,0 +1,24 @@
+diff -Nur work.orig/usr.bin/kdump/Makefile work/usr.bin/kdump/Makefile
+--- work.orig/usr.bin/kdump/Makefile 2012-07-12 13:24:01.000000000 +0900
++++ work/usr.bin/kdump/Makefile 2012-07-16 03:54:14.000000000 +0900
+@@ -21,7 +21,7 @@
+
+ ioctl.c: mkioctls
+ env CPP="${CPP}" \
+- sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
++ sh ${.CURDIR}/mkioctls ${.CURDIR}/../../include > ${.TARGET}
+
+ kdump_subr.c: mksubr
+ sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET}
+diff -Nur work.orig/usr.bin/truss/Makefile work/usr.bin/truss/Makefile
+--- work.orig/usr.bin/truss/Makefile 2012-07-12 13:24:03.000000000 +0900
++++ work/usr.bin/truss/Makefile 2012-07-16 03:54:40.000000000 +0900
+@@ -24,7 +24,7 @@
+
+ ioctl.c: ${.CURDIR}/../kdump/mkioctls
+ env CPP="${CPP}" \
+- sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
++ sh ${.CURDIR}/../kdump/mkioctls ${.CURDIR}/../../include > ${.TARGET}
+
+ .if ${MACHINE_CPUARCH} == "i386"
+ SRCS+= i386-linux.c linux_syscalls.h
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-minigzip.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-minigzip.patch
new file mode 100644
index 0000000..a9c0622
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-9.1-minigzip.patch
@@ -0,0 +1,10 @@
+diff -Nur work.orig/usr.bin/minigzip/Makefile work/usr.bin/minigzip/Makefile
+--- work.orig/usr.bin/minigzip/Makefile 2012-07-16 04:39:31.000000000 +0900
++++ work/usr.bin/minigzip/Makefile 2012-07-16 04:45:30.000000000 +0900
+@@ -10,4 +10,6 @@
+ DPADD= ${LIBZ}
+ LDADD= -lz
+
++CFLAGS+= -I${.CURDIR}/../../lib/libz
++
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-lint-stdarg.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-lint-stdarg.patch
new file mode 100644
index 0000000..9774724
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-lint-stdarg.patch
@@ -0,0 +1,24 @@
+diff -ur usr.bin.orig/xlint/llib/llib-lposix usr.bin/xlint/llib/llib-lposix
+--- usr.bin.orig/xlint/llib/llib-lposix 2005-04-29 17:30:03 +0000
++++ usr.bin/xlint/llib/llib-lposix 2005-05-03 14:12:26 +0000
+@@ -42,7 +42,7 @@
+ #include <sys/utsname.h>
+ #include <sys/times.h>
+ #include <stdio.h>
+-#include <stdarg.h>
++#include <machine/stdarg.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <math.h>
+diff -ur usr.bin.orig/xlint/llib/llib-lstdc usr.bin/xlint/llib/llib-lstdc
+--- usr.bin.orig/xlint/llib/llib-lstdc 2005-04-29 17:30:03 +0000
++++ usr.bin/xlint/llib/llib-lstdc 2005-05-03 14:12:35 +0000
+@@ -44,7 +44,7 @@
+ #include <math.h>
+ #include <setjmp.h>
+ #include <signal.h>
+-#include <stdarg.h>
++#include <machine/stdarg.h>
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/sys-freebsd/freebsd-ubin/files/freebsd-ubin-setXid.patch b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-setXid.patch
new file mode 100644
index 0000000..631ee4f
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/freebsd-ubin-setXid.patch
@@ -0,0 +1,129 @@
+diff -ur usr.bin.orig/at/Makefile usr.bin.setXid/at/Makefile
+--- usr.bin.orig/at/Makefile Thu Apr 7 20:52:57 2005
++++ usr.bin.setXid/at/Makefile Thu Apr 7 21:21:02 2005
+@@ -15,6 +15,8 @@
+ BINMODE= 4555
+ CLEANFILES+= at.1
+
++LDFLAGS+=-Wl,-z,now
++
+ at.1: at.man
+ @${ECHO} Making ${.TARGET:T} from ${.ALLSRC:T}; \
+ sed -e \
+diff -ur usr.bin.orig/chpass/Makefile usr.bin.setXid/chpass/Makefile
+--- usr.bin.orig/chpass/Makefile Thu Apr 7 20:52:57 2005
++++ usr.bin.setXid/chpass/Makefile Thu Apr 7 21:22:40 2005
+@@ -15,6 +15,8 @@
+ #CFLAGS+=-DRESTRICT_FULLNAME_CHANGE
+ CFLAGS+=-I${.CURDIR}/../../usr.sbin/pwd_mkdb -I${.CURDIR}/../../lib/libc/gen -I.
+
++LDFLAGS+=-Wl,-z,now
++
+ DPADD= ${LIBCRYPT} ${LIBUTIL}
+ LDADD= -lcrypt -lutil
+ .if !defined(NO_NIS)
+diff -ur usr.bin.orig/fstat/Makefile usr.bin.setXid/fstat/Makefile
+--- usr.bin.orig/fstat/Makefile Thu Apr 7 20:52:57 2005
++++ usr.bin.setXid/fstat/Makefile Thu Apr 7 21:24:35 2005
+@@ -9,4 +9,6 @@
+ BINMODE=2555
+ WARNS?= 6
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur usr.bin.orig/lock/Makefile usr.bin.setXid/lock/Makefile
+--- usr.bin.orig/lock/Makefile Thu Apr 7 20:52:57 2005
++++ usr.bin.setXid/lock/Makefile Thu Apr 7 21:24:45 2005
+@@ -7,4 +7,6 @@
+ DPADD= ${LIBCRYPT}
+ LDADD= -lcrypt
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur usr.bin.orig/login/Makefile usr.bin.setXid/login/Makefile
+--- usr.bin.orig/login/Makefile Thu Apr 7 20:52:57 2005
++++ usr.bin.setXid/login/Makefile Thu Apr 7 21:24:55 2005
+@@ -13,4 +13,6 @@
+ INSTALLFLAGS=-fschg
+ .endif
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur usr.bin.orig/netstat/Makefile usr.bin.setXid/netstat/Makefile
+--- usr.bin.orig/netstat/Makefile Thu Apr 7 20:52:58 2005
++++ usr.bin.setXid/netstat/Makefile Thu Apr 7 21:25:08 2005
+@@ -14,4 +14,6 @@
+ DPADD= ${LIBKVM} ${LIBIPX} ${LIBNETGRAPH} ${LIBUTIL}
+ LDADD= -lkvm -lipx -lnetgraph -lutil
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur usr.bin.orig/opieinfo/Makefile usr.bin.setXid/opieinfo/Makefile
+--- usr.bin.orig/opieinfo/Makefile Thu Apr 7 20:52:58 2005
++++ usr.bin.setXid/opieinfo/Makefile Thu Apr 7 21:25:20 2005
+@@ -11,6 +11,8 @@
+ DPADD= ${LIBOPIE} ${LIBMD}
+ LDADD= -lopie -lmd
+
++LDFLAGS+=-Wl,-z,now
++
+ BINOWN= root
+ BINMODE=4555
+ INSTALLFLAGS=-fschg
+diff -ur usr.bin.orig/opiepasswd/Makefile usr.bin.setXid/opiepasswd/Makefile
+--- usr.bin.orig/opiepasswd/Makefile Thu Apr 7 20:52:58 2005
++++ usr.bin.setXid/opiepasswd/Makefile Thu Apr 7 21:25:29 2005
+@@ -11,6 +11,8 @@
+ DPADD= ${LIBOPIE} ${LIBMD}
+ LDADD= -lopie -lmd
+
++LDFLAGS+=-Wl,-z,now
++
+ BINOWN= root
+ BINMODE=4555
+ INSTALLFLAGS=-fschg
+diff -ur usr.bin.orig/passwd/Makefile usr.bin.setXid/passwd/Makefile
+--- usr.bin.orig/passwd/Makefile Thu Apr 7 20:52:58 2005
++++ usr.bin.setXid/passwd/Makefile Thu Apr 7 21:25:37 2005
+@@ -10,6 +10,8 @@
+ MLINKS = passwd.1 yppasswd.1
+ WARNS ?= 4
+
++LDFLAGS+=-Wl,-z,now
++
+ beforeinstall:
+ .for i in passwd yppasswd
+ [ ! -e ${DESTDIR}${BINDIR}/$i ] || \
+--- usr.bin.orig/su/Makefile Thu Apr 7 20:52:58 2005
++++ usr.bin.setXid/su/Makefile Thu Apr 7 21:26:00 2005
+@@ -10,4 +10,6 @@
+ BINMODE=4555
+ INSTALLFLAGS=-fschg
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur usr.bin.orig/wall/Makefile usr.bin.setXid/wall/Makefile
+--- usr.bin.orig/wall/Makefile Thu Apr 7 20:52:59 2005
++++ usr.bin.setXid/wall/Makefile Thu Apr 7 21:26:07 2005
+@@ -5,4 +5,6 @@
+ BINGRP= tty
+ BINMODE=2555
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur usr.bin.orig/write/Makefile usr.bin.setXid/write/Makefile
+--- usr.bin.orig/write/Makefile Thu Apr 7 20:52:59 2005
++++ usr.bin.setXid/write/Makefile Thu Apr 7 21:26:13 2005
+@@ -4,4 +4,6 @@
+ BINMODE=2555
+ BINGRP= tty
+
++LDFLAGS+=-Wl,-z,now
++
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-ubin/files/locate-updatedb-cron b/sys-freebsd/freebsd-ubin/files/locate-updatedb-cron
new file mode 100644
index 0000000..323f455
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/locate-updatedb-cron
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+if [ -x /usr/libexec/locate.updatedb ]
+then
+ echo /usr/libexec/locate.updatedb | nice -n 5 su -fm nobody
+fi
diff --git a/sys-freebsd/freebsd-ubin/files/login.1.pamd b/sys-freebsd/freebsd-ubin/files/login.1.pamd
new file mode 100644
index 0000000..2c09584
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/login.1.pamd
@@ -0,0 +1,4 @@
+auth include system-local-login
+account include system-local-login
+session include system-local-login
+password include system-local-login
diff --git a/sys-freebsd/freebsd-ubin/files/login.pamd b/sys-freebsd/freebsd-ubin/files/login.pamd
new file mode 100644
index 0000000..db1c74f
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/login.pamd
@@ -0,0 +1,20 @@
+#
+# $Id$
+#
+# PAM configuration for the "login" service
+#
+
+# auth
+auth required pam_nologin.so no_warn
+auth sufficient pam_self.so no_warn
+auth include system
+
+# account
+account requisite pam_securetty.so
+account include system
+
+# session
+session include system
+
+# password
+password include system
diff --git a/sys-freebsd/freebsd-ubin/files/passwd.1.pamd b/sys-freebsd/freebsd-ubin/files/passwd.1.pamd
new file mode 100644
index 0000000..bab2eea
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/passwd.1.pamd
@@ -0,0 +1,9 @@
+#
+# $Id$
+#
+# PAM configuration for the "passwd" service
+#
+
+# passwd(1) does not use the auth, account or session services.
+
+password include system-auth
diff --git a/sys-freebsd/freebsd-ubin/files/passwd.pamd b/sys-freebsd/freebsd-ubin/files/passwd.pamd
new file mode 100644
index 0000000..44b7e71
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/passwd.pamd
@@ -0,0 +1,11 @@
+#
+# $Id$
+#
+# PAM configuration for the "passwd" service
+#
+
+# passwd(1) does not use the auth, account or session services.
+
+# password
+#password requisite pam_passwdqc.so enforce=users
+password required pam_unix.so no_warn try_first_pass nullok
diff --git a/sys-freebsd/freebsd-ubin/files/su.1.pamd b/sys-freebsd/freebsd-ubin/files/su.1.pamd
new file mode 100644
index 0000000..72e2bd1
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/su.1.pamd
@@ -0,0 +1,17 @@
+#
+# $Id$
+#
+# PAM configuration for the "su" service
+#
+
+# auth
+auth sufficient pam_rootok.so no_warn
+auth sufficient pam_self.so no_warn
+auth requisite pam_group.so no_warn group=wheel root_only fail_safe
+auth include system-auth
+
+# account
+account include system-auth
+
+# session
+session required pam_permit.so
diff --git a/sys-freebsd/freebsd-ubin/files/su.pamd b/sys-freebsd/freebsd-ubin/files/su.pamd
new file mode 100644
index 0000000..57019c5
--- /dev/null
+++ b/sys-freebsd/freebsd-ubin/files/su.pamd
@@ -0,0 +1,17 @@
+#
+# $Id$
+#
+# PAM configuration for the "su" service
+#
+
+# auth
+auth sufficient pam_rootok.so no_warn
+auth sufficient pam_self.so no_warn
+auth requisite pam_group.so no_warn group=wheel root_only fail_safe
+auth include system
+
+# account
+account include system
+
+# session
+session required pam_permit.so