aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2013-09-11 18:16:18 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2013-09-11 18:16:18 +0000
commitd466a5b069a40c37cec11dfd03fd46b30c4c9587 (patch)
treea3620d99f472deaa7f019c4324bb8f4e38ac4272 /lib
parentd1d015864103b253b3fcb2f72a0da5b0cfeb31b6 (diff)
parent64c5de5483d0895b673ba6506d204762b8b11a60 (diff)
downloadsrc-d466a5b069a40c37cec11dfd03fd46b30c4c9587.tar.gz
src-d466a5b069a40c37cec11dfd03fd46b30c4c9587.zip
Merge head
Notes
Notes: svn path=/projects/bmake/; revision=255477
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/arm/_fpmath.h2
-rw-r--r--lib/libc/arm/arith.h2
-rw-r--r--lib/libc/arm/softfloat/arm-gcc.h2
-rw-r--r--lib/libc/iconv/citrus_iconv_local.h1
-rw-r--r--lib/libc/net/getaddrinfo.c12
-rw-r--r--lib/libc/net/if_nametoindex.c2
-rw-r--r--lib/libc/net/name6.c5
-rw-r--r--lib/libc/net/nscachedcli.c2
-rw-r--r--lib/libc/resolv/res_send.c5
-rw-r--r--lib/libc/stdio/flags.c55
-rw-r--r--lib/libc/sys/mmap.215
-rw-r--r--lib/libc/sys/sigaction.252
-rw-r--r--lib/libc/sys/sigpending.24
-rw-r--r--lib/libc/sys/sigreturn.26
-rw-r--r--lib/libc/sys/sigwait.24
-rw-r--r--lib/libc/sys/wait.222
-rw-r--r--lib/libiconv_modules/Makefile.inc3
-rw-r--r--lib/libldns/Makefile5
-rw-r--r--lib/libpam/libpam/Makefile9
-rw-r--r--lib/libpam/modules/pam_ssh/Makefile1
-rw-r--r--lib/msun/Makefile1
-rw-r--r--lib/msun/Symbol.map9
-rw-r--r--lib/msun/src/imprecise.c69
-rw-r--r--lib/msun/src/math_private.h2
24 files changed, 215 insertions, 75 deletions
diff --git a/lib/libc/arm/_fpmath.h b/lib/libc/arm/_fpmath.h
index 4c189459770c..28bcb4b4ffde 100644
--- a/lib/libc/arm/_fpmath.h
+++ b/lib/libc/arm/_fpmath.h
@@ -26,7 +26,7 @@
* $FreeBSD$
*/
-#if defined(__VFP_FP__)
+#if defined(__VFP_FP__) || defined(__ARM_EABI__)
#define _IEEE_WORD_ORDER _BYTE_ORDER
#else
#define _IEEE_WORD_ORDER _BIG_ENDIAN
diff --git a/lib/libc/arm/arith.h b/lib/libc/arm/arith.h
index be78d862756d..5e2e3891dd91 100644
--- a/lib/libc/arm/arith.h
+++ b/lib/libc/arm/arith.h
@@ -11,7 +11,7 @@
* architecture. See contrib/gdtoa/gdtoaimp.h for details.
*/
-#if !defined(__ARMEB__) && defined(__VFP_FP__)
+#if !defined(__ARMEB__) && (defined(__VFP_FP__) || defined(__ARM_EABI__))
#define IEEE_8087
#define Arith_Kind_ASL 1
#define Sudden_Underflow
diff --git a/lib/libc/arm/softfloat/arm-gcc.h b/lib/libc/arm/softfloat/arm-gcc.h
index 15bc509fbcb3..0e20ef91f059 100644
--- a/lib/libc/arm/softfloat/arm-gcc.h
+++ b/lib/libc/arm/softfloat/arm-gcc.h
@@ -91,7 +91,7 @@ what the endianness of the CPU. VFP is sane.
-------------------------------------------------------------------------------
*/
#if defined(SOFTFLOAT_FOR_GCC)
-#if defined(__VFP_FP__) || defined(__ARMEB__)
+#if defined (__ARM_EABI__) || defined(__VFP_FP__) || defined(__ARMEB__)
#define FLOAT64_DEMANGLE(a) (a)
#define FLOAT64_MANGLE(a) (a)
#else
diff --git a/lib/libc/iconv/citrus_iconv_local.h b/lib/libc/iconv/citrus_iconv_local.h
index 52ac8251cd24..e673c9a6afa1 100644
--- a/lib/libc/iconv/citrus_iconv_local.h
+++ b/lib/libc/iconv/citrus_iconv_local.h
@@ -31,6 +31,7 @@
#define _CITRUS_ICONV_LOCAL_H_
#include <iconv.h>
+#include <stdbool.h>
#define _CITRUS_ICONV_GETOPS_FUNC_BASE(_n_) \
int _n_(struct _citrus_iconv_ops *)
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index c6af6d8f6435..495ebc1ed6d8 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -831,7 +831,8 @@ set_source(struct ai_order *aio, struct policyhead *ph)
get_port(&ai, "1", 0);
/* open a socket to get the source address for the given dst */
- if ((s = _socket(ai.ai_family, ai.ai_socktype, ai.ai_protocol)) < 0)
+ if ((s = _socket(ai.ai_family, ai.ai_socktype | SOCK_CLOEXEC,
+ ai.ai_protocol)) < 0)
return; /* give up */
if (_connect(s, ai.ai_addr, ai.ai_addrlen) < 0)
goto cleanup;
@@ -1131,7 +1132,7 @@ explore_null(const struct addrinfo *pai, const char *servname,
* filter out AFs that are not supported by the kernel
* XXX errno?
*/
- s = _socket(pai->ai_family, SOCK_DGRAM, 0);
+ s = _socket(pai->ai_family, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (s < 0) {
if (errno != EMFILE)
return 0;
@@ -1541,18 +1542,19 @@ addrconfig(struct addrinfo *pai)
*/
af = pai->ai_family;
if (af == AF_UNSPEC) {
- if ((s = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+ if ((s = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
af = AF_INET;
else {
_close(s);
- if ((s = _socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ if ((s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC,
+ 0)) < 0)
af = AF_INET6;
else
_close(s);
}
}
if (af != AF_UNSPEC) {
- if ((s = _socket(af, SOCK_DGRAM, 0)) < 0)
+ if ((s = _socket(af, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
return 0;
_close(s);
}
diff --git a/lib/libc/net/if_nametoindex.c b/lib/libc/net/if_nametoindex.c
index 89076c0e021c..8f04921760eb 100644
--- a/lib/libc/net/if_nametoindex.c
+++ b/lib/libc/net/if_nametoindex.c
@@ -68,7 +68,7 @@ if_nametoindex(const char *ifname)
struct ifaddrs *ifaddrs, *ifa;
unsigned int ni;
- s = _socket(AF_INET, SOCK_DGRAM, 0);
+ s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (s != -1) {
#ifdef PURIFY
memset(&ifr, 0, sizeof(ifr));
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index 118e033e128d..97880a25e7d8 100644
--- a/lib/libc/net/name6.c
+++ b/lib/libc/net/name6.c
@@ -235,7 +235,7 @@ getipnodebyname(const char *name, int af, int flags, int *errp)
if (flags & AI_ADDRCONFIG) {
int s;
- if ((s = _socket(af, SOCK_DGRAM, 0)) < 0)
+ if ((s = _socket(af, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
return NULL;
/*
* TODO:
@@ -868,7 +868,8 @@ set_source(struct hp_order *aio, struct policyhead *ph)
}
/* open a socket to get the source address for the given dst */
- if ((s = _socket(ss.ss_family, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ if ((s = _socket(ss.ss_family, SOCK_DGRAM | SOCK_CLOEXEC,
+ IPPROTO_UDP)) < 0)
return; /* give up */
if (_connect(s, (struct sockaddr *)&ss, ss.ss_len) < 0)
goto cleanup;
diff --git a/lib/libc/net/nscachedcli.c b/lib/libc/net/nscachedcli.c
index b4de0c152dd0..2ceacb7e9b0b 100644
--- a/lib/libc/net/nscachedcli.c
+++ b/lib/libc/net/nscachedcli.c
@@ -200,7 +200,7 @@ __open_cached_connection(struct cached_connection_params const *params)
assert(params != NULL);
- client_socket = _socket(PF_LOCAL, SOCK_STREAM, 0);
+ client_socket = _socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
client_address.sun_family = PF_LOCAL;
strncpy(client_address.sun_path, params->socket_path,
sizeof(client_address.sun_path));
diff --git a/lib/libc/resolv/res_send.c b/lib/libc/resolv/res_send.c
index 716ae32f6a19..4896fe8cb36d 100644
--- a/lib/libc/resolv/res_send.c
+++ b/lib/libc/resolv/res_send.c
@@ -660,7 +660,8 @@ send_vc(res_state statp,
if (statp->_vcsock >= 0)
res_nclose(statp);
- statp->_vcsock = _socket(nsap->sa_family, SOCK_STREAM, 0);
+ statp->_vcsock = _socket(nsap->sa_family, SOCK_STREAM |
+ SOCK_CLOEXEC, 0);
#if !defined(USE_POLL) && !defined(USE_KQUEUE)
if (statp->_vcsock > highestFD) {
res_nclose(statp);
@@ -851,7 +852,7 @@ send_dg(res_state statp,
nsaplen = get_salen(nsap);
if (EXT(statp).nssocks[ns] == -1) {
EXT(statp).nssocks[ns] = _socket(nsap->sa_family,
- SOCK_DGRAM, 0);
+ SOCK_DGRAM | SOCK_CLOEXEC, 0);
#if !defined(USE_POLL) && !defined(USE_KQUEUE)
if (EXT(statp).nssocks[ns] > highestFD) {
res_nclose(statp);
diff --git a/lib/libc/stdio/flags.c b/lib/libc/stdio/flags.c
index 1878c2f4e134..b7552a43804c 100644
--- a/lib/libc/stdio/flags.c
+++ b/lib/libc/stdio/flags.c
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
int
__sflags(const char *mode, int *optr)
{
- int ret, m, o;
+ int ret, m, o, known;
switch (*mode++) {
@@ -78,34 +78,35 @@ __sflags(const char *mode, int *optr)
return (0);
}
- /* 'b' (binary) is ignored */
- if (*mode == 'b')
- mode++;
-
- /* [rwa][b]\+ means read and write */
- if (*mode == '+') {
- mode++;
- ret = __SRW;
- m = O_RDWR;
- }
-
- /* 'b' (binary) can appear here, too -- and is ignored again */
- if (*mode == 'b')
- mode++;
-
- /* 'x' means exclusive (fail if the file exists) */
- if (*mode == 'x') {
- mode++;
- if (m == O_RDONLY) {
- errno = EINVAL;
- return (0);
+ do {
+ known = 1;
+ switch (*mode++) {
+ case 'b':
+ /* 'b' (binary) is ignored */
+ break;
+ case '+':
+ /* [rwa][b]\+ means read and write */
+ ret = __SRW;
+ m = O_RDWR;
+ break;
+ case 'x':
+ /* 'x' means exclusive (fail if the file exists) */
+ o |= O_EXCL;
+ break;
+ case 'e':
+ /* set close-on-exec */
+ o |= O_CLOEXEC;
+ break;
+ default:
+ known = 0;
+ break;
}
- o |= O_EXCL;
- }
+ } while (known);
- /* set close-on-exec */
- if (*mode == 'e')
- o |= O_CLOEXEC;
+ if ((o & O_EXCL) != 0 && m == O_RDONLY) {
+ errno = EINVAL;
+ return (0);
+ }
*optr = m | o;
return (ret);
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index 130f70bcaa88..01cde0ee5fe9 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -28,7 +28,7 @@
.\" @(#)mmap.2 8.4 (Berkeley) 5/11/95
.\" $FreeBSD$
.\"
-.Dd August 16, 2013
+.Dd September 9, 2013
.Dt MMAP 2
.Os
.Sh NAME
@@ -98,6 +98,12 @@ argument by
.Em or Ns 'ing
the following values:
.Bl -tag -width MAP_PREFAULT_READ
+.It Dv MAP_32BIT
+Request a region in the first 2GB of the current process's address space.
+If a suitable region cannot be found,
+.Fn mmap
+will fail.
+This flag is only available on 64-bit platforms.
.It Dv MAP_ALIGNED Ns Pq Fa n
Align the region on a requested boundary.
If a suitable region cannot be found,
@@ -362,6 +368,13 @@ was specified and the
argument was not page aligned, or part of the desired address space
resides out of the valid address space for a user process.
.It Bq Er EINVAL
+Both
+.Dv MAP_FIXED
+and
+.Dv MAP_32BIT
+were specified and part of the desired address space resides outside
+of the first 2GB of user address space.
+.It Bq Er EINVAL
The
.Fa len
argument
diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2
index d975ef931653..5c784f64475d 100644
--- a/lib/libc/sys/sigaction.2
+++ b/lib/libc/sys/sigaction.2
@@ -28,7 +28,7 @@
.\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94
.\" $FreeBSD$
.\"
-.Dd June 8, 2013
+.Dd September 6, 2013
.Dt SIGACTION 2
.Os
.Sh NAME
@@ -55,7 +55,7 @@ struct sigaction {
.Sh DESCRIPTION
The system defines a set of signals that may be delivered to a process.
Signal delivery resembles the occurrence of a hardware interrupt:
-the signal is normally blocked from further occurrence, the current process
+the signal is normally blocked from further occurrence, the current thread
context is saved, and a new one is built.
A process may specify a
.Em handler
@@ -64,13 +64,14 @@ to which a signal is delivered, or specify that a signal is to be
A process may also specify that a default action is to be taken
by the system when a signal occurs.
A signal may also be
-.Em blocked ,
-in which case its delivery is postponed until it is
+.Em blocked
+for a thread,
+in which case it will not be delivered to that thread until it is
.Em unblocked .
The action to be taken on delivery is determined at the time
of delivery.
Normally, signal handlers execute on the current stack
-of the process.
+of the thread.
This may be changed, on a per-handler basis,
so that signals are taken on a special
.Em "signal stack" .
@@ -82,20 +83,30 @@ but other signals may yet occur.
A global
.Em "signal mask"
defines the set of signals currently blocked from delivery
-to a process.
-The signal mask for a process is initialized
+to a thread.
+The signal mask for a thread is initialized
from that of its parent (normally empty).
It may be changed with a
.Xr sigprocmask 2
-call, or when a signal is delivered to the process.
+or
+.Xr pthread_sigmask 3
+call, or when a signal is delivered to the thread.
.Pp
When a signal
-condition arises for a process, the signal is added to a set of
-signals pending for the process.
-If the signal is not currently
+condition arises for a process or thread, the signal is added to a set of
+signals pending for the process or thread.
+Whether the signal is directed at the process in general or at a specific
+thread depends on how it is generated.
+For signals directed at a specific thread,
+if the signal is not currently
.Em blocked
-by the process then it is delivered to the process.
-Signals may be delivered any time a process enters the operating system
+by the thread then it is delivered to the thread.
+For signals directed at the process,
+if the signal is not currently
+.Em blocked
+by all threads then it is delivered to one thread that does not have it blocked
+(the selection of which is unspecified).
+Signals may be delivered any time a thread enters the operating system
(e.g., during a system call, page fault or trap, or clock interrupt).
If multiple signals are ready to be delivered at the same time,
any signals that could be caused by traps are delivered first.
@@ -106,17 +117,17 @@ The set of pending signals is returned by the
.Xr sigpending 2
system call.
When a caught signal
-is delivered, the current state of the process is saved,
+is delivered, the current state of the thread is saved,
a new signal mask is calculated (as described below),
and the signal handler is invoked.
The call to the handler
is arranged so that if the signal handling routine returns
-normally the process will resume execution in the context
+normally the thread will resume execution in the context
from before the signal's delivery.
-If the process wishes to resume in a different context, then it
+If the thread wishes to resume in a different context, then it
must arrange to restore the previous context itself.
.Pp
-When a signal is delivered to a process a new signal mask is
+When a signal is delivered to a thread a new signal mask is
installed for the duration of the process' signal handler
(or until a
.Xr sigprocmask 2
@@ -218,7 +229,7 @@ to
If this bit is set, the system will deliver the signal to the process
on a
.Em "signal stack" ,
-specified with
+specified by each thread with
.Xr sigaltstack 2 .
.It Dv SA_NODEFER
If this bit is set, further occurrences of the delivered signal are
@@ -272,6 +283,11 @@ However, calls that have already committed are not restarted,
but instead return a partial success (for example, a short read count).
.Pp
After a
+.Xr pthread_create 3
+the signal mask is inherited by the new thread and
+the set of pending signals and the signal stack for the new thread are empty.
+.Pp
+After a
.Xr fork 2
or
.Xr vfork 2
diff --git a/lib/libc/sys/sigpending.2 b/lib/libc/sys/sigpending.2
index 37f92d89d155..06ecc004501d 100644
--- a/lib/libc/sys/sigpending.2
+++ b/lib/libc/sys/sigpending.2
@@ -31,7 +31,7 @@
.\" @(#)sigpending.2 8.3 (Berkeley) 1/12/94
.\" $FreeBSD$
.\"
-.Dd January 12, 1994
+.Dd September 6, 2013
.Dt SIGPENDING 2
.Os
.Sh NAME
@@ -47,7 +47,7 @@
The
.Fn sigpending
system call returns a mask of the signals pending for delivery
-to the calling process in the location indicated by
+to the calling thread or the calling process in the location indicated by
.Fa set .
Signals may be pending because they are currently masked,
or transiently before delivery (although the latter case is not
diff --git a/lib/libc/sys/sigreturn.2 b/lib/libc/sys/sigreturn.2
index 13d76f68d48b..1b76468a84ec 100644
--- a/lib/libc/sys/sigreturn.2
+++ b/lib/libc/sys/sigreturn.2
@@ -28,7 +28,7 @@
.\" @(#)sigreturn.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd September 6, 2013
.Dt SIGRETURN 2
.Os
.Sh NAME
@@ -46,7 +46,7 @@ The
system call
allows users to atomically unmask, switch stacks,
and return from a signal context.
-The processes signal mask and stack status are
+The thread's signal mask and stack status are
restored from the context structure pointed to by
.Fa scp .
The system call does not return;
@@ -65,7 +65,7 @@ is set to indicate the error.
The
.Fn sigreturn
system call
-will fail and the process context will remain unchanged
+will fail and the thread context will remain unchanged
if one of the following occurs.
.Bl -tag -width Er
.It Bq Er EFAULT
diff --git a/lib/libc/sys/sigwait.2 b/lib/libc/sys/sigwait.2
index 525bffb2689f..4da64a99dddd 100644
--- a/lib/libc/sys/sigwait.2
+++ b/lib/libc/sys/sigwait.2
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 27, 2012
+.Dd September 6, 2013
.Dt SIGWAIT 2
.Os
.Sh NAME
@@ -50,7 +50,7 @@ waits until one or more of the selected signals has been generated.
Then
.Fn sigwait
atomically clears one of the selected signals from the set of pending signals
-for the process and sets the location pointed to by
+(for the process or for the current thread) and sets the location pointed to by
.Fa sig
to the signal number that was cleared.
.Pp
diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2
index 0c494bb6fb5c..cfa78e9fd83a 100644
--- a/lib/libc/sys/wait.2
+++ b/lib/libc/sys/wait.2
@@ -28,7 +28,7 @@
.\" @(#)wait.2 8.2 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd November 10, 2012
+.Dd September 7, 2013
.Dt WAIT 2
.Os
.Sh NAME
@@ -604,9 +604,23 @@ are not specified by POSIX.
The
.Fn WCOREDUMP
macro
-and the ability to restart a pending
-.Fn wait
-call are extensions to the POSIX interface.
+is an extension to the POSIX interface.
+.Pp
+The ability to use the
+.Dv WNOWAIT
+flag with
+.Fn waitpid
+is an extension;
+.Tn POSIX
+only permits this flag with
+.Fn waitid .
+.Pp
+.Tn POSIX
+requires
+.Fn waitid
+to return the full 32 bits passed to
+.Xr _exit 2 ;
+this implementation only returns 8 bits like in the other calls.
.Sh HISTORY
The
.Fn wait
diff --git a/lib/libiconv_modules/Makefile.inc b/lib/libiconv_modules/Makefile.inc
index 994939008ab5..3b25374b91e5 100644
--- a/lib/libiconv_modules/Makefile.inc
+++ b/lib/libiconv_modules/Makefile.inc
@@ -5,6 +5,9 @@
SHLIB_MAJOR= 4
WARNS?= 6
CFLAGS+= -I${.CURDIR}/../../libc/iconv
+
+CFLAGS+= -Dbool=_Bool
+
.if !defined(COMPAT_32BIT)
SHLIBDIR= /usr/lib/i18n
.else
diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile
index a46c3ab72847..ae3518a4f263 100644
--- a/lib/libldns/Makefile
+++ b/lib/libldns/Makefile
@@ -6,7 +6,7 @@ LDNSDIR = ${.CURDIR}/../../contrib/ldns
.PATH: ${LDNSDIR} ${LDNSDIR}/compat
LIB= ldns
-INTERNALLIB= true
+PRIVATELIB= true
CFLAGS+= -I${LDNSDIR}
@@ -18,6 +18,9 @@ SRCS= buffer.c dane.c dname.c dnssec.c dnssec_sign.c dnssec_verify.c \
SRCS+= b32_ntop.c b32_pton.c b64_ntop.c b64_pton.c
+DPADD+= ${LIBCRYPTO}
+LDADD+= -lcrypto
+
WARNS ?= 3
.include <bsd.lib.mk>
diff --git a/lib/libpam/libpam/Makefile b/lib/libpam/libpam/Makefile
index a4aad999edfe..fb2be14e5eaa 100644
--- a/lib/libpam/libpam/Makefile
+++ b/lib/libpam/libpam/Makefile
@@ -36,12 +36,13 @@
# $FreeBSD$
OPENPAM= ${.CURDIR}/../../../contrib/openpam
-.PATH: ${OPENPAM}/include ${OPENPAM}/lib ${OPENPAM}/doc/man
+.PATH: ${OPENPAM}/include ${OPENPAM}/lib/libpam ${OPENPAM}/doc/man
LIB= pam
NO_PROFILE=
-SRCS= openpam_borrow_cred.c \
+SRCS= openpam_asprintf.c \
+ openpam_borrow_cred.c \
openpam_check_owner_perms.c \
openpam_configure.c \
openpam_constants.c \
@@ -63,8 +64,11 @@ SRCS= openpam_borrow_cred.c \
openpam_set_feature.c \
openpam_set_option.c \
openpam_straddch.c \
+ openpam_strlcat.c \
+ openpam_strlcpy.c \
openpam_subst.c \
openpam_ttyconv.c \
+ openpam_vasprintf.c \
pam_acct_mgmt.c \
pam_authenticate.c \
pam_chauthtok.c \
@@ -151,6 +155,7 @@ CSTD?= c99
CFLAGS+= -I${.CURDIR} -I${OPENPAM}/include
CFLAGS+= -DLIB_MAJ=${SHLIB_MAJOR}
CFLAGS+= -DOPENPAM_MODULES_DIR='"${PAM_MOD_DIR:C/\/*$//}/"'
+CFLAGS+= -DHAVE_DLFUNC=1
CFLAGS+= -DHAVE_FDLOPEN=1
CFLAGS+= -DHAVE_FPURGE=1
CFLAGS+= -DHAVE_STRLCAT=1
diff --git a/lib/libpam/modules/pam_ssh/Makefile b/lib/libpam/modules/pam_ssh/Makefile
index d00652a8c215..886610a8fd14 100644
--- a/lib/libpam/modules/pam_ssh/Makefile
+++ b/lib/libpam/modules/pam_ssh/Makefile
@@ -15,6 +15,7 @@ CFLAGS+= -I${SSHDIR} -include ssh_namespace.h
DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT}
LDADD= -lssh -lcrypto -lcrypt
+USEPRIVATELIB= ssh
.include <bsd.lib.mk>
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 8b643211bee4..5264aeb0a0de 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -55,6 +55,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
e_pow.c e_powf.c e_rem_pio2.c \
e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \
e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \
+ imprecise.c \
k_cos.c k_cosf.c k_exp.c k_expf.c k_rem_pio2.c k_sin.c k_sinf.c \
k_tan.c k_tanf.c \
s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_carg.c s_cargf.c s_cargl.c \
diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map
index f244af4793b7..5b75f0804b59 100644
--- a/lib/msun/Symbol.map
+++ b/lib/msun/Symbol.map
@@ -270,4 +270,13 @@ FBSD_1.3 {
log1pl;
log2l;
logl;
+ # Implemented as weak aliases for imprecise versions
+ coshl;
+ erfcl;
+ erfl;
+ lgammal;
+ powl;
+ sinhl;
+ tanhl;
+ tgammal;
};
diff --git a/lib/msun/src/imprecise.c b/lib/msun/src/imprecise.c
new file mode 100644
index 000000000000..a7503bf1c234
--- /dev/null
+++ b/lib/msun/src/imprecise.c
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2013 David Chisnall
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <float.h>
+#include <math.h>
+
+/*
+ * If long double is not the same size as double, then these will lose
+ * precision and we should emit a warning whenever something links against
+ * them.
+ */
+#if (LDBL_MANT_DIG > 53)
+#define WARN_IMPRECISE(x) \
+ __warn_references(x, # x " has lower than advertised precision");
+#else
+#define WARN_IMPRECISE(x)
+#endif
+/*
+ * Declare the functions as weak variants so that other libraries providing
+ * real versions can override them.
+ */
+#define DECLARE_WEAK(x)\
+ __weak_reference(imprecise_## x, x);\
+ WARN_IMPRECISE(x)
+
+long double
+imprecise_powl(long double x, long double y)
+{
+
+ return pow(x, y);
+}
+DECLARE_WEAK(powl);
+
+#define DECLARE_IMPRECISE(f) \
+ long double imprecise_ ## f ## l(long double v) { return f(v); }\
+ DECLARE_WEAK(f ## l)
+
+DECLARE_IMPRECISE(cosh);
+DECLARE_IMPRECISE(erfc);
+DECLARE_IMPRECISE(erf);
+DECLARE_IMPRECISE(lgamma);
+DECLARE_IMPRECISE(sinh);
+DECLARE_IMPRECISE(tanh);
+DECLARE_IMPRECISE(tgamma);
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index 8ebc7fbf30c8..8af2c650e77e 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -39,7 +39,7 @@
*/
#ifdef __arm__
-#if defined(__VFP_FP__)
+#if defined(__VFP_FP__) || defined(__ARM_EABI__)
#define IEEE_WORD_ORDER BYTE_ORDER
#else
#define IEEE_WORD_ORDER BIG_ENDIAN