]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
7 years agoRemove FreeBSD specifics from RTEMS <arpa/inet.h>
Sebastian Huber [Mon, 12 Jun 2017 06:38:56 +0000 (08:38 +0200)]
Remove FreeBSD specifics from RTEMS <arpa/inet.h>

For whatever reason FreeBSD renames several functions provided by
<arpa/inet.h> and uses weak references to provide the standard function
names.  This causes problems on targets lacking proper support for weak
references.  We do not need this function renaming on RTEMS.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoDon't overread or write memory returned by _DTOA_R
Silviu Baranga [Mon, 5 Jun 2017 08:54:42 +0000 (09:54 +0100)]
Don't overread or write memory returned by _DTOA_R

Don't over-read memory returned by _DTOA_R, and never write to it
since the result might be a string literal.

For example, when doing:
  swprintf(tt, 20, L"%.*f", 6, 0.0);

we will get back "0".

Instead, write the result returned by _DTOA_R to the output buffer.
After this, write the 0 chars directly to the the output buffer
(if there are any). This also has the (marginal) advantage that
we read/write less memory overall.

7 years agoAdd COMODO Internet Security and ConEmu to BLODA
David Macek [Thu, 8 Jun 2017 12:48:53 +0000 (14:48 +0200)]
Add COMODO Internet Security and ConEmu to BLODA

ConEmu: There has been at least one report of it causing crashes <https://github.com/Maximus5/ConEmu/issues/1158>

COMODO Internet Security: Causing GPG failures <https://github.com/msys2/msys2/issues/38>

7 years agoFix RTEMS ioctl() declaration
Sebastian Huber [Wed, 7 Jun 2017 09:05:38 +0000 (11:05 +0200)]
Fix RTEMS ioctl() declaration

Using uint32_t for ioctl_command_t does not work well on 64-bit targets.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoUpdate FreeBSD revision of RTEMS <sys/bitset.h>
Sebastian Huber [Wed, 7 Jun 2017 06:40:48 +0000 (08:40 +0200)]
Update FreeBSD revision of RTEMS <sys/bitset.h>

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFix some RTEMS CPUSET(9) macros
Sebastian Huber [Wed, 7 Jun 2017 07:17:23 +0000 (09:17 +0200)]
Fix some RTEMS CPUSET(9) macros

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFix RTEMS CPU_EQUAL_S()
Sebastian Huber [Wed, 7 Jun 2017 06:38:22 +0000 (08:38 +0200)]
Fix RTEMS CPU_EQUAL_S()

According to the FreeBSD man page BIT_CMP() returns true in case the two
sets are NOT equal.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd myself to Write After Approval
Sebastian Huber [Wed, 7 Jun 2017 12:36:51 +0000 (14:36 +0200)]
Add myself to Write After Approval

7 years agoFix minor issues in memchr NEON implementation
Prakhar Bahuguna [Fri, 2 Jun 2017 09:22:32 +0000 (10:22 +0100)]
Fix minor issues in memchr NEON implementation

7 years agoPrint sign of NaN values.
Kito Cheng [Sat, 3 Jun 2017 13:41:29 +0000 (21:41 +0800)]
Print sign of NaN values.

7 years agocygwin: document lrint bugfix
Corinna Vinschen [Wed, 7 Jun 2017 09:07:52 +0000 (11:07 +0200)]
cygwin: document lrint bugfix

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: Fix lrint{f,l} to return a 64 bit long on x86_64
Corinna Vinschen [Wed, 7 Jun 2017 09:03:16 +0000 (11:03 +0200)]
cygwin: Fix lrint{f,l} to return a 64 bit long on x86_64

Mingw-w64 (where the code has been taken from) has 4 byte longs
independently of the architecture but x86_64 Cygwin has 64 bit longs.
So use fistpll instead of fistpl on x86_64 Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: document env var crash fix
Corinna Vinschen [Tue, 6 Jun 2017 19:11:52 +0000 (21:11 +0200)]
cygwin: document env var crash fix

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: Fix crash if env var name starts with non-ASCII char
Corinna Vinschen [Tue, 6 Jun 2017 19:10:23 +0000 (21:10 +0200)]
cygwin: Fix crash if env var name starts with non-ASCII char

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: document wcsxfrm fix
Corinna Vinschen [Tue, 6 Jun 2017 16:39:41 +0000 (18:39 +0200)]
cygwin: document wcsxfrm fix

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin wcsxfrm: byte swap result ourselves
Corinna Vinschen [Tue, 6 Jun 2017 16:27:47 +0000 (18:27 +0200)]
cygwin wcsxfrm: byte swap result ourselves

Workaround a bug (or undocumented behaviour) in LCMapStringW:

It's documented(*) that the cchDest parameter is a byte count with
LCMAP_SORTKEY, but a character count otherwise.  But the docs don't
state what happens if you combine LCMAP_SORTKEY with LCMAP_BYTEREV.

