]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
8 years agoAdd necessary braces to if statements
Peter Foley [Sat, 19 Mar 2016 17:45:49 +0000 (13:45 -0400)]
Add necessary braces to if statements

The missing braces cause only the first expression to be guarded by the
else clause.

winsup/cygwin/ChangeLog
* fhandler_disk_file.cc (facl): Add missing braces to if statement.
* mount.cc (dos_drive_mappings): Add missing braces to if statement.

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
8 years agoRemove dead code from fhandler_console.
Peter Foley [Sat, 19 Mar 2016 17:45:48 +0000 (13:45 -0400)]
Remove dead code from fhandler_console.

This if is unconditionally false, so remove it.

winsup/cygwin/fhandler_console.cc: In member function 'bool dev_console::fillin(HANDLE)':
winsup/cygwin/fhandler_console.cc:740:22: error: self-comparison always evaluates to false [-Werror=tautological-compare]
       if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
           ~~~~~~~~~~~^~~~~~~~~~~~~
winsup/cygwin/fhandler_console.cc:740:50: error: self-comparison always evaluates to false [-Werror=tautological-compare]
       if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
                                       ~~~~~~~~~~~^~~~~~~~~~~~~

winsup/cygwin/ChangeLog
* fhandle_console.cc (fillin): remove dead code

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
8 years agoRemove unused and unsafe call to __builtin_frame_address
Peter Foley [Sat, 19 Mar 2016 17:45:47 +0000 (13:45 -0400)]
Remove unused and unsafe call to __builtin_frame_address

initial_sp has been unused since commit fbf23e3 back in 2000.
Keep the value, so as to avoid changing the offset of magic_biscuit.

winsup/cygwin/lib/_cygwin_crt0_common.cc:140:52:
error: calling 'void* __builtin_frame_address(unsigned int)' with a
nonzero argument is unsafe [-Werror=frame-address]
   u->initial_sp = (char *) __builtin_frame_address (1);

winsup/cygwin/ChangeLog
lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize initial_sp
with nullptr.

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
8 years agowinsup: Move all old CVS Changelogs into CVSChangeLogs.old dir
Corinna Vinschen [Sat, 19 Mar 2016 12:59:52 +0000 (13:59 +0100)]
winsup: Move all old CVS Changelogs into CVSChangeLogs.old dir

8 years agoRemove ill-advised cygwin_props
Corinna Vinschen [Sat, 19 Mar 2016 12:21:18 +0000 (13:21 +0100)]
Remove ill-advised cygwin_props

Cygwin_props have been invented to allow switching off the unique
installation keys in the first place, supposedly for debugging.
This never really was a good idea, after all we *want* the installations
to be independent and there's no good reason to break that, not even
for debugging purposes.

Other than that, cygwin_props were meant to be used for some other global
settings which never took place.  There's just no good reason to tweak
the DLL binary invisibly where a setting could be done in a file or the
environment.

This patch removes the cygwin_props entirely, including the related
settings in cygcheck.

cygwin:
* cygprops.h: Remove file.
* globals.cc (cygwin_props): Remove.
* cygheap.cc (init_cygheap::init_installation_root): Drop removing
installation key.

utils:
* cygcheck.cc: Drop including cygprops.h.  Remove now unused option
values.
(unique_object_name_opt): Remove.
(handle_unique_object_name): Remove function.
(usage): Remove text for unique-object-names options.
(longopts): Remove unique-object-names options.
(main): Drop handling unique-object-names options.

doc:
* utils.xml (cygcheck): Remove text for unique-object-names options.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRegenerate configure script.
Jeff Johnston [Sat, 19 Mar 2016 04:27:59 +0000 (00:27 -0400)]
Regenerate configure script.

8 years agoRemove references to older Cygwin releases from documentation
Corinna Vinschen [Fri, 18 Mar 2016 21:52:04 +0000 (22:52 +0100)]
Remove references to older Cygwin releases from documentation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosparc64: move struct timeval to <sys/_timeval.h>
Yaakov Selkowitz [Fri, 18 Mar 2016 19:10:43 +0000 (14:10 -0500)]
sparc64: move struct timeval to <sys/_timeval.h>

commit bb0159489785d577ad0b8061a1ba7956ee0f89d0 moved the struct timeval
declaration from <sys/time.h> to <sys/_timeval.h>, and commit
01885f533de81ff73e9da1519a4b5f2316b49f86 changed <sys/select.h> to include
<sys/_timeval.h>.  Therefore, sparc64's own struct timeval needs to be
moved accordingly in order to avoid a conflict from the generic type.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
8 years agoFeature test macros overhaul: sparc64
Yaakov Selkowitz [Fri, 18 Mar 2016 19:08:07 +0000 (14:08 -0500)]
Feature test macros overhaul: sparc64

sparc64 has a number of its own headers which override the generic ones.
These too need to use feature test macros properly.

These changes correspond to the generic fcntl.h and sys/stat.h changes
in commit d2df6d381b36f3f76420bc3bab965fbbdc3c3a8c and
commit 069e400c913659432c5d1953c4fa9a696b06e340.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
8 years agoCleanup macros in chacha_private.h to be target-type independent
Howland, Craig D [Fri, 18 Mar 2016 18:18:15 +0000 (18:18 +0000)]
Cleanup macros in chacha_private.h to be target-type independent

* libc/stdlib/chacha_private.h (U8C, U32C): Remove un-necessary macros.
(U8V, U32V): Drop masking.

8 years agoOnly export arc4random_stir and arc4random_addrandom on Cygwin
Corinna Vinschen [Fri, 18 Mar 2016 20:12:12 +0000 (21:12 +0100)]
Only export arc4random_stir and arc4random_addrandom on Cygwin

Export to maintain backward compatibility, but don't let
them do anything useful.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFeature test macros overhaul: signal.h (part 2)
Yaakov Selkowitz [Fri, 18 Mar 2016 04:21:49 +0000 (23:21 -0500)]
Feature test macros overhaul: signal.h (part 2)

Move the sig*set macros following the functions inside their feature
test macro conditional.

This fixes the build on bare-metal targets following
commit 5c78499ae2ae6ac28854b43a1ad73d917b40c62d.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
8 years agoarm: fix build with newlib supplied syscalls enabled
Yaakov Selkowitz [Fri, 18 Mar 2016 03:11:14 +0000 (22:11 -0500)]
arm: fix build with newlib supplied syscalls enabled

