]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
6 years agoCygwin: fcntl.h: Use test macros to guard non-standard open flags
Corinna Vinschen [Tue, 14 Nov 2017 20:31:31 +0000 (21:31 +0100)]
Cygwin: fcntl.h: Use test macros to guard non-standard open flags

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fcntl.h: Define O_NOATIME
Corinna Vinschen [Tue, 14 Nov 2017 20:29:37 +0000 (21:29 +0100)]
Cygwin: fcntl.h: Define O_NOATIME

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: fcntl.h: Define O_TMPFILE and implement it
Corinna Vinschen [Tue, 14 Nov 2017 20:28:45 +0000 (21:28 +0100)]
Cygwin: fcntl.h: Define O_TMPFILE and implement it

Difference to Linux: We can't create files which don't show up
in the filesystem due to OS restrictions.  As a kludge, make a
(half-hearted) attempt to hide the file in the filesystem.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoCygwin: open: cleanup code in preparation of O_TMPFILE
Corinna Vinschen [Tue, 14 Nov 2017 15:28:44 +0000 (16:28 +0100)]
Cygwin: open: cleanup code in preparation of O_TMPFILE

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib/libc/stdlib/realloc.c: fix variable name
Florian Schmidt [Tue, 14 Nov 2017 08:01:14 +0000 (09:01 +0100)]
newlib/libc/stdlib/realloc.c: fix variable name

The variable doesn't follow the convention of having the same name as
the function it's bundled with. Furthermore, it clashes with the
variable of the same name in newlib/libc/stdlib/calloc.c.

Signed-off-by: Florian Schmidt <florian.schmidt@neclab.eu>
6 years agonewlib/.../getreent.c: Allow to be provided by host and do so for RTEMS
Joel Sherrill [Wed, 11 Oct 2017 12:57:44 +0000 (07:57 -0500)]
newlib/.../getreent.c: Allow to be provided by host and do so for RTEMS

RTEMS provides the option to have a global or per-thread reentrancy
as part of application configuration. As part of this, RTEMS provides
the implementation of __getreent() as appropriate. Allow the target
to determine if this method is present in libc.a.

6 years agocygwin: pread: Remove incorrect comment
Corinna Vinschen [Wed, 8 Nov 2017 12:36:34 +0000 (13:36 +0100)]
cygwin: pread: Remove incorrect comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: fhandler_disk_file::pread: always print debug info on return
Corinna Vinschen [Wed, 8 Nov 2017 12:30:42 +0000 (13:30 +0100)]
cygwin: fhandler_disk_file::pread: always print debug info on return

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: pread() returns non-zero if read beyond EOF
Xiaofeng Liu [Wed, 8 Nov 2017 12:21:30 +0000 (13:21 +0100)]
cygwin: pread() returns non-zero if read beyond EOF

NtReadFile returns EOF status but doesn't set information to 0.
Set return value explicitly on EOF.

6 years agocygwin: fix stray semicolon
Corinna Vinschen [Tue, 7 Nov 2017 15:34:17 +0000 (16:34 +0100)]
cygwin: fix stray semicolon

introduced by patch 1c50e0d1abd5cc790e72572af6fd6b03f7d1c594

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: add socket bugfix to release notes
Corinna Vinschen [Tue, 7 Nov 2017 15:11:08 +0000 (16:11 +0100)]
cygwin: add socket bugfix to release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoFix two bugs in the limit of large numbers of sockets:
Erik M. Bray [Tue, 7 Nov 2017 13:44:49 +0000 (14:44 +0100)]
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>
6 years agoMake ffsl() and ffsll() BSD-visible
Sebastian Huber [Fri, 29 Sep 2017 05:29:03 +0000 (07:29 +0200)]
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>
6 years agocygwin: ftruncate64: add missing braces
Corinna Vinschen [Thu, 2 Nov 2017 18:13:09 +0000 (19:13 +0100)]
cygwin: ftruncate64: add missing braces

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: add 2.9.1 release messages file
Corinna Vinschen [Thu, 2 Nov 2017 17:09:39 +0000 (18:09 +0100)]
cygwin: add 2.9.1 release messages file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoposix_fallocate() *returns* error codes but does not set errno
Erik M. Bray [Thu, 2 Nov 2017 15:45:35 +0000 (16:45 +0100)]
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).