Tests indicate that LCMAP_SORTKEY treats cchDest as byte count, but
then LCMAP_BYTEREV treats it as char count in the same call.  So the
latter swaps twice as much bytes in the destination buffer than the
byte count it returns, which potentially results in writing past the
end of the given output buffer.

Solution: Don't specify LCMAP_BYTEREV in the LCMapStringW(LCMAP_SORTKEY)
call, rather byte swap afterwards.

(*) https://msdn.microsoft.com/en-us/library/windows/desktop/dd318702(v=vs.85).aspx

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix thinko in MSP430 libgloss implementation of write() system call.
Martin Young [Fri, 26 May 2017 10:35:13 +0000 (11:35 +0100)]
Fix thinko in MSP430 libgloss implementation of write() system call.

7 years agoUpdate COPYING.NEWLIB appropriately.
Jeff Johnston [Thu, 25 May 2017 16:52:18 +0000 (12:52 -0400)]
Update COPYING.NEWLIB appropriately.

7 years agoAdd de-facto standard <sys/ioctl.h> for RTEMS
Sebastian Huber [Mon, 22 May 2017 09:54:27 +0000 (11:54 +0200)]
Add de-facto standard <sys/ioctl.h> for RTEMS

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd some POSIX header files for RTEMS
Sebastian Huber [Mon, 22 May 2017 08:42:39 +0000 (10:42 +0200)]
Add some POSIX header files for RTEMS

Add the POSIX header files

  * arpa/inet.h
  * net/if.h
  * netdb.h
  * netinet/in.h
  * netinet/tcp.h
  * sys/socket.h
  * sys/syslog.h
  * sys/uio.h
  * sys/un.h
  * syslog.h
  * termios.h

and their dependencies for RTEMS.  The origin of these files is the
latest FreeBSD.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFreeBSD compatibility for RTEMS <sys/cpuset.h>
Sebastian Huber [Mon, 22 May 2017 05:39:55 +0000 (07:39 +0200)]
FreeBSD compatibility for RTEMS <sys/cpuset.h>

Make the RTEMS <sys/cpuset.h> compatible with the latest FreeBSD
version.

Fix the CPU_COPY() parameter order, see also:

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

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd __bitcount*() to RTEMS <machine/types.h>
Sebastian Huber [Mon, 22 May 2017 06:32:52 +0000 (08:32 +0200)]
Add __bitcount*() to RTEMS <machine/types.h>

Use a dedicated header file <machine/_bitcount.h> to avoid cyclic header
dependencies in future changes.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoMove ARM access.c from machine to sys
Sebastian Huber [Mon, 22 May 2017 07:34:31 +0000 (09:34 +0200)]
Move ARM access.c from machine to sys

The implementation of the POSIX access() function is nothing machine
specific like memcpy(), etc.  Move it back to the system domain.  This
avoids problems due to the include search order of the Newlib/GCC build
which picks up machine includes before system includes.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoIncrease MSIZE for RTEMS
Sebastian Huber [Fri, 19 May 2017 11:04:48 +0000 (13:04 +0200)]
Increase MSIZE for RTEMS

Increase the MSIZE for RTEMS to be in line with the latest FreeBSD
version.  The legacy network stack of RTEMS will provides its own
definition.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoFreeBSD compatibility for RTEMS <sys/param.h>
Sebastian Huber [Fri, 19 May 2017 09:56:13 +0000 (11:56 +0200)]
FreeBSD compatibility for RTEMS <sys/param.h>

Update the RTEMS <machine/param.h> and <sys/param.h> to be compatible
with the latest FreeBSD version.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoAdd generic <machine/_align.h> for RTEMS
Sebastian Huber [Fri, 19 May 2017 09:16:11 +0000 (11:16 +0200)]
Add generic <machine/_align.h> for RTEMS

It uses __BIGGEST_ALIGNMENT__ which is available in recent GCC and
LLVM/clang.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoARM/AArch64: Fix GetCmdLine semihosting directives newlib-snapshot-20170519
Laurent ALFONSI [Tue, 18 Apr 2017 15:50:16 +0000 (17:50 +0200)]
ARM/AArch64: Fix GetCmdLine semihosting directives

When simulating arm code, the target program startup code (crt0) uses
semihosting invocations to get the command line from the simulator. The
simulator returns the command line and its size into the area passed in
parameter. (ARM 32-bit specifications :
http://infocenter.arm.com/help/topic/com.arm.doc.dui0058d/DUI0058.pdf
chapter "5.4.19 SYS_GET_CMDLINE").

The memory area pointed by the semihosting register argument is located
in .text section (usually not writtable (RX)).

If we run this code on a simulator that respects this rights properties
(qemu user-mode for instance), the command line will not be written to
the .text program memory, in particular the length of the string. The
program runs with an empty command line. This problem hasn't been seen
earlier probably because qemu user-mode is not so much used, but this can
happen with another simulator that refuse to write in a read-only segment.