In file included from libc/sys/arm/crt0.S:2:0:
libc/sys/arm/arm.h:32:25: fatal error: acle-compat.h: No such file or directory

acle-compat.h is libc/machine/arm.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoImplement getentropy for Cygwin
Corinna Vinschen [Fri, 18 Mar 2016 13:46:20 +0000 (14:46 +0100)]
Implement getentropy for Cygwin

* miscfuncs.cc (getentropy): Move fhandler_dev_random::crypt_gen_random
here and rename to getentropy.  Fix type and return values to match
getentropy requirements.
* miscfuncs.h (getentropy): Add prototype.
* fhandler.h (fhandler_dev_random::crypt_gen_random): Remove prototype.
* fhandler_random.cc (fhandler_dev_random::crypt_gen_random): Drop.
(fhandler_dev_random::write): Use getentropy instead.
(fhandler_dev_random::read): Ditto.
* fhandler_socket.cc (fhandler_socket::af_local_set_secret): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDelete Cygwin's arc4random in favor of new Newlib implementation
Corinna Vinschen [Fri, 18 Mar 2016 13:41:33 +0000 (14:41 +0100)]
Delete Cygwin's arc4random in favor of new Newlib implementation

* Makefile.in (DLL_OFILES): Remove arc4random.o.
* libc/arc4random.c: Remove file.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoArc4random locking: Check for threaded application on Cygwin
Corinna Vinschen [Fri, 18 Mar 2016 13:40:26 +0000 (14:40 +0100)]
Arc4random locking: Check for threaded application on Cygwin

        libc/stdlib/arc4random.h (_ARC4_LOCK): Special case Cygwin.
        (_ARC4_UNLOCK): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd arc4random_stir and arc4random_addrandom for OpenBSD compatibility
Corinna Vinschen [Fri, 18 Mar 2016 13:39:58 +0000 (14:39 +0100)]
Add arc4random_stir and arc4random_addrandom for OpenBSD compatibility

        * libc/stdlib/arc4random.c (arc4random_stir): New function.
        (arc4random_addrandom): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd arc4random() etc. from OpenBSD 5.8
Sebastian Huber [Fri, 18 Mar 2016 10:49:28 +0000 (11:49 +0100)]
Add arc4random() etc. from OpenBSD 5.8

According to the OpenBSD man page, "A Replacement Call for Random".  It
offers high quality random numbers derived from input data obtained by
the OpenBSD specific getentropy() system call which is declared in
<unistd.h> and must be implemented for each Newlib port externally.  The
arc4random() functions are used for example in LibreSSL and OpenSSH.

Cygwin provides currently its own implementation of the arc4random
family.  Maybe it makes sense to use this getentropy() implementation:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/crypto/getentropy_win.c?rev=1.4&content-type=text/x-cvsweb-markup

* libc/include/stdlib.h (arc4random): Declare if __BSD_VISIBLE.
(arc4random_buf): Likewise.
(arc4random_uniform): Likewise.
* libc/include/sys/unistd.h (getentropy): Likewise.
* libc/include/machine/_arc4random.h: New file.
* libc/stdlib/arc4random.c: Likewise.
* libc/stdlib/arc4random.h: Likewise.
* libc/stdlib/arc4random_uniform.c: Likewise.
* libc/stdlib/chacha_private.h: Likewise.
* libc/sys/rtems/include/machine/_arc4random.h: Likewise.
* libc/stdlib/Makefile.am (EXTENDED_SOURCES): Add arc4random.c
and arc4random_uniform.c.
* libc/stdlib/Makefile.in: Regenerate.

8 years agoAdd timingsafe_memcmp()
Sebastian Huber [Fri, 18 Mar 2016 10:49:27 +0000 (11:49 +0100)]
Add timingsafe_memcmp()

This function is used by LibreSSL and OpenSSH and is provided by the
OpenBSD libc.

* libc/include/string.h (timingsafe_memcmp): Declare.
* libc/string/timingsafe_memcmp.c: New file.
* libc/string/Makefile.am: Add new file.
* libc/string/Makefile.in: Regenerate.

8 years agoAdd timingsafe_bcmp()
Sebastian Huber [Fri, 18 Mar 2016 10:49:26 +0000 (11:49 +0100)]
Add timingsafe_bcmp()

This function is used by LibreSSL and OpenSSH and is provided by the
OpenBSD libc.

* libc/include/string.h (timingsafe_bcmp): Declare.
* libc/string/timingsafe_bcmp.c: New file.
* libc/string/Makefile.am: Add new file.
* libc/string/Makefile.in: Regenerate.

8 years agoAdd explicit_bzero()
Sebastian Huber [Fri, 18 Mar 2016 10:49:25 +0000 (11:49 +0100)]
Add explicit_bzero()

This function is used by LibreSSL and OpenSSH and is provided by the
OpenBSD libc.

* libc/include/string.h (explicit_bzero): Declare.
* libc/string/explicit_bzero.c: New file.
* libc/string/Makefile.am: Add new file.
* libc/string/Makefile.in: Regenerate.

8 years agoGuard ssize_t definition by _SSIZE_T_DECLARED
Sebastian Huber [Fri, 18 Mar 2016 10:49:24 +0000 (11:49 +0100)]
Guard ssize_t definition by _SSIZE_T_DECLARED

This guard is used by FreeBSD <sys/socket.h> for example.  The FreeBSD
network stack is used in RTEMS.

* newlib/libc/include/sys/types.h (ssize_t): Guard by
_SSIZE_T_DECLARED.

8 years agoCygwin: define byteswap.h inlines as macros
Yaakov Selkowitz [Tue, 15 Mar 2016 03:11:20 +0000 (22:11 -0500)]
Cygwin: define byteswap.h inlines as macros