6 years agoposix_fadvise() *returns* error codes but does not set errno
Erik M. Bray [Thu, 2 Nov 2017 15:45:34 +0000 (16:45 +0100)]
posix_fadvise() *returns* error codes but does not set errno

Also updates the fhandler_*::fadvise implementations to adhere to the same
semantics.

6 years agonewlib/configure.host: Remove obsolete definition of _I386MACH_ALLOW_HW_INTERRUPTS
Joel Sherrill [Fri, 27 Oct 2017 21:32:39 +0000 (16:32 -0500)]
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.

6 years agoRTEMS: Remove internal timecounter API
Sebastian Huber [Tue, 24 Oct 2017 09:16:22 +0000 (11:16 +0200)]
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>
6 years agowinsup/utils/dump_setup.cc: Remove the function 'base'
Ken Brown [Tue, 24 Oct 2017 22:21:53 +0000 (18:21 -0400)]
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.

6 years agoFixed semihosting for AArch64 when heapinfo parameters are not provided by debugger
Alexander Fedotov [Wed, 11 Oct 2017 11:52:20 +0000 (14:52 +0300)]
Fixed semihosting for AArch64 when heapinfo parameters are not provided by debugger

6 years agofix internal __ieee754_expf and __ieee754_logf calls
Szabolcs Nagy [Tue, 17 Oct 2017 11:41:20 +0000 (12:41 +0100)]
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.

6 years agocygwin: belatedly bump DLL minor version
Corinna Vinschen [Wed, 18 Oct 2017 14:40:56 +0000 (16:40 +0200)]
cygwin: belatedly bump DLL minor version

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: unlink: workaround NFS non-ability to move file in certain cases
Corinna Vinschen [Wed, 18 Oct 2017 14:27:17 +0000 (16:27 +0200)]
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>
6 years agocygwin: unlink: don't try "final trick" in try_to_bin on NFS
Corinna Vinschen [Wed, 18 Oct 2017 14:22:14 +0000 (16:22 +0200)]
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>
6 years agocygwin: unlink: fix "final trick" overwrite method on remote drives
Corinna Vinschen [Wed, 18 Oct 2017 14:21:12 +0000 (16:21 +0200)]
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>
6 years agocygwin: unlink: improve debug messages in try_to_bin
Corinna Vinschen [Wed, 18 Oct 2017 14:18:12 +0000 (16:18 +0200)]
cygwin: unlink: improve debug messages in try_to_bin

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: unlink: simplify rootdir handling
Corinna Vinschen [Wed, 18 Oct 2017 14:15:08 +0000 (16:15 +0200)]
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>
6 years agocygwin: unlink: drop redundant check for netapp FS
Corinna Vinschen [Wed, 18 Oct 2017 14:13:48 +0000 (16:13 +0200)]
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>
6 years agocygwin: unlink: Fix typos in comments
Corinna Vinschen [Wed, 18 Oct 2017 14:12:42 +0000 (16:12 +0200)]
cygwin: unlink: Fix typos in comments

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoNew expf, exp2f, logf, log2f and powf implementations
Szabolcs Nagy [Thu, 25 May 2017 15:41:38 +0000 (16:41 +0100)]
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

6 years agoRTEMS: Fix _PTHREAD_MUTEX_INITIALIZER
Sebastian Huber [Fri, 13 Oct 2017 06:06:19 +0000 (08:06 +0200)]
RTEMS: Fix _PTHREAD_MUTEX_INITIALIZER

Add missing braces around initializer.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agocygwin: fix gethostbyaddr argument types
Yaakov Selkowitz [Wed, 27 Sep 2017 01:36:35 +0000 (20:36 -0500)]
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>
6 years agoFeature test macros overhaul: Cygwin netdb.h
Yaakov Selkowitz [Wed, 27 Sep 2017 01:36:34 +0000 (20:36 -0500)]
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>
6 years agocygwin: fix potential buffer overflow in fork
Michael Haubenwallner [Mon, 9 Oct 2017 16:58:24 +0000 (18:58 +0200)]
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.

6 years agocygwin: fix potential buffer overflow in small_sprintf
Michael Haubenwallner [Mon, 9 Oct 2017 16:57:58 +0000 (18:57 +0200)]
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".