With this modification, the command line can be correctly passed to the
target program.

Changes:
- libgloss/arm/crt0.S : Arguments passed to the AngelSWI_Reason_GetCmdLine
  semihosting invocation are placed into .data section instead of .text
- libgloss/aarch64/crt0.S : Idem for aarch64 AngelSVC_Reason_GetCmdLine
  semihosting.

7 years agocygwin CONTRIBUTORS: Add Daniel Santos
Corinna Vinschen [Tue, 25 Apr 2017 12:26:36 +0000 (14:26 +0200)]
cygwin CONTRIBUTORS: Add Daniel Santos

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix transposed lines in 2.8.1 release text
Jon Turney [Mon, 24 Apr 2017 16:17:38 +0000 (17:17 +0100)]
Fix transposed lines in 2.8.1 release text

7 years agoUpdate 2.8.1 release text
Jon Turney [Mon, 24 Apr 2017 16:13:04 +0000 (17:13 +0100)]
Update 2.8.1 release text

7 years agocygwin: add 2.8.1 release file
Corinna Vinschen [Mon, 24 Apr 2017 15:36:54 +0000 (17:36 +0200)]
cygwin: add 2.8.1 release file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin TEST: Add nagging debug output to pinfo
Corinna Vinschen [Mon, 24 Apr 2017 15:35:06 +0000 (17:35 +0200)]
cygwin TEST: Add nagging debug output to pinfo

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: pinfo: do not wait for setting ppid on a transitional procinfo
Corinna Vinschen [Mon, 24 Apr 2017 15:34:31 +0000 (17:34 +0200)]
cygwin: pinfo: do not wait for setting ppid on a transitional procinfo

This leads to excessive lag when stracing processes if the inferior
process checks the process table.  The reason is that ppid isn't set
in the procinfo memory of the dynamically loading strace itself.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: try unprivileged symlink creation on W10 1703 and later
Corinna Vinschen [Mon, 24 Apr 2017 15:17:29 +0000 (17:17 +0200)]
cygwin: try unprivileged symlink creation on W10 1703 and later

Add new SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag to
CreateSymbolicLinkW call when running on W10 1703 or later.
Don't do that on older versions to avoid ERROR_INVALID_PARAMETER.

Preliminary, needs testing.  There's an off-chance that the
flag results in the same ERROR_INVALID_PARAMETER on 1703 if the
developer settings are not enabled.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: wincap: handle W10 1703
Corinna Vinschen [Mon, 24 Apr 2017 15:14:03 +0000 (17:14 +0200)]
cygwin: wincap: handle W10 1703

Add has_unprivileged_createsymlink flag and set to true on 1703 and
later.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: wincap: fix evaluation of build number
Corinna Vinschen [Mon, 24 Apr 2017 15:12:16 +0000 (17:12 +0200)]
cygwin: wincap: fix evaluation of build number

RtlGetNtVersionNumbers returns the build number with some upper bits
set for no apparent reason.  The fact that RtlGetNtVersionNumbers is
undocumented doesn't exactly help.

Just filter out the upper WORD for now.  If build numbers are in
danger to become 6 digit numbers, re-evaluate.

7 years agocygwin: remov unused winpids constructor
Corinna Vinschen [Mon, 24 Apr 2017 12:22:02 +0000 (14:22 +0200)]
cygwin: remov unused winpids constructor

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix stat.st_blocks for files compressed with CompactOS method
Christian Franke [Sat, 22 Apr 2017 12:50:58 +0000 (14:50 +0200)]
Fix stat.st_blocks for files compressed with CompactOS method

Always retrieve FileCompressionInformation for non-empty
files if FileStandardInformation returns 0 allocated blocks.
This fixes stat.st_blocks for files compressed with CompactOS method.

Signed-off-by: Christian Franke <franke@computer.org>
7 years agocygwin doc: Add postinstall/preremove scripts to install Start Menu entries
Brian Inglis [Fri, 21 Apr 2017 11:26:10 +0000 (13:26 +0200)]
cygwin doc: Add postinstall/preremove scripts to install Start Menu entries

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin CONTRIBUTORS: Add Brian Inglis
Corinna Vinschen [Sat, 22 Apr 2017 11:54:03 +0000 (13:54 +0200)]
cygwin CONTRIBUTORS: Add Brian Inglis

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin doc: install-html: Fix docbook.css and index.html symlink installation
Corinna Vinschen [Sat, 22 Apr 2017 11:49:27 +0000 (13:49 +0200)]
cygwin doc: install-html: Fix docbook.css and index.html symlink installation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoUpdate URLs for Cygwin packaging information newlib-snapshot-20170421
Jon Turney [Mon, 10 Apr 2017 18:32:47 +0000 (19:32 +0100)]
Update URLs for Cygwin packaging information

