Commit Graph

17982 Commits

Author SHA1 Message Date
Corinna Vinschen 2640628b09 cygwin: add socket bugfix to release notes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-11-07 16:11:08 +01:00
Erik M. Bray 1c50e0d1ab Fix two bugs in the limit of large numbers of sockets:
* Fix the maximum number of sockets allowed in the session to 2048,
  instead of making it relative to sizeof(wsa_event).

  The original choice of 2048 was in order to fit the wsa_events array
  in the .cygwin_dll_common shared section, but there is still enough
  room to grow there to have 2048 sockets on 64-bit as well.

* Return an error and set errno=ENOBUF if a socket can't be created
  due to this limit being reached.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-11-07 16:08:14 +01:00
Sebastian Huber 1f42dc2bcf Make ffsl() and ffsll() BSD-visible
Since glibc 2.27, they are visible via _DEFAULT_SOURCE (__USE_MISC):

https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man3/ffs.3?id=247bbcf00c9a425ab0ad6e303ec8718e4ba844a6

In FreeBSD, they are guarded by __BSD_VISIBLE.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-03 10:46:07 +01:00
Corinna Vinschen ad15b8ccee cygwin: ftruncate64: add missing braces
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-11-02 19:13:09 +01:00
Corinna Vinschen 09d60f6444 cygwin: add 2.9.1 release messages file
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-11-02 18:09:39 +01:00
Erik M. Bray 94854321bb posix_fallocate() *returns* error codes but does not set errno
Also updates the fhandler_*::ftruncate implementations to adhere to the same
semantics.  The error handling semantics of those syscalls that use
fhandler_*::ftruncate are moved to the implementations of those syscalls (
in particular ftruncate() and friends still set errno and return -1 on error
but that logic is handled in the syscall implementation).
2017-11-02 18:01:01 +01:00
Erik M. Bray 8c8cdd9ad7 posix_fadvise() *returns* error codes but does not set errno
Also updates the fhandler_*::fadvise implementations to adhere to the same
semantics.
2017-11-02 17:58:18 +01:00
Joel Sherrill 076ce7098f newlib/configure.host: Remove obsolete definition of _I386MACH_ALLOW_HW_INTERRUPTS
The *-*-rtems* targets defined this even though the conditional
was no longer present in i386/setjmp.S.
2017-11-02 09:27:15 +01:00
Sebastian Huber ce189d8afe RTEMS: Remove internal timecounter API
Change copyright.  Original BSD content moved to
<machine/_kernel_time.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-26 08:47:21 +02:00
Ken Brown 3e8323dc06 winsup/utils/dump_setup.cc: Remove the function 'base'
This was called only on filenames in /etc/setup/installed.db, which
are all basenames anyway.  Moreover, base wasn't correctly handling
filenames containing colons.
2017-10-25 17:02:26 +02:00
Alexander Fedotov f6ef29c48f Fixed semihosting for AArch64 when heapinfo parameters are not provided by debugger 2017-10-24 17:27:51 +02:00
Szabolcs Nagy 56e494c074 fix internal __ieee754_expf and __ieee754_logf calls
The recently added new math code inlines error handling instead of using
error handling wrappers around __ieee754* internal symbols, and thus the
__ieee754* symbols are no longer provided.

However __ieee754_expf and __ieee754_logf are used in the implementation
of a number of other math functions.  These symbols are safe to redirect
to the external expf and logf symbols, because those names are always
reserved when single precision math functions are reserved and the
additional error handling code is either not reached or there will be
an error in the final result that will override an internal spurious
errno setting.

For consistency all of __ieee754_expf, __ieee754_logf and __ieee754_powf
are redirected using a macro.
2017-10-20 11:19:02 +02:00
Corinna Vinschen 3bdd484103 cygwin: belatedly bump DLL minor version
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:40:56 +02:00
Corinna Vinschen 88cfcda06b cygwin: unlink: workaround NFS non-ability to move file in certain cases
Under some not quite clear conditions, NFS fails to use its
unlink workaround to rename a file to ".nfsXYZ".  The problem has been
reproduced with the GAWK testext.awk testcase.  To workaround this in
Cygwin, we now call try_to_bin on NFS, too.  For some reason NFS doesn't
fail to rename the .cygXYZ file to .nfsXYZ after this Cygwin rename.
Fix comment in unlink_nt accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:27:17 +02:00
Corinna Vinschen 5b7921523d cygwin: unlink: don't try "final trick" in try_to_bin on NFS
Doesn't work.  Just another STATUS_SHARING_VIOLATION.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:22:14 +02:00
Corinna Vinschen e6c79e7a2a cygwin: unlink: fix "final trick" overwrite method on remote drives
The "final trick" code in try_to_bin accidentally never worked on
remote drives because it relies on rootdir.  Which isn't set for
remote unlinks.  The code now creates a full path for remote files.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:21:12 +02:00
Corinna Vinschen 3dda58f157 cygwin: unlink: improve debug messages in try_to_bin
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:18:12 +02:00
Corinna Vinschen 9ac4c0325f cygwin: unlink: simplify rootdir handling
In try_to_bin, rootdir is NULL for remote drives anyway.  No extra
check required.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:15:08 +02:00
Corinna Vinschen 5224eb7517 cygwin: unlink: drop redundant check for netapp FS
The try_to_bin function isn't called for netapp FSes anyway, so testing
for this FS type in the function is moot.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:13:48 +02:00
Corinna Vinschen 7127e8ef3b cygwin: unlink: Fix typos in comments
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-18 16:12:42 +02:00
Szabolcs Nagy c156098271 New expf, exp2f, logf, log2f and powf implementations
Based on code from https://github.com/ARM-software/optimized-routines/