6 years agoFix multido compilation on ARM
Tamar Christina [Tue, 26 Sep 2017 13:47:04 +0000 (14:47 +0100)]
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>
6 years agocygwin: initialize variable for stack unwinding
Michael Haubenwallner [Mon, 9 Oct 2017 15:37:40 +0000 (17:37 +0200)]
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.

6 years agocygwin: disable -Wframe-address warning only on GCC 6 or later
Corinna Vinschen [Mon, 9 Oct 2017 16:08:10 +0000 (18:08 +0200)]
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>
6 years agoFix typo with newlib-long-time_t default value.
Michael Haubenwallner [Tue, 26 Sep 2017 08:38:12 +0000 (10:38 +0200)]
Fix typo with newlib-long-time_t default value.

Fix typo for newlib-long-time_t to leave newlib-nano-malloc alone.

6 years agoadjust libnosys config for aarch64 to avoid linker error when switching from rdimon...
Alexander Fedotov [Fri, 29 Sep 2017 19:10:47 +0000 (22:10 +0300)]
adjust libnosys config for aarch64 to avoid linker error when switching from rdimon.specs to nosys.specs

6 years agocygwin: Remove workaround for GCC 6 null pointer check warnings
Ken Brown [Sun, 17 Sep 2017 02:04:20 +0000 (22:04 -0400)]
cygwin: Remove workaround for GCC 6 null pointer check warnings