Also:
Remove obsolete reference to g-b-s
Remove mention of ancient pre-invisiconsole behaviour of setup scripts

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agostrace: Fix "over-optimization" flaw in strace.
Daniel Santos [Wed, 19 Apr 2017 16:06:02 +0000 (11:06 -0500)]
strace: Fix "over-optimization" flaw in strace.

Recent versions of gcc are optimizing away the TLS buffer allocated in
main, so we need to tell gcc that it's really used.  RtlSecureZeroMemory
accomplishes this while also inlining the memset.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
7 years agoFix relocation type for _bsssize being R_MSP430X_ABS16 when large memory model is...
Jozef Lawrynowicz [Wed, 19 Apr 2017 11:47:13 +0000 (11:47 +0000)]
Fix relocation type for _bsssize being R_MSP430X_ABS16 when large memory model is used

7 years agocygwin doc: install-html: install docbook.css
Corinna Vinschen [Wed, 19 Apr 2017 08:09:16 +0000 (10:09 +0200)]
cygwin doc: install-html: install docbook.css

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin doc: install-html: link index.html instead of copying
Corinna Vinschen [Wed, 19 Apr 2017 08:08:28 +0000 (10:08 +0200)]
cygwin doc: install-html: link index.html instead of copying

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd __packed to struct ldieee
Kito Cheng [Sat, 8 Apr 2017 16:06:06 +0000 (00:06 +0800)]
Add __packed to struct ldieee

 - We don't want any padding in struct ldieee, otherwise the offset
   might wrong in most compiler.

7 years agolibgloss/arm: fix discovery of "eabihf" toolchains
Carlos Santos [Thu, 13 Apr 2017 23:17:37 +0000 (20:17 -0300)]
libgloss/arm: fix discovery of "eabihf" toolchains

ARM EABI toolchains can optionally use the "hf" suffix to identify
hardware floating point support. Use the "*-*-eabi*" pattern to match
these toolchains.

Original patch by Bryan Hundven for the Crosstool-NG project. Improved
by Alexey Neyman.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
CC: Bryan Hundven <bryanhundven@gmail.com
CC: Alexey Neyman <stilor@att.net>
7 years agonewlib: remove __infinity{f,ld} constants
Corinna Vinschen [Tue, 18 Apr 2017 10:17:26 +0000 (12:17 +0200)]
newlib: remove __infinity{f,ld} constants

previous commit 4c90db7bc89e7fa1077025fefdd58269dc71a6ac introduced
a compile time error because libm/common/s_infconst.c used the remove
__fmath, __dmath, and __ldmath union types.

Since this is very old, and unused for a very long time, just drop the
file and thus the __infinity constants entirely.

Exception: Cygwin exports __infinity from the beginning.  There's a very,
VERY low probability that any existing executable or lib still uses this
constant, but we just keep it in for backward compat, nevertheless.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRemove legacy unions which are no longer used
Jeff Johnston [Mon, 17 Apr 2017 23:21:07 +0000 (19:21 -0400)]
Remove legacy unions which are no longer used

- remove __fmath, __dmath, and __ldmath unions

7 years agoAvoid decimal point localization in /proc/loadavg
Jon Turney [Sat, 8 Apr 2017 12:39:44 +0000 (13:39 +0100)]
Avoid decimal point localization in /proc/loadavg

Explicitly format the contents of /proc/loadavg to avoid the decimal point
getting localized according to LC_NUMERIC. Using anything other than '.' is
wrong and breaks top.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoOptimise memchr for NEON-enabled processors
Prakhar Bahuguna [Thu, 26 Jan 2017 10:06:10 +0000 (10:06 +0000)]
Optimise memchr for NEON-enabled processors

7 years agomkvers.sh: Remove "function" to avoid dash objecting to bash-ism.
Mark Geisert [Thu, 6 Apr 2017 05:20:09 +0000 (22:20 -0700)]
mkvers.sh: Remove "function" to avoid dash objecting to bash-ism.

7 years agoMake ldd stop after any non-continuable exception
Jon Turney [Tue, 4 Apr 2017 17:47:44 +0000 (18:47 +0100)]
Make ldd stop after any non-continuable exception

Ensure that ldd always stops when the exception is flagged as
non-continuable.

Also arrange for ldd to exit with a non-zero exit code if something went
wrong which prevented us from listing all dynamic dependencies.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoCygwin: Export reallocarray
Corinna Vinschen [Tue, 4 Apr 2017 10:23:18 +0000 (12:23 +0200)]
Cygwin: Export reallocarray

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoBump Cygwin to 2.8.1
Corinna Vinschen [Tue, 4 Apr 2017 10:23:09 +0000 (12:23 +0200)]
Bump Cygwin to 2.8.1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoAdd BSD-specific reallocarray()
Sebastian Huber [Tue, 4 Apr 2017 10:06:57 +0000 (12:06 +0200)]
Add BSD-specific reallocarray()