The bswap_* "functions" are macros in glibc, so they may be tested for
by the preprocessor (e.g. #ifdef bswap_16).

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: Cygwin headers
Yaakov Selkowitz [Tue, 15 Mar 2016 02:24:29 +0000 (21:24 -0500)]
Feature test macros overhaul: Cygwin headers

Use proper internal macros for BSD and GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: sys/types.h
Yaakov Selkowitz [Tue, 15 Mar 2016 02:20:02 +0000 (21:20 -0500)]
Feature test macros overhaul: sys/types.h

The u_int/u_char/etc. BSD types are needed by Cygwin's netinet/*.h
headers, so they always need to be available.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoRevert "Remove inclusion of sys/select.h in sys/types.h for backward compat"
Yaakov Selkowitz [Tue, 15 Mar 2016 01:50:45 +0000 (20:50 -0500)]
Revert "Remove inclusion of sys/select.h in sys/types.h for backward compat"

This BSDism is still in use (e.g. putty).

This reverts commit 088f7a723962dd18dcae09e8e8fa168bbea6ed0b.

8 years agoFeature test macros overhaul: sys/time.h
Yaakov Selkowitz [Tue, 15 Mar 2016 02:14:39 +0000 (21:14 -0500)]
Feature test macros overhaul: sys/time.h

The inclusion of <sys/select.h> is required also by POSIX.1-2001.
setitimer is XSI, and futimesat is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: sys/stat.h
Yaakov Selkowitz [Tue, 15 Mar 2016 01:57:45 +0000 (20:57 -0500)]
Feature test macros overhaul: sys/stat.h

Replace all !_POSIX_SOURCE with BSD.  All *at functions depend on
ATFILE; futimens is POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: sys/select.h
Yaakov Selkowitz [Mon, 14 Mar 2016 22:31:12 +0000 (17:31 -0500)]
Feature test macros overhaul: sys/select.h

Remove !_POSIX_SOURCE conditional; pselect is POSIX.1-2001.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: wchar.h
Yaakov Selkowitz [Mon, 14 Mar 2016 22:24:48 +0000 (17:24 -0500)]
Feature test macros overhaul: wchar.h

open_wmemstream is POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: unistd.h
Yaakov Selkowitz [Tue, 15 Mar 2016 02:03:34 +0000 (21:03 -0500)]
Feature test macros overhaul: unistd.h

Throughout, use proper internal macros for functions, including those
marked as target-specific.  Use ATFILE for all *at functions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: time.h
Yaakov Selkowitz [Mon, 14 Mar 2016 22:23:09 +0000 (17:23 -0500)]
Feature test macros overhaul: time.h

Throughout, replace __STRICT_ANSI__ with the proper internal macros.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: strings.h
Yaakov Selkowitz [Mon, 14 Mar 2016 22:20:38 +0000 (17:20 -0500)]
Feature test macros overhaul: strings.h

Replace __STRICT_ANSI__ with the proper internal macros for bcmp etc.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: string.h
Yaakov Selkowitz [Mon, 14 Mar 2016 22:13:42 +0000 (17:13 -0500)]
Feature test macros overhaul: string.h

Throughout, remove __STRICT_ANSI__ and use the proper internal macros.

bcmp, bcopy, bzero, index, and rindex were in POSIX prior to 2008.

memrchr is GNU.

strdup and strndup are POSIX.1-2008.

The int-returning form of strerror_r is POSIX.1-2001.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: stdlib.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:55:26 +0000 (16:55 -0500)]
Feature test macros overhaul: stdlib.h

Throughout, simplify the C99/C11 conditionals, and replace
__STRICT_ANSI__ with the proper internal POSIX macros.  The _*_r
reentrant functions need not be guarded (and most haven't been) because
such names in the global scope are reserved to the implementation.

atoff is unique to newlib.

dtoa is not actually exported (_dtoa_r is used internally), is
nonstandard, and the declaration conflicts with the code included in
MySQL, NSPR, and SpiderMonkey.

mktemp was removed in POSIX.1-2001.

The qsort_r declarations are reordered so that the GNU version retains
precedence.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: stdio.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:40:44 +0000 (16:40 -0500)]
Feature test macros overhaul: stdio.h

Throughout, remove references to __STRICT_ANSI__ and use the proper
internal macros and versions for C99, POSIX, ATFILE for the various *at
functions, or LARGEFILE for fseeko and ftello.

[v]asprintf are GNU extensions, but the *iprintf, *iscanf, and
*asnprintf functions are unique to newlib.

getw and putw were removed from POSIX.1-2001. funopen is BSD, and
fopencookie is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: signal.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:39:56 +0000 (16:39 -0500)]
Feature test macros overhaul: signal.h

Use proper internal macros for BSD sig_t and GNU sighandler_t.

sigaltstack and friends are XSI even in SUSv4 but in glibc are
nonetheless handled as POSIX.1-2008 (not 2001).

The requirement for the ucontext_t typedef in signal.h was XSI prior to
POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: pwd.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:36:13 +0000 (16:36 -0500)]
Feature test macros overhaul: pwd.h

getpw*_r dates back to POSIX.1c, and *pwent to XPG4v2.  Both are also BSD.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: pthread.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:35:32 +0000 (16:35 -0500)]
Feature test macros overhaul: pthread.h

Use internal macros for GNU extensions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: math.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:26:18 +0000 (16:26 -0500)]
Feature test macros overhaul: math.h

Simplify the C99 conditionals.  Mark the drem and gamma functions as
BSD|SVID, the Bessel double functions also XSI and the floats also SUSv3.
signgam is BSD|SVID|XSI, and matherr is SVID.  Finally, use the internal
macros to control the symbolic constants.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: limits.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:25:18 +0000 (16:25 -0500)]
Feature test macros overhaul: limits.h

Simplify the C99 conditional, and use the internal macro for GNU extensions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: grp.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:21:34 +0000 (16:21 -0500)]
Feature test macros overhaul: grp.h

_PATH_GROUP is a BSDism. getgr*_r are BSD|SVID|POSIX, and the *grent
functions are BSD|SVID|XPG4v2.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: fnmatch.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:19:42 +0000 (16:19 -0500)]
Feature test macros overhaul: fnmatch.h

Use the proper internal macro for GNU extensions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: fcntl.h
Yaakov Selkowitz [Mon, 14 Mar 2016 22:26:08 +0000 (17:26 -0500)]
Feature test macros overhaul: fcntl.h

Most of the !_POSIX_SOURCE code is BSD, although ironically some were
added to POSIX.1-2001.