6 years agocygwin: Remove comparison of 'this' to NULL in _pinfo::exists
Ken Brown [Sun, 17 Sep 2017 02:04:19 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to NULL in _pinfo::exists

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::kill
Ken Brown [Sun, 17 Sep 2017 02:04:18 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::kill

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ
Ken Brown [Sun, 17 Sep 2017 02:04:17 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd
Ken Brown [Sun, 17 Sep 2017 02:04:16 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::pipe_fhandler
Ken Brown [Sun, 17 Sep 2017 02:04:15 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::pipe_fhandler

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::commune_request
Ken Brown [Sun, 17 Sep 2017 02:04:14 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::commune_request

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cmdline
Ken Brown [Sun, 17 Sep 2017 02:04:13 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cmdline

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cwd
Ken Brown [Sun, 17 Sep 2017 02:04:12 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cwd

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::root
Ken Brown [Sun, 17 Sep 2017 02:04:11 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::root

Fix all callers.

6 years agocygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds
Ken Brown [Sun, 17 Sep 2017 02:04:10 +0000 (22:04 -0400)]
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds

Fix all callers.

6 years agocygwin: Remove comparisons of 'this' to 'NULL' in fhandler_dsp.cc
Ken Brown [Sun, 17 Sep 2017 02:04:09 +0000 (22:04 -0400)]
cygwin: Remove comparisons of 'this' to 'NULL' in fhandler_dsp.cc

Fix all callers.

6 years agoRTEMS: Make pthread_mutex_t self-contained
Sebastian Huber [Wed, 27 Sep 2017 12:20:14 +0000 (14:20 +0200)]
RTEMS: Make pthread_mutex_t self-contained

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoRTEMS: Make pthread_cond_t self-contained
Sebastian Huber [Tue, 26 Sep 2017 05:36:25 +0000 (07:36 +0200)]
RTEMS: Make pthread_cond_t self-contained

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoRTEMS: Make pthread_rwlock_t self-contained
Sebastian Huber [Thu, 21 Sep 2017 13:41:30 +0000 (15:41 +0200)]
RTEMS: Make pthread_rwlock_t self-contained

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoRTEMS: Make pthread_barrier_t self-contained
Sebastian Huber [Thu, 21 Sep 2017 13:21:13 +0000 (15:21 +0200)]
RTEMS: Make pthread_barrier_t self-contained

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoRTEMS: Make sem_t self-contained
Sebastian Huber [Wed, 13 Sep 2017 11:07:31 +0000 (13:07 +0200)]
RTEMS: Make sem_t self-contained

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoRTEMS: Optimize pthread_once_t
Sebastian Huber [Tue, 19 Sep 2017 13:08:35 +0000 (15:08 +0200)]
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>
6 years agonewlib/libm/complex/cargl.c change imag() real() to cimagl() creall() newlib-snapshot-20170922
Brian Inglis [Wed, 13 Sep 2017 06:26:48 +0000 (00:26 -0600)]
newlib/libm/complex/cargl.c change imag() real() to cimagl() creall()

6 years agoFix warnings and documentation in strnstr.c
Sebastian Huber [Wed, 13 Sep 2017 12:31:01 +0000 (14:31 +0200)]
Fix warnings and documentation in strnstr.c

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agocygwin: workaround GCC 6 changes
Yaakov Selkowitz [Tue, 12 Sep 2017 19:30:34 +0000 (14:30 -0500)]
cygwin: workaround GCC 6 changes

GCC 6 includes a number of new warnings which cause Cygwin to either not
compile, or not work properly even if said warnings are ignored:

https://cygwin.com/ml/cygwin-developers/2017-09/msg00000.html
https://gcc.gnu.org/gcc-6/porting_to.html

For now, we use the flags necessary to revert to GCC 5 behaviour until we
can fix the code properly.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoRevert "cygwin: only expose /dev/con{in,out,sole} when started from a Windows console"
Yaakov Selkowitz [Mon, 11 Sep 2017 18:21:46 +0000 (13:21 -0500)]
Revert "cygwin: only expose /dev/con{in,out,sole} when started from a Windows console"

This caused serious regressions when running from a cmd window:

https://cygwin.com/ml/cygwin/2017-09/msg00114.html

This reverts commit b706c6b479422d31f0124b92c21b4cb536bbddff.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoChange time_t to 64-bit by default
Sebastian Huber [Thu, 7 Sep 2017 06:24:22 +0000 (08:24 +0200)]
Change time_t to 64-bit by default

In order to avoid the year 2038 problem, define time_t to a signed
integer with at least 64-bits.  The type for time_t can be forced to
long with the --enable-newlib-long-time_t configure option or with the
_USE_LONG_TIME_T system configuration define.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoRemove harmful casts in gmtime_r()
Sebastian Huber [Thu, 7 Sep 2017 13:01:47 +0000 (15:01 +0200)]
Remove harmful casts in gmtime_r()

In case time_t is long, then the cast to long is a nop.  In case time_t
is __int_least64_t, then the cast to long may truncate the value before
the division.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoLet RTEMS provide clock()
Sebastian Huber [Wed, 6 Sep 2017 06:43:26 +0000 (08:43 +0200)]
Let RTEMS provide clock()

Newlib uses _times_r() in clock().  The problem is that the _times_r()
clock frequency is defined by sysconf(_SC_CLK_TCK).  The clock frequency
of clock() is the constant CLOCKS_PER_SEC.

FreeBSD uses getrusage() for clock().  Since RTEMS has only one process,
the implementation can be simplified.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agostdio.h: Don't define unlocked macros using static inline on C++ cygwin-2_9_0-release
Corinna Vinschen [Mon, 4 Sep 2017 08:52:33 +0000 (10:52 +0200)]
stdio.h: Don't define unlocked macros using static inline on C++

In C++, the usage of static inline functions for getchar_unlocked and
putchar_unlocked may result in error messages like

  error: ‘_putchar_unlocked’ was not declared in this scope

Fix this by not using the _getchar_unlocked and _putchar_unlocked
macros in C++.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agocygwin: Document crypt_r
Yaakov Selkowitz [Fri, 1 Sep 2017 22:26:40 +0000 (17:26 -0500)]
cygwin: Document crypt_r

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agoRemove some dangerous advice from the FAQ
Achim Gratz [Sat, 2 Sep 2017 14:14:02 +0000 (16:14 +0200)]
Remove some dangerous advice from the FAQ

6 years agoinclude: fix ffs, fls guards
Yaakov Selkowitz [Tue, 29 Aug 2017 17:55:58 +0000 (12:55 -0500)]
include: fix ffs, fls guards

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
6 years agonewlib: string/Makefile.am (CHEWOUT_FILES): Add strnstr.def
Corinna Vinschen [Wed, 30 Aug 2017 14:48:55 +0000 (16:48 +0200)]
newlib: string/Makefile.am (CHEWOUT_FILES): Add strnstr.def

Regenerate strings/Makefile.in

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: strnstr: drop traditional synopisis
Corinna Vinschen [Wed, 30 Aug 2017 14:45:36 +0000 (16:45 +0200)]
newlib: strnstr: drop traditional synopisis

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoAdd man page entry for strnstr.c.
Sichen Zhao [Wed, 30 Aug 2017 03:03:57 +0000 (11:03 +0800)]
Add man page entry for strnstr.c.

6 years agoModify strnstr.c.
Sichen Zhao [Wed, 30 Aug 2017 03:03:56 +0000 (11:03 +0800)]
Modify strnstr.c.

6 years agocygwin: add strptime %F fix to release notes
Corinna Vinschen [Tue, 29 Aug 2017 19:12:21 +0000 (21:12 +0200)]
cygwin: add strptime %F fix to release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agowinsup/cygwin/libc/strptime.cc(__strptime) fix %F width
Brian Inglis [Tue, 29 Aug 2017 17:25:43 +0000 (11:25 -0600)]
winsup/cygwin/libc/strptime.cc(__strptime) fix %F width

6 years agocygwin: document %s support in strptime
Corinna Vinschen [Tue, 29 Aug 2017 09:16:13 +0000 (11:16 +0200)]
cygwin: document %s support in strptime

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoFix compile error due to new strnstr()
Sebastian Huber [Fri, 25 Aug 2017 17:48:42 +0000 (19:48 +0200)]
Fix compile error due to new strnstr()

Remove local strnstr() implementation to fix compile error:

newlib/libc/iconv/lib/aliasesi.c:53:8: error: conflicting types for 'strnstr'
 _DEFUN(strnstr, (haystack, needle, length),
        ^
In file included from newlib/libc/iconv/lib/aliasesi.c:29:0:
newlib/libc/include/string.h:125:10:
note: previous declaration of 'strnstr' was here
 char    *strnstr(const char *, const char *, size_t) __pure;
          ^~~~~~~

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agocygwin: export strnstr
Corinna Vinschen [Fri, 25 Aug 2017 15:59:28 +0000 (17:59 +0200)]
cygwin: export strnstr

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agonewlib: rebuild string/Makefile.in
Corinna Vinschen [Fri, 25 Aug 2017 15:59:05 +0000 (17:59 +0200)]
newlib: rebuild string/Makefile.in

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoPort strnstr.c to newlib.
Sichen Zhao [Fri, 25 Aug 2017 07:35:39 +0000 (15:35 +0800)]
Port strnstr.c to newlib.

6 years agoImport strnstr.c from FreeBSD.
Sichen Zhao [Fri, 25 Aug 2017 07:35:38 +0000 (15:35 +0800)]
Import strnstr.c from FreeBSD.

6 years agoRevert "headers: avoid bareword attributes" for clang
Eric Blake [Fri, 25 Aug 2017 14:16:23 +0000 (09:16 -0500)]
Revert "headers: avoid bareword attributes" for clang

This reverts most of commit 979d467ff6e39ee5c52cf1aac7a6c9c63058141c.

We cannot avoid some bareword attributes until clang is fixed to
properly support __-decorated attributes; see this bug:
https://bugs.llvm.org/show_bug.cgi?id=34319

The macros in question expand to the empty string under gcc, so
only compilation under clang is affected, and since clang has the
bug, the obvious solution is to roll back the changes, and document
the issue.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agoRTEMS: Use __uint64_t for _CLOCK_T_
Sebastian Huber [Thu, 24 Aug 2017 13:27:50 +0000 (15:27 +0200)]
RTEMS: Use __uint64_t for _CLOCK_T_

This addresses:

https://devel.rtems.org/ticket/2135

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agoMake _CLOCK_T_ system configurable
Sebastian Huber [Thu, 24 Aug 2017 13:26:03 +0000 (15:26 +0200)]
Make _CLOCK_T_ system configurable

Let systems optionally provide the _CLOCK_T_ type via
<machine/_types.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
6 years agonewlib/libc/time/strptime.c(strptime_l) add %F %s support for strptime
Brian Inglis [Thu, 24 Aug 2017 19:12:17 +0000 (13:12 -0600)]
newlib/libc/time/strptime.c(strptime_l) add %F %s support for strptime

6 years agowinsup/cygwin/libc/strptime.cc(__strptime) add %s support to strptime
Brian Inglis [Thu, 24 Aug 2017 19:24:28 +0000 (13:24 -0600)]
winsup/cygwin/libc/strptime.cc(__strptime) add %s support to strptime

6 years agomove ILP32 sanity check on heap base code under ARM_RDI_MONITOR
Alexander Fedotov-B55613 [Tue, 22 Aug 2017 14:06:54 +0000 (17:06 +0300)]
move ILP32 sanity check on heap base code under ARM_RDI_MONITOR

6 years agocygwin: only expose /dev/con{in,out,sole} when started from a Windows console
Corinna Vinschen [Wed, 23 Aug 2017 15:43:41 +0000 (17:43 +0200)]
cygwin: only expose /dev/con{in,out,sole} when started from a Windows console

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
6 years agoAdd myself to RISC-V Port Maintainer
Kito Cheng [Mon, 21 Aug 2017 02:56:51 +0000 (10:56 +0800)]
Add myself to RISC-V Port Maintainer

6 years agoChange license to FreeBSD License for RISC-V
Kito Cheng [Mon, 21 Aug 2017 02:30:30 +0000 (10:30 +0800)]
Change license to FreeBSD License for RISC-V

 - For prevent confuse about what BSD license variant we used, 2- or
   3-clause license, we change the license to FreeBSD license to make
   it unambiguously refers to the 2-clause license.

6 years agoDocument renameat2
Ken Brown [Sat, 19 Aug 2017 17:15:04 +0000 (13:15 -0400)]
Document renameat2

6 years agocygwin: Implement renameat2
Ken Brown [Thu, 17 Aug 2017 13:12:15 +0000 (09:12 -0400)]
cygwin: Implement renameat2

Define the RENAME_NOREPLACE flag in <cygwin/fs.h> as defined on Linux
in <linux/fs.h>.  The other RENAME_* flags defined on Linux are not
supported.

6 years agoAdd RISC-V port for libgloss newlib-snapshot-20170818
Kito Cheng [Thu, 27 Jul 2017 08:45:47 +0000 (16:45 +0800)]
Add RISC-V port for libgloss

  Contributor list:
    - Andrew Waterman  <andrew@sifive.com>
    - Palmer Dabbelt  <palmer@dabbelt.com>
    - Kito Cheng  <kito.cheng@gmail.com>
    - Alex Suykov  <alex.suykov@gmail.com>

6 years agoAdd RISC-V port for libm
Kito Cheng [Thu, 27 Jul 2017 08:45:12 +0000 (16:45 +0800)]
Add RISC-V port for libm

  Contributor list:
    - Michael Neilly  <mneilly@yahoo.com>
    - Kito Cheng  <kito.cheng@gmail.com>

6 years agoheaders: avoid bareword attributes
Eric Blake [Thu, 17 Aug 2017 01:39:18 +0000 (20:39 -0500)]
headers: avoid bareword attributes

Always use the __-decorated form of an attribute name in public
headers, as the bareword form is in the user's namespace, and we
don't want compilation to break just because the user defines the
bareword to mean something else.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agoheaders: avoid bareword attributes
Eric Blake [Thu, 17 Aug 2017 01:39:18 +0000 (20:39 -0500)]
headers: avoid bareword attributes

Always use the __-decorated form of an attribute name in public
headers, as the bareword form is in the user's namespace, and we
don't want compilation to break just because the user defines the
bareword to mean something else.

Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agoFix crt0 init fini code
Szabolcs Nagy [Thu, 17 Aug 2017 10:42:59 +0000 (11:42 +0100)]
Fix crt0 init fini code

__USES_INITFINI__ ifdef was incorrectly copied from arm
(it's an arm backend thing in gcc, not meaningful on aarch64)

6 years agoAdd RISC-V port for newlib
Kito Cheng [Thu, 27 Jul 2017 08:44:22 +0000 (16:44 +0800)]
Add RISC-V port for newlib

  Contributor list:
    - Andrew Waterman  <andrew@sifive.com>
    - Palmer Dabbelt  <palmer@dabbelt.com>
    - Kito Cheng  <kito.cheng@gmail.com>
    - Scott Beamer  <sbeamer@eecs.berkeley.edu>

6 years agofix typo in AArch64 crt0
Alexander Fedotov-B55613 [Tue, 15 Aug 2017 14:01:05 +0000 (17:01 +0300)]
fix typo in AArch64 crt0

This page took 0.069845 seconds and 5 git commands to generate.