It is available in FreeBSD, NetBSD and OpenBSD, but not in glibc.  It is
used for example by OpenSSH.

7 years agoRenumber copyright clause 4
imp [Tue, 4 Apr 2017 10:00:31 +0000 (12:00 +0200)]
Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96

7 years agoqueue.3: Document existing QMD_* macros
cem [Tue, 4 Apr 2017 10:00:30 +0000 (12:00 +0200)]
queue.3: Document existing QMD_* macros

Feedback from: bapt, bdrewery, emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D3983

7 years agoqueue(3): Enhance queue debugging macros
cem [Tue, 4 Apr 2017 10:00:29 +0000 (12:00 +0200)]
queue(3): Enhance queue debugging macros

Split the QUEUE_MACRO_DEBUG into QUEUE_MACRO_DEBUG_TRACE and
QUEUE_MACRO_DEBUG_TRASH.

Add the debug macrso QMD_IS_TRASHED() and QMD_SLIST_CHECK_PREVPTR().

Document these in queue.3.

Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D3984

7 years agoAdd two new macros, SLIST_CONCAT and LIST_CONCAT
mckusick [Tue, 4 Apr 2017 10:00:28 +0000 (12:00 +0200)]
Add two new macros, SLIST_CONCAT and LIST_CONCAT

Add two new macros, SLIST_CONCAT and LIST_CONCAT. Note in both the
queue.h header file and in the queue.3 manual page that they are O(n) so
should be used only in low-usage paths with short lists (otherwise an
STAILQ or TAILQ should be used).

Reviewed by: kib

7 years agoMake the <sys/queue.h> fully usable within C++
hselasky [Tue, 4 Apr 2017 10:00:27 +0000 (12:00 +0200)]
Make the <sys/queue.h> fully usable within C++

Make the system queue header file fully usable within C++ programs by
adding macros to define class lists.

This change is backwards compatible for all use within C and C++
programs. Only C++ programs will have added support to use the queue
macros within classes. Previously the queue macros could only be used
within structures.

The queue.3 manual page has been updated to describe the new
functionality and some alphabetic sorting has been done while
at it.

Differential Revision: https://reviews.freebsd.org/D2745
PR: 200827 (exp-run)
MFC after: 2 weeks

7 years agoPass macro arguments properly.
hselasky [Tue, 4 Apr 2017 10:00:26 +0000 (12:00 +0200)]
Pass macro arguments properly.

MFC after: 1 week

7 years agoFix order of arguments in the TRACEBUF_INITIALIZER
hselasky [Tue, 4 Apr 2017 10:00:25 +0000 (12:00 +0200)]
Fix order of arguments in the TRACEBUF_INITIALIZER

Fix order of arguments in the TRACEBUF_INITIALIZER macro so that we can
define QUEUE_MACRO_DEBUG to debug list problems.

MFC after: 1 week

7 years agoAdd new FOREACH_FROM variants for queue(3)
lstewart [Tue, 4 Apr 2017 10:00:24 +0000 (12:00 +0200)]
Add new FOREACH_FROM variants for queue(3)

Add new FOREACH_FROM variants of the queue(3) FOREACH macros which can
optionally start the traversal from a previously found element by
passing the element in as "var". Passing a NULL "var" retains the same
semantics as the regular FOREACH macros.

Kudos to phk for suggesting the "FROM" suffix instead of my original
proposal.

Reviewed by: jhb (previous version), rpaulo
MFC after: 1 week

7 years agoRenumber copyright clause 4
imp [Tue, 4 Apr 2017 07:04:59 +0000 (09:04 +0200)]
Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96

7 years agodon't use C99 static array indices with older GCC versions
avg [Tue, 4 Apr 2017 07:04:58 +0000 (09:04 +0200)]
don't use C99 static array indices with older GCC versions

For example, the FreeBSD GCC (4.2.1) has a spotty support for that
feature.  If the static keyword is used with an unnamed array parameter
in a function declaration, then the compilation fails with:
error: static or type qualifiers in abstract declarator

The feature does work if the parameter is named.
So, the restriction introduced in this commit can be removed when all
affected function prototypes have the workaround.

MFC after: 1 week
Sponsored by: Panzura

7 years agoAddition of clang nullability qualifiers.
pfg [Tue, 4 Apr 2017 07:04:57 +0000 (09:04 +0200)]
Addition of clang nullability qualifiers.

For consistency with the qualifiers added in r310977, define a new
qualifier _Null_unspecified which is also defined in clang 3.7+.

Add two new macros:
__NULLABILITY_PRAGMA_PUSH
__NULLABILITY_PRAGMA_POP

These are for use in headers when we want avoid noisy warnings if
some pointers are left without nullability annotations.

These are added with way ahead of their first use to teach the GCC
ports headers of their existance before their first use.