Use the ATFILE conditional for most of the *at functions, except
futimesat which is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: dirent.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:17:38 +0000 (16:17 -0500)]
Feature test macros overhaul: dirent.h

MAXNAMLEN is a BSDism.

Use the proper internal macros instead of !_POSIX_SOURCE.  telldir and
seekdir are XSI, scandir and alphasort are POSIX.1-2008, and scandirat
is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: ctype.h
Yaakov Selkowitz [Mon, 14 Mar 2016 21:14:59 +0000 (16:14 -0500)]
Feature test macros overhaul: ctype.h

Simplify C99 test for isblank.  isascii and toascii are BSD|SVID|XSI.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFeature test macros overhaul: sys/features.h
Yaakov Selkowitz [Mon, 14 Mar 2016 20:31:23 +0000 (15:31 -0500)]
Feature test macros overhaul: sys/features.h

This is the complete rework of the feature tests macros for better
compatibility with GNU libc, primarily based on the Linux man pages
documentation:

http://man7.org/linux/man-pages/man7/feature_test_macros.7.html

The previous implementation was flawed in its approach that macros were
often used to hide symbols if defined (e.g. !defined __STRICT_ANSI__ or
!defined _POSIX_SOURCE), whereas the approach of glibc is that these macros
make symbols available when defined (e.g. defined _BSD_SOURCE, or as used
internally, #if __BSD_VISIBLE).  As much open-source software is written
with glibc in mind, this necessitated patching numerous packages just to
compile.

In particular, __STRICT_ANSI__ (which is defined by gcc -ansi or -std=c*)
was given too much importance.  This implementation limits the influence
of __STRICT_ANSI__ to controlling the default when no other feature test
macros are defined, and to the inclusion of <alloca.h> in <stdlib.h> as
documented.  These are the only places where __STRICT_ANSI__ should be
tested.

The following macros are now accepted: _ATFILE_SOURCE, _BSD_SOURCE,
_DEFAULT_SOURCE, _ISOC99_SOURCE, _ISOC11_SOURCE, _LARGEFILE_SOURCE,
_SVID_SOURCE, _XOPEN_SOURCE_EXTENDED.

The existing __*_VISIBLE internal macros have been kept mostly
compatible with the original BSD implementation, with some changes to
the criteria which controls them.  Several more macros in this style
have been added where needed for concision or accuracy.

Enabling C++11 or newer in the compiler also enables C99 and C11
functions.  Doing so should help move away from the need to define
_GNU_SOURCE in g++ for _GLIBCXX_USE_C99 support as on Linux:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51749

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoadd release message for commit 4c9bb3e
Corinna Vinschen [Thu, 17 Mar 2016 16:58:43 +0000 (17:58 +0100)]
add release message for commit 4c9bb3e

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoPropagate correct Windows error if executable can't be opened
Corinna Vinschen [Thu, 17 Mar 2016 16:46:11 +0000 (17:46 +0100)]
Propagate correct Windows error if executable can't be opened

* spawn.cc (av::setup): Set last Win32 error if NtOpenFile fails.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for commit 7346568
Thomas Wolff [Thu, 17 Mar 2016 07:59:03 +0000 (08:59 +0100)]
Add release message for commit 7346568

8 years agoMake requested console reports work
Thomas Wolff [Wed, 16 Mar 2016 09:25:16 +0000 (10:25 +0100)]
Make requested console reports work

cf https://cygwin.com/ml/cygwin-patches/2012-q3/msg00019.html

This enables the following ESC sequences:
ESC[c sends primary device attributes
ESC[>c sends secondary device attributes
ESC[6n sends cursor position report

    * fhandler.h (class dev_console): Add console read-ahead buffer.
    (class fhandler_console): Add peek function for it (for select).
    * fhandler_console.cc (fhandler_console::setup): Init buffer.
    (fhandler_console::read): Check console read-aheader buffer.
    (fhandler_console::char_command): Put responses to terminal
    requests (device status and cursor position reports) into
    common console buffer (shared between CONOUT/CONIN)
    instead of fhandler buffer (separated).
    * select.cc (peek_console): Check console read-ahead buffer.

8 years agoAttempt to fix Coverity issues in ssp
Jon Turney [Tue, 15 Mar 2016 12:57:33 +0000 (12:57 +0000)]
Attempt to fix Coverity issues in ssp

* ssp.c (lookup_thread_id): Consistently check if tix is a null
pointer.
(run_program): Annotate that STATUS_BREAKPOINT falls-through to
STATUS_SINGLE_STEP case.
(main): Guard against high_pc-low_pc overflow and malloc failure.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agocygwin_getaddrinfo: workaround Winsock getaddrinfo issue with broken DNS
Corinna Vinschen [Mon, 14 Mar 2016 16:57:22 +0000 (17:57 +0100)]
cygwin_getaddrinfo: workaround Winsock getaddrinfo issue with broken DNS

Add experimental code to workaround the issue described in the thread
starting at

  https://cygwin.com/ml/cygwin/2015-07/msg00350.html

There's a hint in https://communities.vmware.com/message/2577858#2577858
that this problem is related to using the AI_ALL flag.

This patch checks if GetAddrInfoW returned with WSANO_RECOVERY and if
the AI_ALL flag was set, it retries GetAddrInfo without the AI_ALL flag.

* net.cc (cygwin_getaddrinfo): Add experimental code to retry
GetAddrInfoW without AI_ALL flag if it returned with WSANO_RECOVERY.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDon't write NULL SID ACE if it's not necessary.
Corinna Vinschen [Sun, 13 Mar 2016 15:02:55 +0000 (16:02 +0100)]
Don't write NULL SID ACE if it's not necessary.

If the ACL is supposed to reflect only standard POSIX permissions,
and if the permissions are so that user has more perms than group
and group has more perms than other, we don't really need the NULL
SID ACE.  If the permissions are that simple, get_posix_access will
not call AuthZ.

* sec_acl.cc (set_posix_perms): Don't write NULL SID ACE if it's
not required.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoor1k: properly restore timer
Stefan Roesch [Thu, 10 Mar 2016 16:51:55 +0000 (17:51 +0100)]
or1k: properly restore timer

Consider the function parameter for restoring the timer

8 years agoor1k: Fix multicore stack calculation
Stefan Roesch [Thu, 10 Mar 2016 16:50:52 +0000 (17:50 +0100)]
or1k: Fix multicore stack calculation

Change the type of the stack pointers to enable pointer calculations at byte
granularity, which is needed for the calculation of _or1k_stack_core[c] and
_or1k_exception_stack_core[c] with _or1k_stack_size and
_or1k_exception_stack_size. (util.c:53-54)

8 years agosetvbuf: Drop setting reent->__cleanup
Corinna Vinschen [Sun, 13 Mar 2016 11:03:03 +0000 (12:03 +0100)]
setvbuf: Drop setting reent->__cleanup

The __sinit call added with 1eb6db6 already sets reent->__cleanup.

* libc/stdio/setvbuf.c (setvbuf): Drop setting reent->__cleanup.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUpdate Cygwin release message text with latest bugfixes.
Corinna Vinschen [Sat, 12 Mar 2016 23:20:18 +0000 (00:20 +0100)]
Update Cygwin release message text with latest bugfixes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUpdate setvbuf to latest OpenBSD implementation
Corinna Vinschen [Sat, 12 Mar 2016 22:41:21 +0000 (23:41 +0100)]
Update setvbuf to latest OpenBSD implementation

Newlib's setvbuf function is very old and has two bugs:
- It sets the SRD/SWR flags incorrectly in case of files opened for
  reading and writing.
  See https://cygwin.com/ml/cygwin/2016-03/msg00180.html
  for a desription of the effect.
- It always sets the buffer size to BUFSIZ if it's not provided by
  the application, independent of the optimal blocksize for the
  underlying IO device.

Update setvbuf to latest code from OpenBSD to fix both problems.

* libc/stdio/setvbuf.c (setvbuf): Import latest OpenBSD
implementation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd __swhatbuf function from OpenBSD
Corinna Vinschen [Sat, 12 Mar 2016 22:37:01 +0000 (23:37 +0100)]
Add __swhatbuf function from OpenBSD

To fix a long-standing setvbuf bug, import __swhatbuf function from
OpenBSD and only slightly rearrange for newlib.

* libc/stdio/local.h (__swhatbuf_r): Declare.
* libc/stdio/makebuf (__smakebuf_r): New function.
(__smakebuf_r): Drop file handling code and call __smakebuf_r.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse __sputc_r inline code when building with gcc
Corinna Vinschen [Sat, 12 Mar 2016 22:25:11 +0000 (23:25 +0100)]
Use __sputc_r inline code when building with gcc

Per the preceeding comment this inline code is disabled since 1993(!)
because of a bug in GCC at the time.  This is long gone and the equivalent
inline code is used in the BSDs for quite some time.  Enable this code for
newlib as well.

* libc/include/stdio.h (__sputc_r): Enable GCC inline code.  Add
handling for targets defining __SCLE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix typo which might break permission evaluation
Corinna Vinschen [Sat, 12 Mar 2016 16:57:34 +0000 (17:57 +0100)]
Fix typo which might break permission evaluation

* sec_acl.cc (get_posix_access): Fix a typo checking for a_id
rather than a_type.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix reading/writing Samba ACLs using RFC2307 mapping
Corinna Vinschen [Sat, 12 Mar 2016 16:56:21 +0000 (17:56 +0100)]
Fix reading/writing Samba ACLs using RFC2307 mapping

When using RFC2307 uid/gid-mapping on Samba shares, the POSIX ACL contains
the Windows SIDs.  When writing back such an ACL we have to map the
Windows SIDs back to the corresponding Samba SIDs representing the UNIX
uid/gid value.  When reading Samba SIDs, make sure never to evaluate a
UNIX user account as group.

* sec_acl.cc (set_posix_access): Convert Windows SIDs to
RFC2307-mapped Sambe UNIX SIDs.
* sec_helper.cc (cygpsid::get_id): Skip UNIX user accounts when
trying to evaluate a SID as group.  Skip UNIX group accounts when
trying to evaluate a SID as user.
* cygheap.h (cygheap_ugid_cache::reverse_get): New method to
get nfs id from cygwin id.
(cygheap_ugid_cache::reverse_get_uid): Wrapper for uids.
(cygheap_ugid_cache::reverse_get_gid): Wrapper for gids.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd cygsid methods to create SIDs from scratch
Corinna Vinschen [Sat, 12 Mar 2016 15:39:19 +0000 (16:39 +0100)]
Add cygsid methods to create SIDs from scratch

So far creating cygsids requires to generate an "S-1-..." string
which is then converted to a SID by cygsid::getfromstr.

Add two new methods:

- cygsid::create (DWORD auth, DWORD subauth_count, ...)

    ... is a variable length list of subauth_count DWORD values being
    the actual subauths.

- cygsid::append (DWORD rid)

    allows to append a single RID to an alreaday constituted SID.

* security.h (cygsid::create): Declare public.
(cygsid::append): Ditto.
* sec_helper.cc (cygsid::create): Implement.
(cygsid::append): Implement.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Use both new
methods as appropriate.  Drop setting csid from string.  Create
SID strings for printing SIDs only.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agogmon.h: Fix type of gmonparam state member
Corinna Vinschen [Fri, 11 Mar 2016 21:50:24 +0000 (22:50 +0100)]
gmon.h: Fix type of gmonparam state member

gmonparam::state is used in calls to Win32 Interlocked functions.
Having this defined as int breaks the build on i686.  Redefine as
LONG (same size and correct type on all platforms) to make gcc happy.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSpinlock spin with pause instruction
Václav Haisman [Fri, 11 Mar 2016 10:28:27 +0000 (11:28 +0100)]
Spinlock spin with pause instruction

Hi.

I have noticed that Cygwin's spinlock goes into heavy sleeping code
for each spin. It seems it would be a good idea to actually try to
spin a bit first. There is this 'pause' instruction which let's the
CPU make such busy loops be less busy. Here is a patch to do this.

--
VH

8 years agoDocumentation covering profiling Cygwin programs.
Mark Geisert [Fri, 11 Mar 2016 07:56:56 +0000 (23:56 -0800)]
Documentation covering profiling Cygwin programs.

8 years agoAdd release message for commit 8b1ede3ce11d53292036aadfcfb6043df0235f9c
Corinna Vinschen [Thu, 10 Mar 2016 19:48:04 +0000 (20:48 +0100)]
Add release message for commit 8b1ede3ce11d53292036aadfcfb6043df0235f9c

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd commit 5807ba83e release message to documentation
Corinna Vinschen [Thu, 10 Mar 2016 19:47:33 +0000 (20:47 +0100)]
Add commit 5807ba83e release message to documentation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for commit 5807ba83e498d87b52675376a81d2edfe6de098d
Corinna Vinschen [Thu, 10 Mar 2016 19:42:42 +0000 (20:42 +0100)]
Add release message for commit 5807ba83e498d87b52675376a81d2edfe6de098d

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSupport profiling of multi-threaded apps.
Mark Geisert [Sat, 20 Feb 2016 06:58:31 +0000 (22:58 -0800)]
Support profiling of multi-threaded apps.

This patch set modifies Cygwin's profiling support to sample PC values
of all an app's threads, not just the main thread. There is no change
to how profiling is requested: just compile and link the app with "-pg"
as usual. The profiling info is dumped into file gmon.out as always.

A new facility enabled via the environment variable GMON_OUT_PREFIX.
This facility is intended to match an undocumented Linux glibc feature.
Exporting the variable with a non-empty value such as "foo" causes the
profiling info to go to a file named foo.$pid instead of the default.
With that, both resulting processes of a fork() can have their profiling
data captured in separate files. gprof already knows how to accumulate
data from multiple files if they all pertain to the same app.

There is no change to the normal Cygwin execution paths if profiling is
not enabled. And when it is enabled, only the one profiling thread per
profiled app is doing more work than it used to.

* include/sys/cygwin.h: Add CW_CYGHEAP_PROFTHR_ALL.
* cygheap.cc (cygheap_profthr_all): New C-callable function that
runs cygheap's threadlist handing each pthread's thread handle in
turn to profthr_byhandle().
* external.cc (cygwin_internal): Add case CW_CYGHEAP_PROFTHR_ALL.
* gmon.c (_mcleanup): Add support for multiple simultaneous
gmon.out* files named via environment variable GMON_OUT_PREFIX.
* gmon.h (struct gmonparam): Make state decl volatile.
* mcount.c (_MCOUNT_DECL): Change stores into gmonparam.state to use
Interlocked operations. Add #include "winsup.h", update commentary.
* profil.c (profthr_byhandle): New function abstracting out the
updating of profile counters based on a thread handle.
(profthr_func): Update to call profthr_byhandle() to sample the main
thread then call cygheap_profthr_all() indirectly through
cygwin_internal(CW_CYGHEAP_PROFTHR_ALL) to sample all other threads.
(profile_off): Zero targthr to indicate profiling was turned off.
(profile_on): Fix handle leak on failure path.
(profile_child): New callback func to restart profiling in child
process after a fork if the parent was being profiled.
(profile_ctl): Call pthread_atfork() to set profile_child callback.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agogetifaddrs: Return pointer to extended interface info in ifa_data member
Corinna Vinschen [Thu, 10 Mar 2016 17:00:00 +0000 (18:00 +0100)]
getifaddrs: Return pointer to extended interface info in ifa_data member

According to https://cygwin.com/ml/cygwin/2016-03/msg00124.html it's a
problem to collect friendlyname info using AF_INET6 sockets.  Fix problem
by exposing additional hardware info for all collected interfaces via the
pointer in the ifaddrs::ifa_data member.

* include/ifaddrs.h (struct ifaddrs_hwdata): Define as struct of
not yet exposed members of struct ifall, defined in net.cc.
* net.cc (struct ifall): Replace hardware dta members with struct
ifaddrs_hwdata.  Accommodate throughout.
(get_ifs): Let ifaddrs ifa_data member point to ifall::ifa_hwdata
member.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRemove bogus LONG(0) directives from MSP430 linker scripts.
Nick Clifton [Thu, 10 Mar 2016 10:41:13 +0000 (10:41 +0000)]
Remove bogus LONG(0) directives from MSP430 linker scripts.

8 years agoRevamp acl_extended_fd/acl_extended_file to avoid open(2) call
Corinna Vinschen [Thu, 10 Mar 2016 09:36:00 +0000 (10:36 +0100)]
Revamp acl_extended_fd/acl_extended_file to avoid open(2) call

Calling open from acl_extended_file{_nofollow} indiscriminately may hang
if the file is a FIFO.  Ultimately the FIFO implementation needs a thorough
rewrite, but for the time being we better do what stat(2) and friends do:
Just create an fhandler directly.

* sec_posixacl.cc (__acl_extended_fh): New static function calling
fhandler::facl.
(acl_extended_fd): Just call __acl_extended_fh.
(__acl_extended_file): Take just a path_conv as parameter and
create temporary fhandler to call __acl_extended_fh.
(acl_extended_file): Create path_conv from incoming path and
call __acl_extended_file on it.
(acl_extended_file_nofollow): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoOverwite potentially faked kernel version with correct values
Corinna Vinschen [Wed, 9 Mar 2016 22:10:17 +0000 (23:10 +0100)]
Overwite potentially faked kernel version with correct values

* ntdll.h (RtlGetNtVersionNumbers): Declare.
* wincap.cc (wincapc::init): Overwrite kernel version info
returned by RtlGetVersion with correct info returnd by
RtlGetNtVersionNumbers.  Add comment.

Originally, using RtlGetVersion instead of GetVersionEx was supposed to
fix the fact that GetVersionInfo returns the wrong kernel version if the
executable has been built with an old manifest (or none at all), starting
with Windows 8.1.  Either this never really worked as desired and our
testing was flawed, or this has been changed again with Windows 10, so
that RtlGetVersion does the kernel faking twist as well.  Since we're
only reading the value in the first process in a process tree. the entire
process tree is running with a wrong OS version information in that case.

Fortunately, the (undocumented) RtlGetNtVersionNumbers function is not
affected by this nonsense, so we simply override the OS version info
fields with the correct values now.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMove definition of wsadata into wsock_init
Corinna Vinschen [Wed, 9 Mar 2016 21:55:28 +0000 (22:55 +0100)]
Move definition of wsadata into wsock_init

The problem this patch fixes showed up after updating to gcc-5.3.0.  The
cuplrit is a change in gcc when emitting section attributes.  It only
shows up when building without optimization.  Effect in Cygwin: ws2_32
functions failed to load.

In the original code the definition of "NO_COPY wsadata" was preceeding
an __asm__ block (the definition of the _wsock_init wrapper), while the
definition of "NO_COPY here" immediately follows the same assembler
block.  When gcc-5.3.0 emits assembler code for the wsadata definition,
it emits the .data_cygwin_nocopy section attribute.

Next it emits the assembler output for the __asm_ block, entirely ignoring
its content.  The __asm__ block adds a .text section definition.

Eventually gcc emits assembler code for the here definition.  However,
apparently gcc still "knows" that it just emitted the .data_cygwin_nocopy
section attribute and so doesn't redefine it.  Remember the __asm__?  It
changed the section to .text.

So with gcc-4.9.3 we got:

    .section .data_cygwin_nocopy,"w"
  wsadata:

  __asm__ block:
    .text

    .section .data_cygwin_nocopy,"w"
  here:

With gcc 5.3.0 we now get:

    .section .data_cygwin_nocopy,"w"
  wsadata:

  __asm__ block:
    .text

  here:

So "here" is now in the .text segment which is read-only.  Hilarity ensues.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoCygwin: Document new POSIX ACL API
Corinna Vinschen [Tue, 8 Mar 2016 16:33:08 +0000 (17:33 +0100)]
Cygwin: Document new POSIX ACL API

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agofaq: Sort BLODA list and update advice on fixing fork failures
Jon Turney [Mon, 7 Mar 2016 18:42:41 +0000 (18:42 +0000)]
faq: Sort BLODA list and update advice on fixing fork failures

* faq-using.xml (bloda): Alphabetically sort BLODA list for ease
of finding things in it.
(fixing-fork-failures): Update to suggest rebase-trigger rather
than running rebaseall via dash yourself.  Mention detect_bloda
CYGWIN token.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agoacl_create_entry: Don't invalidate existing entry_d and permset_d.
Corinna Vinschen [Wed, 6 Jan 2016 22:00:51 +0000 (23:00 +0100)]
acl_create_entry: Don't invalidate existing entry_d and permset_d.

* sec_posixacl .cc (__acl_dup): Remove.
(acl_dup): Fold __acl_dup functionality into this function.
(acl_create_entry): Don't create new acl_t.  Just realloc
acl->entry to make room for new aclent_t.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years ago__acltotext: Always append NUL
Corinna Vinschen [Wed, 6 Jan 2016 20:05:56 +0000 (21:05 +0100)]
__acltotext: Always append NUL

* sec_acl.cc (__acltotext): Append NUL unconditionally.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoImplement POSIX.1e ACL functions
Corinna Vinschen [Wed, 6 Jan 2016 17:41:36 +0000 (18:41 +0100)]
Implement POSIX.1e ACL functions

* Makefile.in (DLL_OFILES): Add sec_posixacl.o.
(SUBLIBS): Add libacl.a
(libacl.a): New rule to create libacl.a.
* common.din: Export POSIX ACL functions as well as most libacl.a
extensions.
* fhandler.h (fhander_base::acl_get): New prototype.
(fhander_base::acl_set): Ditto.
(fhandler_disk_file::acl_get): Ditto.
(fhandler_disk_file::acl_set): Ditto.
* include/acl/libacl.h: New file.
* include/cygwin/version.h: Bump API minor version.
* include/sys/acl.h: Drop including cygwin/acl.h.  Accommodate
throughout Cygwin.  Add POSIX ACL definitions.
* sec_acl.cc: Include sec_posixacl.h.  Replace ILLEGAL_UID and
ILLEGAL_GID with ACL_UNDEFINED_ID where sensible.
(__aclcheck): New internal acl check function to be used for
Solaris and POSIX ACLs.
(aclcheck32): Call __aclcheck.
(__aclcalcmask): New function to compute ACL_MASK value.
(__aclsort): New internal acl sort function to be used for Solaris
and POSIX ACLs.
(aclsort32): Call __aclsort.
(permtostr): Work directly on provided buffer.
(__acltotext): New internal acltotext function to be used for
Solaris and POSIX ACLs.
(acltotext32): Call __acltotext.
(__aclfromtext): New internal aclfromtext function to be used for
Solaris and POSIX ACLs.
(aclfromtext32): Call __aclfromtext.
* sec_posixacl.cc: New file implemeting POSIX ACL functions.
* sec_posixacl.h: New internal header.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin/acl.h: Don't clutter namespace
Corinna Vinschen [Wed, 6 Jan 2016 17:24:03 +0000 (18:24 +0100)]
cygwin/acl.h: Don't clutter namespace

include/cygwin/acl.h: Change comments to /**/ style.  Reformat
declarations.  Use underscores in argument names.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMention 64-bit Cygwin as another remedy for fork() failures.
Alexey Sokolov [Fri, 4 Mar 2016 19:42:15 +0000 (19:42 +0000)]
Mention 64-bit Cygwin as another remedy for fork() failures.

8 years agoccwrap: fix build with non-english locale set (v2)
Patrick Bendorf [Mon, 29 Feb 2016 13:34:09 +0000 (14:34 +0100)]
ccwrap: fix build with non-english locale set (v2)

after some discussion on irc and the list i'm resubmitting a simpler
version of the patch.
setting the locale on cygwin to 'C.UTF-8' is not needed, so i'm always
setting it to 'C' which is sufficient for the build process and the
most simple fix.

8 years agoccwrap: fix build with non-english locale set
Patrick Bendorf [Mon, 29 Feb 2016 12:19:43 +0000 (13:19 +0100)]
ccwrap: fix build with non-english locale set

short explanation: after setting up cygwin on my systems the default
locale is set to "de_DE.UTF-8". this leads to ccwrap not picking up
certain "-isystem" arguments, which in turn leads to "stddef.h: no such
file or directory". this breaks the build process for systems having non
english locale.

ccwrap scans the output of the first compiler invocation (line 21) for
some specific english output on and around line 43.

i changed the patch to check uname -o for cygwin string and set the
locale to either C or C.UTF-8

8 years agoEnable HW interrupt setup on x86/x86_64 systems by default newlib-snapshot-20160226
Corinna Vinschen [Fri, 26 Feb 2016 17:52:46 +0000 (18:52 +0100)]
Enable HW interrupt setup on x86/x86_64 systems by default

* configure.host: Define _I386MACH_DISABLE_HW_INTERRUPTS on rdos.
Remove setting _I386MACH_ALLOW_HW_INTERRUPTS anywhere else.
* libc/machine/i386/i386mach.h: Replace test for
_I386MACH_ALLOW_HW_INTERRUPTS with test for
!_I386MACH_DISABLE_HW_INTERRUPTS.
* libc/machine/x86_64/x86_64mach.h: Ditto.
* libc/sys/linux/machine/i386/i386mach.h: Ditto.
* libm/machine/i386/i386mach.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agonewlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems*
Joel Sherrill [Thu, 25 Feb 2016 17:43:18 +0000 (11:43 -0600)]
newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems*

8 years agoFix _newlib_version.h logic to support building gcc with newlib.
Jeff Johnston [Thu, 25 Feb 2016 20:04:19 +0000 (15:04 -0500)]
Fix _newlib_version.h logic to support building gcc with newlib.

8 years agocygwin: Export clog10, clog10f
Yaakov Selkowitz [Thu, 18 Feb 2016 16:51:01 +0000 (10:51 -0600)]
cygwin: Export clog10, clog10f

winsup/cygwin/
* common.din: Add clog10, clog10f.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

winsup/doc/
* new-features.xml (ov-new2.5): Mention clog10, clog10f.
* posix.xml (std-gnu): Add clog10, clog10f.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agolibm/complex: add clog10, clog10f
Yaakov Selkowitz [Thu, 18 Feb 2016 16:47:15 +0000 (10:47 -0600)]
libm/complex: add clog10, clog10f

newlib/
* libc/include/complex.h (clog10, clog10f): Declare.
* libm/complex/Makefile.am (src): Add clog10.c.
(fsrc): Add clog10f.c.
(CHEWOUT_FILES): Add clog10.def.
* libm/complex/Makefile.in: Regenerate.
* libm/complex/clog10.c: New file.
* libm/complex/clog10f.c: New file.
* libm/complex/complex.tex: Add references to clog10 docs.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agopthread.h, sys/types.h Add missing pthread methods
Joel Sherrill [Fri, 19 Feb 2016 21:45:17 +0000 (15:45 -0600)]
pthread.h, sys/types.h Add missing pthread methods

* pthread.h: Add prototypes for pthread_condattr_getclock(),
pthread_condattr_setclock(), pthread_setschedpri(),
pthread_getcpuclockid(), pthread_getconcurrency(), and
pthread_setconcurrency().  Also cleaned up file header to
remove CVS Id string.
* sys/types.h: Add clock ID to pthread_condattr_t.

8 years agoFix comments in sec_acl.cc
Corinna Vinschen [Mon, 22 Feb 2016 09:54:13 +0000 (10:54 +0100)]
Fix comments in sec_acl.cc

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agossp: Fixes for 64-bit
Jon Turney [Mon, 2 Nov 2015 15:02:29 +0000 (15:02 +0000)]
ssp: Fixes for 64-bit

Fix various 32/64-bit portability issues in ssp, the single-step profiler, and
also build it for 64-bit.

This didn't turn out to actually be very useful for what I wanted to use it for,
so it's only been lightly tested.

It appears that on x86_64, single-step exceptions occur for much more of the
code in system DLLs, unlike x86, so ssp may take much, much longer to profile
some programs.  There is existing code to use breakpoints to mitigate this, but
that is currently disabled.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agoUpdate Cygwin release notes.
Corinna Vinschen [Thu, 18 Feb 2016 14:56:51 +0000 (15:56 +0100)]
Update Cygwin release notes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin: accept SIGIOT as alias of SIGABRT
Yaakov Selkowitz [Thu, 18 Feb 2016 05:13:32 +0000 (23:13 -0600)]
cygwin: accept SIGIOT as alias of SIGABRT

winsup/cygwin/
* include/cygwin/signal.h (SIGIOT): Define SIGIOT in terms of SIGABRT.
* strsig.cc (struct sigdesc): Ditto.

winsup/doc/
* utils.xml (kill): Document SIGIOT.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agosys/features.h: Update Cygwin POSIX option macros
Corinna Vinschen [Thu, 18 Feb 2016 12:10:28 +0000 (13:10 +0100)]
sys/features.h: Update Cygwin POSIX option macros

* libc/include/sys/features.h: Set POSIX option macros from 200112L
to 200809L for Cygwin.
(_POSIX_SPAWN): Set to 200809L for Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop temporary declaration of GetSystemTimePreciseAsFileTime.
Corinna Vinschen [Thu, 18 Feb 2016 11:38:24 +0000 (12:38 +0100)]
Drop temporary declaration of GetSystemTimePreciseAsFileTime.

* times.cc (GetSystemTimePreciseAsFileTime): Remove declaration
and accompanying comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosetuid: Create token from scratch without credentials of caller
Corinna Vinschen [Wed, 17 Feb 2016 15:40:27 +0000 (16:40 +0100)]
setuid: Create token from scratch without credentials of caller

* sec_auth.cc (get_token_group_sidlist): Drop auth_luid and
auth_pos parameter.  Remove code adding a logon SID.
(get_initgroups_sidlist): Drop auth_luid and auth_pos parameter.
Drop in call to get_token_group_sidlist. Accommodate in callers.
(get_setgroups_sidlist): Ditto.
(create_token): Explicitely set auth_luid to ANONYMOUS_LOGON_LUID
or LOCALSERVICE_LUID depending on OS.  Explain why.
Remove handling of logon SID since we don't generate one anymore.
(lsaauth): Drop now unused local variable auth_luid and auth_pos.
* wincap.h (wincaps::has_broken_whoami): New element.
* wincap.cc: Implement above element throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAlso fix libm/machine generated files.
Jeff Johnston [Wed, 17 Feb 2016 22:08:54 +0000 (17:08 -0500)]
Also fix libm/machine generated files.

8 years agoFix libm regenerated files again.
Jeff Johnston [Wed, 17 Feb 2016 22:06:46 +0000 (17:06 -0500)]
Fix libm regenerated files again.

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