This patch adds a highly optimized generic implementation of expf,
exp2f, logf, log2f and powf.  The new functions are not only
faster (6x for powf!), but are also smaller and more accurate.
In order to achieve this, the algorithm uses double precision
arithmetic for accuracy, avoids divisions and uses small table
lookups to minimize the polynomials.  Special cases are handled
inline to avoid the unnecessary overhead of wrapper functions and
set errno to POSIX requirements.

The new functions are added under newlib/libm/common, but the old
implementations are kept (in newlib/libm/math) for non-IEEE or
pre-C99 systems.  Targets can enable the new math code by defining
__OBSOLETE_MATH_DEFAULT to 0 in newlib/libc/include/machine/ieeefp.h,
users can override the default by defining __OBSOLETE_MATH.
Currently the new code is enabled for AArch64 and AArch32 with VFP.
Targets with a single precision FPU may still prefer the old
implementation.

libm.a size changes:
arm: -1692
arm/thumb/v7-a/nofp: -878
arm/thumb/v7-a+fp/hard: -864
arm/thumb/v7-a+fp/softfp: -908
aarch64: -1476
2017-10-13 10:58:00 +02:00
Sebastian Huber c165a27c01 RTEMS: Fix _PTHREAD_MUTEX_INITIALIZER
Add missing braces around initializer.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-13 08:07:13 +02:00
Yaakov Selkowitz 747f31854a cygwin: fix gethostbyaddr argument types
The first argument of gethostbyaddr needs to accept a generic pointer
to be compatible with e.g. struct in_addr *.  This caused an issue
compiling krb5-1.15.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-10-10 13:51:23 -05:00
Yaakov Selkowitz 0b45b053e8 Feature test macros overhaul: Cygwin netdb.h
herror etc. are MISC, rcmd etc. are BSD, addrinfo functions are
POSIX.1-2001, except for IDN functionality which is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-10-10 13:50:46 -05:00
Michael Haubenwallner 1adbd77cab cygwin: fix potential buffer overflow in fork
When fork fails, we can use "%s" now with system_sprintf for the errmsg
rather than a (potentially too small) buffer for the format string.

* fork.cc (fork): Use "%s" with system_printf now.
2017-10-10 15:51:06 +02:00
Michael Haubenwallner 4449971295 cygwin: fix potential buffer overflow in small_sprintf
With "%C" format string, argument may convert in up to MB_LEN_MAX bytes.
Relying on sys_wcstombs to add a trailing zero here requires us to
provide a large enough buffer.

* smallprint.c (__small_vsprintf): Use MB_LEN_MAX+1 bufsize for "%C".
2017-10-10 13:35:16 +02:00
Tamar Christina 111b6813fb Fix multido compilation on ARM
The previous multi-build implementation was copying the config.status from the parent
multilib directory when building the different semihosting variants. It did so because
the configuration doesn't change. However when you use a relative path to configure it
turns out that the paths inside the config.status are also relative.

To fix this, the srcdir is adjusted from the initial configuration instead of copying it.

Tested on aarch64-none-elf and arm-none-eabi.

Signed-off-by: Tamar Christina <tamar.christina@arm.com>
2017-10-09 19:03:52 +02:00
Michael Haubenwallner 4bee8c48df cygwin: initialize variable for stack unwinding
The third argument of RtlLookupFunctionEntry actually is documented as
_Inout_opt_ for both x64 and ARM, although generic doc says _Out_ only.

* exceptions.cc (__unwind_single_frame): Initialize hist variable.
2017-10-09 18:58:52 +02:00
Corinna Vinschen 7346a162f2 cygwin: disable -Wframe-address warning only on GCC 6 or later
This is required as long as we don't have a GCC 6.x cross compiler
on Linux.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-10-09 18:08:10 +02:00
Michael Haubenwallner 15de9da0b9 Fix typo with newlib-long-time_t default value.
Fix typo for newlib-long-time_t to leave newlib-nano-malloc alone.
2017-10-09 17:55:19 +02:00
Alexander Fedotov e7eb978881 adjust libnosys config for aarch64 to avoid linker error when switching from rdimon.specs to nosys.specs 2017-10-09 17:53:41 +02:00
Ken Brown 51c6ef6b82 cygwin: Remove workaround for GCC 6 null pointer check warnings 2017-10-09 11:44:11 +02:00
Ken Brown 7212b571a5 cygwin: Remove comparison of 'this' to NULL in _pinfo::exists
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 5952d5f08f cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::kill
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown d17c45f200 cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 6cd1978fc8 cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 56f23a5107 cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::pipe_fhandler
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown d1ea8f4a46 cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::commune_request
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 911f7d628d cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cmdline
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 571b7689bb cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cwd
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown be436ad2a3 cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::root
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 504959d8fc cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds
Fix all callers.
2017-10-09 11:44:11 +02:00
Ken Brown 47bbe23105 cygwin: Remove comparisons of 'this' to 'NULL' in fhandler_dsp.cc
Fix all callers.
2017-10-09 11:44:10 +02:00
Sebastian Huber 3a79700c2d RTEMS: Make pthread_mutex_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber 55c5dda9b5 RTEMS: Make pthread_cond_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber d902eef093 RTEMS: Make pthread_rwlock_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber 9187bb23a0 RTEMS: Make pthread_barrier_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber 8253c240cb RTEMS: Make sem_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:12 +02:00
Sebastian Huber 4fef7312b3 RTEMS: Optimize pthread_once_t
Reduce size of pthread_once_t and make it zero-initialized.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:12 +02:00
Brian Inglis f9b24fad7c newlib/libm/complex/cargl.c change imag() real() to cimagl() creall() 2017-09-19 15:36:12 -05:00