7 years agoRemove unused __gnu_inline() attribute.
pfg [Tue, 4 Apr 2017 07:04:56 +0000 (09:04 +0200)]
Remove unused __gnu_inline() attribute.

This was meant to be used by a future FORTIFY_SOURCE implementation.
Probably for good, FORTIFY_SOURCE and this particular GCCism were never
well supported by clang or other compilers. Furthermore, the technology
has long since been replaced by either static checkers, sanitizers, or
even just the strong stack protector that was enabled by default.

Drop __gnu_inline to avoid cluttering the headers.

MFC after: 5 days

7 years agoAddition of clang nullability qualifiers.
pfg [Tue, 4 Apr 2017 07:04:55 +0000 (09:04 +0200)]
Addition of clang nullability qualifiers.

Add two new qualifiers for use by the static checkers:

_Nonnull
The _Nonnull nullability qualifier indicates that null is not a meaningful
value for a value of the _Nonnull pointer type.

_Nullable
The _Nullable nullability qualifier indicates that a value of the
_Nullable pointer type can be null.

These were introduced in Clang 3.7. For more information, see:
http://clang.llvm.org/docs/AttributeReference.html#nonnull

We add these now without using them so that the GCC ports have time to
pick up the header change.

Hinted by: Android Bionic libc [1]
Also seen in: Apple's Libc-1158.20.4

[1]
https://github.com/android/platform_bionic/commit/baa2a973bd776a51bb05a8590ab05d86eea7b321

7 years agoFix C++ includability of crypto headers with static array sizes
asomers [Tue, 4 Apr 2017 07:04:54 +0000 (09:04 +0200)]
Fix C++ includability of crypto headers with static array sizes

C99 allows array function parameters to use the static keyword for their
sizes. This tells the compiler that the parameter will have at least the
specified size, and calling code will fail to compile if that guarantee is
not met. However, this syntax is not legal in C++.

This commit reverts r300824, which worked around the problem for
sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can
be used in headers as a static array size, but will still compile in C++
mode.

Reviewed by: cem, ed
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8277

fix a typo in __STDC_VERSION__ in __min_size requirements

MFC after: 1 week
Sponsored by: Panzura

7 years agoStop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++.
dim [Tue, 4 Apr 2017 07:04:53 +0000 (09:04 +0200)]
Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++.

It clashes with the one in libc++'s <atomic> header.

(Previously, the _Atomic() macro was defined in <stdatomic.h>, which is
only for use with C11, but for various reasons it was moved to its
current location in r251804.)

Discussed with: bdrewery, ed
MFC after: 2 weeks

7 years agoRename __sentinel to __null_sentinel
pfg [Tue, 4 Apr 2017 07:04:52 +0000 (09:04 +0200)]
Rename __sentinel to __null_sentinel

GCC 5 uses a conflicting __sentinel definition in include/c++/bits/stl_algo.h

Reported by: matteo

7 years agoUse enum __packed in favour of -fshort-enums
Sebastian Huber [Fri, 31 Mar 2017 09:00:42 +0000 (11:00 +0200)]
Use enum __packed in favour of -fshort-enums

Some architectures like ARM encode the short enum option state in the
object file and the linker checks that this option is consistent for all
objects of an executable.  In case applications use -fno-short-enums,
then this leads to linker warnings.  Use the enum __packed attribute for
the relevent enums to avoid the -fshort-enums compiler option.  This
attribute is at least available on GCC, LLVM/clang and the Intel
compiler.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
7 years agoUse .syntax unified instead of .syntax divided. cygwin-2_8_0-release
Catherine Moore [Thu, 30 Mar 2017 14:26:23 +0000 (07:26 -0700)]
Use .syntax unified instead of .syntax divided.

7 years agoAdd latest changes to Cygwin release information
Corinna Vinschen [Tue, 28 Mar 2017 11:42:11 +0000 (13:42 +0200)]
Add latest changes to Cygwin release information

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoChange CURR_SHARED_MAGIC to account for getloadavg patch
Corinna Vinschen [Tue, 28 Mar 2017 11:41:31 +0000 (13:41 +0200)]
Change CURR_SHARED_MAGIC to account for getloadavg patch

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoImplement getloadavg()
Jon Turney [Tue, 21 Mar 2017 19:17:42 +0000 (19:17 +0000)]
Implement getloadavg()

v2:
autoload PerfDataHelper functions
Keep loadavg in shared memory
Guard loadavg access by a mutex
Initialize loadavg to the current load

v3:
Shared memory version bump isn't needed if we are only extending it
Remove unused autoload
Mark inititalized flags as NO_COPY for correct behaviour in fork child

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agodeclaration of ppoll() by poll.h should be guarded by _GNU_SOURCE
Jon Turney [Mon, 27 Mar 2017 14:19:36 +0000 (15:19 +0100)]
declaration of ppoll() by poll.h should be guarded by _GNU_SOURCE

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
7 years agoRecognize Netapp mode supporting reparse points
Corinna Vinschen [Mon, 27 Mar 2017 18:28:03 +0000 (20:28 +0200)]
Recognize Netapp mode supporting reparse points

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygwin: Do not generate surrogate chars on netapp
Corinna Vinschen [Fri, 24 Mar 2017 19:52:16 +0000 (20:52 +0100)]
cygwin: Do not generate surrogate chars on netapp

Just like Samba, Netapp FSes seem to dislike invalid surrogate usage in
filenames.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoDocument cygserver changes
Corinna Vinschen [Fri, 24 Mar 2017 17:13:08 +0000 (18:13 +0100)]
Document cygserver changes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygserver: Speed up non-debug scenario
Corinna Vinschen [Fri, 24 Mar 2017 16:26:37 +0000 (17:26 +0100)]
cygserver: Speed up non-debug scenario

_log/_vlog were always called so we always had a function call hit even
if we're not debugging.  Expand on the debugging macros so the decision
to call _log/_vlog is done in the caller already.  Also, make a log level
difference between syscall_printf and system_printf.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygserver: Small code cleanup
Corinna Vinschen [Fri, 24 Mar 2017 15:46:17 +0000 (16:46 +0100)]
cygserver: Small code cleanup

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygserver: Revamp thread sleep handling
Corinna Vinschen [Fri, 24 Mar 2017 15:45:32 +0000 (16:45 +0100)]
cygserver: Revamp thread sleep handling

The current implementation is a very simple approach to implement
a statically sized sleep queue.  The problem is that this code requires
a certain amount of synchronization because the slots in the queue are
used dynamically.  To top it off, the Event objects used for sync'ing
are created and destroyed on demand.  This is complicated, slow, and
error prone.

There's also a blatant bug here: The number of slots in the queue was
wrongly computed in size.  It was too small if XSI IPC was used a lot.

Make the code more robust.  Let the queue have the right size.  Every
slot is now used for a specific IPC object.  All sync objects (switched
to Semaphores) are only created when first required, but never destroyed.
This reduces the usage of a critical section to the creation of a new
sync object.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygserver: raise number of worker threads on demand
Corinna Vinschen [Fri, 24 Mar 2017 15:18:26 +0000 (16:18 +0100)]
cygserver: raise number of worker threads on demand

The number of threads in the worker pool is fixed so far.  This is a
problem in XSI IPC scenarions with an unknown number of consumers.
It doesn't make sense to make the pool very big for a start, but when
the need arises, we need to make sure we can serve the request even if
all other worker threads are in a wait state.

This patch changes threaded_queue to just add another worker thread
if all current workers are busy.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygserver: Only print basename of source in debug output to raise readability
Corinna Vinschen [Fri, 24 Mar 2017 15:12:52 +0000 (16:12 +0100)]
cygserver: Only print basename of source in debug output to raise readability

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agocygserver: Seralize debug output to stdout to raise readability
Corinna Vinschen [Fri, 24 Mar 2017 15:12:00 +0000 (16:12 +0100)]
cygserver: Seralize debug output to stdout to raise readability

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agodlfcn: Remove stray debug output newlib-snapshot-20170323
Corinna Vinschen [Wed, 22 Mar 2017 10:10:15 +0000 (11:10 +0100)]
dlfcn: Remove stray debug output

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRename <sys/_locale.h> to <xlocale.h>
Yaakov Selkowitz [Tue, 21 Mar 2017 20:21:30 +0000 (15:21 -0500)]
Rename <sys/_locale.h> to <xlocale.h>

The locale_t type is provided by <xlocale.h> on Linux, FreeBSD, and Darwin.
While, like on some of those systems, it is automatically included by
<locale.h> with the proper feature test macros, its presence under this
particular name is still presumed in real-world software.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
7 years agoARM: Fix IEEE-754 sqrt implementation
Sebastian Huber [Tue, 21 Mar 2017 14:47:34 +0000 (15:47 +0100)]
ARM: Fix IEEE-754 sqrt implementation

Older GCC (e.g. 4.9.3) seem to define __ARM_FP even in case soft-float
is used.

7 years agoARM: Optimize IEEE-754 sqrt implementation
Sebastian Huber [Tue, 21 Mar 2017 07:49:00 +0000 (08:49 +0100)]
ARM: Optimize IEEE-754 sqrt implementation

Use the vsqrt.f64 and vsqrt.f32 instructions if available.

7 years agoCygwin: dlfcn: Fix reference counting
Corinna Vinschen [Tue, 21 Mar 2017 13:30:24 +0000 (14:30 +0100)]
Cygwin: dlfcn: Fix reference counting

The original dll_init code was living under the wrong assumption that
dll_dllcrt0_1 and in turn dll_list::alloc will be called for each
LoadLibrary call.  The same wrong assumption was made for
cygwin_detach_dll/dll_list::detach called via FreeLibrary.

In reality, dll_dllcrt0_1 gets only called once at first LoadLibrary
and cygwin_detach_dll once at last FreeLibrary.

In effect, reference counting for DLLs was completely broken after fork:

  parent:
    l1 = dlopen ("lib1");  // LoadLibrary, LoadCount = 1
    l2 = dlopen ("lib1");  // LoadLibrary, LoadCount = 2

    fork ();               // LoadLibrary in the child, LoadCount = 1!
      child:
        dlclose (l1);      // FreeLibrary actually frees the lib
        x = dlsym (l2);    // SEGV

* Move reference counting to dlopen/dlclose since only those functions
  have to keep track of loading/unloading DLLs in the application context.

* Remove broken accounting code from dll_list::alloc and dll_list::detach.

* Fix error handling in dlclose.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agolibc/string/strsignal.c: Use of || not && lead to dead code.
Joel Sherrill [Wed, 15 Mar 2017 17:04:22 +0000 (12:04 -0500)]
libc/string/strsignal.c: Use of || not && lead to dead code.

Coverity Id: 175333

7 years agortems/crt0.c: getentropy() stub did not return a value.
Joel Sherrill [Wed, 15 Mar 2017 14:37:22 +0000 (09:37 -0500)]
rtems/crt0.c: getentropy() stub did not return a value.

Coverity Scan ID: 175342

7 years agoAdd release message for commit 973f766f6
Corinna Vinschen [Tue, 14 Mar 2017 15:54:57 +0000 (16:54 +0100)]
Add release message for commit 973f766f6

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoRevert "Add release message for commit 973f766f6"
Corinna Vinschen [Tue, 14 Mar 2017 15:52:20 +0000 (16:52 +0100)]
Revert "Add release message for commit 973f766f6"

This reverts commit 125852d77b65fe2155d0d5fa97e53fc9e2b29984.

Accidentally commited too much.

7 years agoAdd release message for commit 973f766f6
Corinna Vinschen [Tue, 14 Mar 2017 08:24:48 +0000 (09:24 +0100)]
Add release message for commit 973f766f6

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoFix duplocale (libc/locale/duplocale.c) which fails to properly call __loadlocale
Koichi Murase [Sat, 11 Mar 2017 16:27:26 +0000 (01:27 +0900)]
Fix duplocale (libc/locale/duplocale.c) which fails to properly call __loadlocale

Problem:

  After  passing  locales  created  by  'duplocale'   to   'uselocale',
  referencing   'MB_CUR_MAX',   which   is   actually   expanded    to
  '__locale_mb_cur_max()' by preprocessors, causes segmentation faults.
  Direct use of locales from 'newlocale' does not  cause  the  problem.
  This is the problem of 'duplocale'.

  $ echo $LANG
  ja_JP.UTF-8
  $ cat test.c
  #include <stdlib.h>
  #include <locale.h>

  volatile int var;

  int main(void) {
    locale_t const loc = newlocale(LC_ALL_MASK, "", NULL);
    locale_t const dup = duplocale(loc);
    locale_t const old = uselocale(dup);
    var = MB_CUR_MAX; /* <-- crashes here */
    uselocale(old);
    freelocale(dup);
    freelocale(loc);
    return 0;
  }
  $ gcc test.c
  $ ./a
  Segmentation fault (core dumped)

  # Note: "core dumped" in the above message was  actually written  in
  # Japanese, but I translated the part to post a mail in English.

Bug:

  In the beginning of '__loadlocale' (newlib/libc/locale/locale.c:501),
  there is a code which checks if the operations can be skipped:

  > /* Avoid doing everything twice if nothing has changed. */
  > if (!strcmp (new_locale, loc->categories[category]))
  >   return loc->categories[category];

  While,   in   the   function   '_duplocale_r'    (newlib/libc/locale/
  duplocale.c), '__loadlocale'  is  called  as  in  the  quoted  codes:

  > /* If the object is not a "C" locale category, copy it.  Just call
  >    __loadlocale.  It knows what to do to replicate the category. */
  > tmp_locale.lc_cat[i].ptr = NULL;
  > tmp_locale.lc_cat[i].buf = NULL;
  > if (!__loadlocale (&tmp_locale, i, tmp_locale.categories[i]))
  >   goto error;

  This call of '__loadlocale' results in the skip check being

    !strcmp(tmp_locale.categories[i], tmp_locale.categories[i]),

  which is always true. This  means  that  the  actual  operations  of
  '__loadLocale' will never be performed for 'duplocale'.

Fix:

  The call of '__loadlocale' in '_duplocale_r' is modified.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
7 years agoExtend 2.8.0 release text
Corinna Vinschen [Sun, 12 Mar 2017 11:21:40 +0000 (12:21 +0100)]
Extend 2.8.0 release text

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This page took 0.071692 seconds and 5 git commands to generate.