]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
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.

8 years agoFix regeneration of libm autotool files.
Jeff Johnston [Wed, 17 Feb 2016 21:49:59 +0000 (16:49 -0500)]
Fix regeneration of libm autotool files.

8 years agoDefine the newlib version macros in one place: _newlib_version.h.
Pieter du Preez [Sun, 14 Feb 2016 10:12:06 +0000 (11:12 +0100)]
Define the newlib version macros in one place: _newlib_version.h.

Currently, the newlib version information needs to be updated in two places:
 - newlib/acinclude.m4
 - newlib/libc/include/sys/features.h

The goal of this patch is to:
 - supply a single location for defining the newlib version
   information: newlib/acinclude.m4
 - define __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__
   This is in line with what gcc does for its version macros. See:
   https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

This patch moves the definition of the _NEWLIB_VERSION, __NEWLIB__
and __NEWLIB_MINOR__ macros from newlib/libc/include/sys/features.h,
to the newly generated newlib/_newlib_version.h file. Additionally,
the __NEWLIB_PATCHLEVEL__ macro was created, for completeness.

In order to stay backwards compatible, newlib/_newlib_version.h gets
included by newlib/newlib.h and newlib/libc/include/sys/features.h.

Note: This patch does _not_ include the modifications to the following
files, as these should all be generated any way.
      *Makefile.in,
      *aclocal.m4,
      *configure
      stamp-* files

Signed-off-by: Pieter du Preez <pdupreez@gmail.com>
8 years agocyglsa: Drop code handling Windows 2000 and earlier
Corinna Vinschen [Wed, 17 Feb 2016 15:08:59 +0000 (16:08 +0100)]
cyglsa: Drop code handling Windows 2000 and earlier

* cyglsa.c (must_create_logon_sid): Remove.
(LsaApInitializePackage): Drop checking version and setting
must_create_logon_sid accordingly.
(LsaApLogonUserEx): Drop code setting login SID only required on
Windows 2000 and earlier.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSilent relocation truncations considered harmful
Mark Geisert [Wed, 17 Feb 2016 09:55:16 +0000 (10:55 +0100)]
Silent relocation truncations considered harmful

This follows up from my msg re GMP-ECM failing its 'make check' on the
main list https://cygwin.com/ml/cygwin/2016-02/msg00147.html .

There's an error that ought to be reported during dynamic linking if the
linked-to address is too far from the relocation site.  However the error
is not reported if __OPTIMIZE__ was #defined when building the Cygwin DLL.
I can't see why optimization settings should affect this.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin_conv_path: Really always preserve trailing slash in conversion to POSIX path
Corinna Vinschen [Mon, 15 Feb 2016 15:25:10 +0000 (16:25 +0100)]
cygwin_conv_path: Really always preserve trailing slash in conversion to POSIX path

* mount.cc (mount_info::conv_to_posix_path): Account for scenarios
where the path is identical to a mount point in terms of preserving
the trailing slash in the output.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMake buffered console characters visible to select().
John Hood [Sat, 30 Jan 2016 22:36:43 +0000 (17:36 -0500)]
Make buffered console characters visible to select().

8 years agoDocument pthread_barrier* functions as implemented
Corinna Vinschen [Sat, 13 Feb 2016 16:03:36 +0000 (17:03 +0100)]
Document pthread_barrier* functions as implemented

posix.xml (std-susv4): Add pthread_barrier* functions.
(std-notimpl): Remove here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRemove local winbase.h (again).
Corinna Vinschen [Sat, 13 Feb 2016 15:56:12 +0000 (16:56 +0100)]
Remove local winbase.h (again).

Mingw32-w64 supports all required inline Interlocked functions in the
meantime.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBump Cygwin version to 2.5.0
Corinna Vinschen [Sat, 13 Feb 2016 15:49:47 +0000 (16:49 +0100)]
Bump Cygwin version to 2.5.0

Add a release file.  Add release text to documentation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoPOSIX barrier implementation, take 3
Václav Haisman [Fri, 12 Feb 2016 21:25:59 +0000 (22:25 +0100)]
POSIX barrier implementation, take 3

The attached patch should address all of the review comments.

Modifed change log:

Newlib:

* libc/include/sys/features.h (_POSIX_BARRIERS): Define for Cygwin.
* libc/include/sys/types.h (pthread_barrier_t)
(pthread_barrierattr_t): Do not define for Cygwin.

Cygwin:

* common.din (pthread_barrierattr_init)
(pthread_barrierattr_setpshared, pthread_barrierattr_getpshared)
(pthread_barrierattr_destroy, pthread_barrier_init)
(pthread_barrier_destroy, pthread_barrier_wait): Export.
* include/cygwin/types.h (pthread_barrierattr_t)
(pthread_barrier_t): Declare.
* include/pthread.h (PTHREAD_BARRIER_SERIAL_THREAD)
(pthread_barrierattr_init, pthread_barrierattr_setpshared)
(pthread_barrierattr_getpshared, pthread_barrierattr_destroy)
(pthread_barrier_init, pthread_barrier_destroy)
(pthread_barrier_wait): Declare.
* thread.h (PTHREAD_BARRIER_MAGIC)
(PTHREAD_BARRIERATTR_MAGIC): Define.
(class pthread_barrierattr, class pthread_barrier): Declare.
* thread.cc (delete_and_clear): New local helper function.
(class pthread_barrierattr, class pthread_barrier): Implement.
* miscfuncs.h (likely, unlikely): New macros.

--
VH

8 years agocygwin: work around GCC 5 preprocessor changes
Yaakov Selkowitz [Fri, 12 Feb 2016 22:02:13 +0000 (16:02 -0600)]
cygwin: work around GCC 5 preprocessor changes

GCC 5 adds #line directives (and hence extra newlines) for macros
expansions, which confuses cygmagic.  Using the -P flag avoids
them entirely.

https://cygwin.com/ml/cygwin-patches/2016-q1/msg00016.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoBump Cygwin version to 2.4.2.
Corinna Vinschen [Fri, 12 Feb 2016 20:23:20 +0000 (21:23 +0100)]
Bump Cygwin version to 2.4.2.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin: fix errors with GCC 5
Yaakov Selkowitz [Fri, 12 Feb 2016 17:17:35 +0000 (11:17 -0600)]
cygwin: fix errors with GCC 5

GCC 5 switched from C89 to C11 by default. This implies a change from
GNU to C99 inline by default, which have very different meanings of
extern inline vs. static inline:

https://gcc.gnu.org/onlinedocs/gcc/Inline.html

Marking these as gnu_inline retains the previous behaviour.

winsup/cygwin/
* exceptions.cc (exception::handle): Change debugging to int to fix
an always-true boolean comparison warning.
* include/cygwin/config.h (__getreent): Mark gnu_inline.
* winbase.h (ilockcmpexch, ilockcmpexch64): Ditto.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoRemove broken ieeefp.h macros
Yaakov Selkowitz [Fri, 12 Feb 2016 02:23:10 +0000 (20:23 -0600)]
Remove broken ieeefp.h macros

Any attempt to use isnanf, isinff, or finitef from <ieeefp.h> with
GCC 5 on platforms other than SPU result in a "lvalue required as
unary '&' operand" error.

newlib/libc/
* include/ieeefp.h (__ieeefp_isnanf): Remove broken macro.
(__ieeefp_isinff, __ieeefp_finitef): Ditto.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoFix compile with GCC 5 -Werror
Yaakov Selkowitz [Fri, 12 Feb 2016 02:16:06 +0000 (20:16 -0600)]
Fix compile with GCC 5 -Werror

newlib/libc/
* stdio64/freopen64.c: Include <string.h> for memset().
* stdlib/quick_exit.c: Include <unistd.h> for _exit().
* string/gnu_basename.c (__gnu_basename): Fix discarded const
qualifier warning.
* stdlib/strtold.c: Include "mprec.h" for _strtorx_r().

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agocygwin_conv_path: Always preserve trailing backslashes in conversion to POSIX paths
Corinna Vinschen [Tue, 9 Feb 2016 14:00:30 +0000 (15:00 +0100)]
cygwin_conv_path: Always preserve trailing backslashes in conversion to POSIX paths

* include/sys/cygwin.h (CCP_CONVFLAGS_MASK): Define.
* mount.h (__CCP_APP_SLASH): Define.
* mount.cc (mount_info::conv_to_posix_path): Handle __CCP_APP_SLASH
flag.
* path.cc (cygwin_conv_path): Use CCP_CONVFLAGS_MASK to evaluate
"how" flag values.  Always add __CCP_APP_SLASH flag when calling
mount_info::conv_to_posix_path.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoSeperate MSP430 cio syscalls into individual function sections.
Nick Clifton [Tue, 9 Feb 2016 13:44:05 +0000 (13:44 +0000)]
Seperate MSP430 cio syscalls into individual function sections.

    START_FUNC: New macro.
    END_FUNC: New macro.
    exit, isatty, getpid, sc2: Use the new macros.

8 years agoprintf(3): Handle multibyte decimal point in field size computation
Corinna Vinschen [Mon, 8 Feb 2016 12:33:17 +0000 (13:33 +0100)]
printf(3): Handle multibyte decimal point in field size computation

  This patch fixes the problem reported in
  https://cygwin.com/ml/cygwin/2016-02/msg00014.html

  The 2009 changes to handle multibyte decimal point and thousands
  separator missed to take the length of a multibyte decimal point into
  account when computing the field size.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agostdio.h: Use __POSIX_VISIBLE etc. guards for POSIX 1003.1:2001 functions
Jon Turney [Thu, 4 Feb 2016 17:07:44 +0000 (17:07 +0000)]
stdio.h: Use __POSIX_VISIBLE etc. guards for POSIX 1003.1:2001 functions

Current mesa expects stdio.h to prototype fileno() when compiling with gcc
-std=c99 -D_XOPEN_SOURCE

Fix the 'POSIX 1003.1:2001' block in stdio.h to prototype functions if not
__STRICT_ANSI__, or _BSD_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE are defined
appropriately

As far as I can tell, despite being in this block, setbuffer() and setlinebuf()
are BSDisms which aren't in POSIX 1003.1:2001

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agoNewlib build is broken if configured with nano-malloc and non-reentrant system calls
Игорь Веневцев [Fri, 29 Jan 2016 15:19:57 +0000 (18:19 +0300)]
Newlib build is broken if configured with nano-malloc and non-reentrant system calls

Non-reentrant system calls version implies both MISSING_SYSCALL_NAMES
and REENTRANT_SYSCALL_PROVIDED macros to be defined.
Being coupled with --enable-newlib-nano-malloc knob it breaks the build:

bash-4.3$ ../newlib-2.3.0.20160104/configure CC_FOR_TARGET=gcc
AR_FOR_TARGET=ar RANLIB_FOR_TARGET=ranlib CFLAGS_FOR_TARGET="-m32
-DMISSING_SYSCALL_NAMES -DREENTRANT_SYSCALLS_PROVIDED"
--target=i386-elf --enable-newlib-nano-malloc && make

<...omitted output...>

../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:
In function ‘_mallinfo_r’:
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:35:
error: macro "_sbrk_r" requires 2 arguments, but only 1 given
         sbrk_now = _sbrk_r(RCALL 0);
                                   ^
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:20:
error: ‘_sbrk_r’ undeclared (first use in this function)
         sbrk_now = _sbrk_r(RCALL 0);
                    ^
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:20:
note: each undeclared identifier is reported only once for each
function it appears in
Makefile:1512: recipe for target 'lib_a-nano-mallinfor.o' failed
make[8]: *** [lib_a-nano-mallinfor.o] Error 1

In case of non-reentrant system calls _sbrk_r became a macro with TWO
args (defined in reent.h):

#define _sbrk_r(__reent, __incr)  sbrk(__incr)

But in our case only one argument is present. (RCALL 0) is considered
as a single argument despite RCALL itself is a macro:)

So intermediate one-arg macro will be enough to expand args before
final _sbrk_r expansion:

#define _SBRK_R(X) _sbrk_r(X)

Here is a patch:

8 years ago* newlib/libc/stdio/nano-vfscanf.c: Fix '%X' specifier procesing
Igor Venevtsev [Mon, 1 Feb 2016 14:31:43 +0000 (17:31 +0300)]
* newlib/libc/stdio/nano-vfscanf.c: Fix '%X' specifier procesing

8 years ago* newlib/libc/stdio/nano-vfscanf.c: Fix '%F', '%G' and '%E' specifiers processing
Igor Venevtsev [Tue, 2 Feb 2016 10:50:09 +0000 (13:50 +0300)]
* newlib/libc/stdio/nano-vfscanf.c: Fix '%F', '%G' and '%E' specifiers processing

8 years agoChange if_nameindex() to use unsigned int i variable.
Jeff Johnston [Thu, 4 Feb 2016 18:30:14 +0000 (13:30 -0500)]
Change if_nameindex() to use unsigned int i variable.

- i variable used in loop that shifts to right so use
  unsigned int instead

8 years agoinclude/grp.h: Remove prototypes of non-standard functions
Corinna Vinschen [Fri, 29 Jan 2016 12:39:57 +0000 (13:39 +0100)]
include/grp.h: Remove prototypes of non-standard functions

* libc/include/grp.h (group_from_gid): Remove prototype.
(setgrfile): Ditto.
(setgroupent): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix memcpy bug that reads past end of buffer.
Steve Ellcey [Thu, 28 Jan 2016 22:08:35 +0000 (14:08 -0800)]
Fix memcpy bug that reads past end of buffer.

* libc/machine/mips/memcpy.S (memcpy): Fix read past end of
input.

8 years agogrp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards
Yaakov Selkowitz [Thu, 28 Jan 2016 21:39:02 +0000 (15:39 -0600)]
grp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards

This fixes the build of krb5 and other packages on Cygwin.

* libc/include/grp.h: Use __BSD_VISIBLE and __XSI_VISIBLE guards.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoTreat ACLs with extra ACEs for Admins and SYSTEM like a trivial ACL
Corinna Vinschen [Thu, 28 Jan 2016 21:05:49 +0000 (22:05 +0100)]
Treat ACLs with extra ACEs for Admins and SYSTEM like a trivial ACL

POSIX.1e requires that chmod changes the MASK rather than the
GROUP_OBJ value if the ACL is non-trivial.

On Windows, especially on home machines, a standard ACL often
consists of entries for the user, maybe the group, and additional
entries for SYSTEM and the Administrators group.  A user calling
chmod on a file with bog standard Windows perms usually expects
that chmod changes the GROUP_OBJ perms, but given the rules from
POSIX.1e we can't do that.

However, since we already treat Admins and SYSTEM special in a
ACL (they are not used in MASK computations) we go a step in the
Windows direction to follow user expectations.  If an ACL only
consists of the three POSIX permissions, plus entries for Admins
and SYSTEM *only*, then we change the permissions of the GROUP_OBJ
entry *and* the MASK entry.

* fhandler_disk_file.cc (fhandler_disk_file::chmod): Drop unused
code.  Add special handling for a "standard" Windows ACL.  Add
comment to explain.
* sec_acl.cc (get_posix_access): Allow to return "standard-ness"
of an ACL to the caller.  Add preceeding comment to explain a bit.
* security.h (get_posix_access): Align prototype.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoget_posix_access: Fix primary group handing when multiple ACEs exist
Corinna Vinschen [Thu, 28 Jan 2016 13:34:11 +0000 (14:34 +0100)]
get_posix_access: Fix primary group handing when multiple ACEs exist

Handle additional ACE for primary group only as another GROUP
entry if it's an allow ACE.  Deny ACEs don't qualify.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMake macro checks ARMv8-M baseline proof
Thomas Preud'homme [Thu, 28 Jan 2016 10:26:09 +0000 (11:26 +0100)]
Make macro checks ARMv8-M baseline proof

libgloss:

        * arm/Makefile.in: Add newlib/libc/machine/arm to the include path if
        newlib is present.
        * arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macros __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__,
        !__ARM_ARCH_ISA_ARM rather than THUMB_V7M_V6M for fp enabling, and
        PREFER_THUMB rather than THUMB_V7_V6M.  Rename other occurences of
        THUMB_V7M_V6M to THUMB_VXM.
        * arm/linux-crt0.c: Likewise.
        * arm/redboot-crt0.S: Likewise.
        * arm/swi.h: Likewise.
        * arm/trap.S: Likewise.

newlib:

        * libc/machine/arm/memcpy-stub.c: Use ACLE macros __ARM_ARCH_ISA_THUMB
        and __ARM_ARCH_ISA_ARM to check for Thumb-2 only targets rather than
        __ARM_ARCH and __ARM_ARCH_PROFILE.
        * libc/machine/arm/memcpy.S: Likewise.
        * libc/machine/arm/setjmp.S: Likewise for Thumb-1 only target and
        include acle-compat.h.
        * libc/machine/arm/strcmp.S: Likewise for Thumb-1 and Thumb-2 only
        target and include acle-compat.h.
        * libc/sys/arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macro __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * libc/sys/arm/crt0.S: Use PREFER_THUMB rather than THUMB_V7_V6M and
        rename THUMB_V7M_V6M into THUMB_VXM.
        * libc/sys/arm/swi.h: Likewise.

8 years agoDeprecate newlib and winsup ChangeLog files
Corinna Vinschen [Thu, 28 Jan 2016 10:15:33 +0000 (11:15 +0100)]
Deprecate newlib and winsup ChangeLog files

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDon't use LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32). It hangs
Corinna Vinschen [Wed, 27 Jan 2016 14:43:15 +0000 (15:43 +0100)]
Don't use LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32).  It hangs

Observed running hexchat under X.  For some reason the call to
LoadLibraryEx(..., LOAD_LIBRARY_SEARCH_SYSTEM32) in dll_load
hangs when trying to autoload MsgWaitForMultipleObjectsEx in
select.cc after hexchat forks to run DNS calls.  Dropping the
call and just using full paths as in 2.3.1 fixes the issue.

* autoload.cc (dll_load): Drop call to LoadLibraryEx with
LOAD_LIBRARY_SEARCH_SYSTEM32 flag.
* wincap.h (wincaps::has_load_lib_search_flags): Remove.
* wincap.cc (wincaps::has_load_lib_search_flags): Drop handling
this flag.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop has_broken_fnoi flag
Corinna Vinschen [Wed, 27 Jan 2016 14:39:11 +0000 (15:39 +0100)]
Drop has_broken_fnoi flag

* mount.cc (fs_info::update): Don't set has_broken_fnoi.  It's
unused anyway.
* mount.h (class fs_info): Remove has_broken_fnoi status flag.
* path.h (class path_conv): Remove has_broken_fnoi method.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMake select wait state more readable
Corinna Vinschen [Mon, 25 Jan 2016 20:00:14 +0000 (21:00 +0100)]
Make select wait state more readable

Rename "res" to "wait_state" and change its type to
select_stuff::wait_states.  Use select_stuff::wait_states
values instead of ints throughout.  Rearrange a few comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix missing 'user' in usertemp docs
Corinna Vinschen [Mon, 25 Jan 2016 09:09:55 +0000 (10:09 +0100)]
Fix missing 'user' in usertemp docs

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd 2.4.1 release message file cygwin-2_4_1-release
Corinna Vinschen [Sat, 23 Jan 2016 21:33:31 +0000 (22:33 +0100)]
Add 2.4.1 release message file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygpath: Avoid returning SysWOW64
Corinna Vinschen [Thu, 21 Jan 2016 17:40:30 +0000 (18:40 +0100)]
cygpath: Avoid returning SysWOW64

On Cygwin 32 running under WOW64:

When case-correcting the path fetched with -S, the underlying
Windows function fetching the normalized path returns the real
path C:\Windows\SysWOW64 instead of the path redirection
enabled C:\Windows\System32 path.  This breaks using the result
of `cygpath -S' to fetch the POSIX path of the network related
files under SYSTEMROOT\drivers\etc.  This path is in fact under
the *real* C:\Windows\System32 and only mapped into the 32 bit
C:\Windows\System32 (aka C:\Windows\SysWOW64) via path redirection.
Sounds messy?

This patch checks if we're running under WOW64.  If so, it
changes the path returned by GetSystemDirectoryW from "system32"
to "Sysnative".  This in turn is changed to "System32" by
NtQueryInformationFile, so we're back to what we need.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin_logon_user: Return non-privileged token as well
Corinna Vinschen [Thu, 21 Jan 2016 17:32:16 +0000 (18:32 +0100)]
cygwin_logon_user: Return non-privileged token as well

If the calling process doesn't have sufficient privileges to
fetch the linked token of an admin-user token, cygwin_logon_user
fails.  This patch changes that by returning the original,
unprivileged token of the admin user to allow authentication
and calling setuid for the current process.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix formatting in sec_auth.cc
Corinna Vinschen [Thu, 21 Jan 2016 17:27:05 +0000 (18:27 +0100)]
Fix formatting in sec_auth.cc

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBump cygwin version to 2.4.1
Corinna Vinschen [Sat, 16 Jan 2016 11:57:53 +0000 (12:57 +0100)]
Bump cygwin version to 2.4.1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agofaq: Update FAQ question and answer about gdb and signals
Jon Turney [Thu, 14 Jan 2016 17:44:18 +0000 (17:44 +0000)]
faq: Update FAQ question and answer about gdb and signals

    * faq-programming.xml: Update question and answer about gdb and signals.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agoget_posix_access: Fix group deny bits leaking into file type attribute bits cygwin-2_4_0-release
Corinna Vinschen [Fri, 15 Jan 2016 14:13:11 +0000 (15:13 +0100)]
get_posix_access: Fix group deny bits leaking into file type attribute bits

* sec_acl.cc (get_posix_access): Fix bracketing in expression
constructing POSIX group permissions so as not leaking deny bits
into POSIX file type bits.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoInitialize handle in dll_load to avoid compiler warning
Corinna Vinschen [Tue, 12 Jan 2016 14:45:17 +0000 (15:45 +0100)]
Initialize handle in dll_load to avoid compiler warning

* autoload.cc (dll_load): Initialize h to NULL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse MAKEWORD macro in WSAStartup call per documentation
Corinna Vinschen [Tue, 12 Jan 2016 14:25:15 +0000 (15:25 +0100)]
Use MAKEWORD macro in WSAStartup call per documentation

* autoload.cc (wsock_init): Use MAKEWORD macro to create requested
version rather than handcrafted expression.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoTry loading with safe path using LOAD_LIBRARY_SEARCH_SYSTEM32 first
Corinna Vinschen [Tue, 12 Jan 2016 14:23:14 +0000 (15:23 +0100)]
Try loading with safe path using LOAD_LIBRARY_SEARCH_SYSTEM32 first

* autoload.cc (dll_load): Move safe loading from std_dll_init here.
Add code to handle systems supporting LOAD_LIBRARY_SEARCH flags.
Add comments to explain what the code is doing.  Fix up comment
preceeding this function.
(std_dll_init): Move safe loading code to dll_load.
* wincap.h (wincaps::has_load_lib_search_flags): New element.
        * wincap.cc: Implement above element throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix previous fix for generating unique inode numbers for sockets
Corinna Vinschen [Mon, 11 Jan 2016 18:10:45 +0000 (19:10 +0100)]
Fix previous fix for generating unique inode numbers for sockets

* fhandler.h (fhandler_base::get_plain_ino): New inline method.
Add comment to explain what it's supposed to be used for.
* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Create
filename using inode number.
(fhandler_socket::fstat): Generate inode number from filename if
ino is not set (that's the case in a stat(2) call).
* pipe.cc: Throughout, use get_plain_ino when appropriate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRevert "autoload.cc: Drop using full paths for system DLLs"
Corinna Vinschen [Mon, 11 Jan 2016 17:46:01 +0000 (18:46 +0100)]
Revert "autoload.cc: Drop using full paths for system DLLs"

This reverts commit 4b104ce07070e32363a217a554441a8b4df69d12.

The DLLs always guaranteed to be loaded from the system dir are only
those in the KnownDLLs list.  We're using some DLLs not in that list on
all supported OSes, thus we need to make sure to use full paths.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoReturn unique inode numbers when calling stat/fstat on pipes and IP sockets
Corinna Vinschen [Mon, 11 Jan 2016 11:35:41 +0000 (12:35 +0100)]
Return unique inode numbers when calling stat/fstat on pipes and IP sockets

        * fhandler.h (class fhandler_base): Convert unique_id to int64_t.
        (fhandler_base::set_ino): New protected inline method.
        (fhandler_base::get_unique_id): Convert to int64_t.
        (fhandler_base::set_unique_id): New inline method taking int64_t.
        (fhandler_pipe::fstat): Declare.
        (fhandler_pipe::init): Take extra parameter.
        (fhandler_pipe::create): Ditto.
        * fhandler_socket.cc (fhandler_socket::init_events): Set inode number
        to serial number.
        (fhandler_socket::fstat): Set device to DEV_TCP_MAJOR.  Create st_ino
        from get_ino.
        * include/cygwin/signal.h (struct _sigcommune): Replace
        _si_pipe_fhandler with _si_pipe_unique_id.
        * pinfo.h (_pinfo::pipe_fhandler): Take unique id instead of HANDLE.
        * pinfo.cc (commune_process): Accommodate change to _si_pipe_unique_id.
        (_pinfo::commune_request): Ditto.
        (_pinfo::pipe_fhandler): Ditto.
        * pipe.cc (fhandler_pipe::init): Take unique id as argument and set
        inode number and unique_id from there.
        (fhandler_pipe::open): Rework to find any matching pipe from unique
        id in filename.
        (fhandler_pipe::get_proc_fd_name): Create filename using inode number.
        (fhandler_pipe::create): Generate and return unique id from process pid
        and pipe_unique_id.  In outer method, call init with additional unique
        id as parameter.
        (fhandler_pipe::fstat): New method.
        (pipe_worker): Accommodate using 64 bit inode number in filename.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect(2): Drop checking descriptors in case of immediate timeout.
Corinna Vinschen [Mon, 11 Jan 2016 09:36:33 +0000 (10:36 +0100)]
select(2): Drop checking descriptors in case of immediate timeout.

* select.cc (select): Call sel.poll only if sel.wait returned
select_ok.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for previous commit
Corinna Vinschen [Sat, 9 Jan 2016 14:05:21 +0000 (15:05 +0100)]
Add release message for previous commit

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect: Don't timeout without setting descriptor arrays to all zero
Corinna Vinschen [Sat, 9 Jan 2016 13:53:06 +0000 (14:53 +0100)]
select: Don't timeout without setting descriptor arrays to all zero

        * select.cc (copyfd_set): Remove.
        (select): Don't copy local wait fd arrays over to returned fd arrays
        since bits set there are not accounted for in return value.  Zero out
        returned fd arrays instead.  Always call sel.poll even in case of a
        timeout.  Always zero out fd array when timing out.  Convert while/do
        to do/while for clarity.  Use dedicated variable as return value to
        decouple return value from artificial return code from sel.wait.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDo not treat the command line or environment like paths
Johannes Schindelin [Thu, 17 Dec 2015 15:22:49 +0000 (16:22 +0100)]
Do not treat the command line or environment like paths

* dcrt0.cc (dll_crt0_1), environ.cc (environ_init, getwinenveq,
build_env), strfuncs.cc (sys_wcstombs, sys_wcstombs_alloc),
wchar.c (sys_wcstombs, sys_wcstombs_alloc): avoid mis-conversions
of text that does not, actually, refer to a path or file name

Detailed explanation:

Our WCS -> UTF conversion handles the private Unicode page specially
to allow for otherwise invalid file names. However, this handling makes
no sense for command-lines, nor environment variables, which we would
rather convert verbatim.

As a stop-gap solution, let's just introduce a version of the
sys_wcstombs() function that specifically excludes that file name
conversion magic.

The proper solution is to change sys_wcstombs() to assume that it is not
a path that wants to be converted, and introduce sys_wcstombs_path()
that does, but that is a bigger task which we leave for another patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
8 years agoDeprecate all winsup ChangeLog files
Corinna Vinschen [Thu, 7 Jan 2016 20:16:01 +0000 (21:16 +0100)]
Deprecate all winsup ChangeLog files

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygpath: Try to return system directories with correct case
Corinna Vinschen [Thu, 7 Jan 2016 20:07:56 +0000 (21:07 +0100)]
cygpath: Try to return system directories with correct case

* cygpath.cc (do_sysfolders): Drop lame workaround to fix case of
directory returned by GetSystemDirectoryW.  Try to fix case of
any path returned by this function in case it has to return a
POSIX path to support case-sensitivity.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect: Set exceptfd bit if fetching mailslot info fails
Corinna Vinschen [Thu, 7 Jan 2016 17:01:44 +0000 (18:01 +0100)]
select: Set exceptfd bit if fetching mailslot info fails

* select.cc (peek_mailslot): Set except_ready if GetMailslotInfo fails.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoselect.cc: Fit comments into 80 columns
Corinna Vinschen [Thu, 7 Jan 2016 16:56:33 +0000 (17:56 +0100)]
select.cc: Fit comments into 80 columns

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoConvert utmp{x}name to int, return useful value. Define _PATH_UTMPX
Corinna Vinschen [Thu, 7 Jan 2016 14:40:40 +0000 (15:40 +0100)]
Convert utmp{x}name to int, return useful value.  Define _PATH_UTMPX

* syscalls.cc (utmpname): Convert to int.  Return 0 if strdup
worked, -1 otherwise.
* include/utmpx.h (_PATH_UTMPX): Define as _PATH_UTMP.
(utmpxname): Declare as int function.
* include/sys/utmp.h (utmpname): Ditto.
* include/cygwin/version.h: Bump API minor version.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop use of not yet available type acl_perm_t
Corinna Vinschen [Thu, 7 Jan 2016 12:28:12 +0000 (13:28 +0100)]
Drop use of not yet available type acl_perm_t

* sec_acl.cc (__aclcalcmask): Use mode_t instead of acl_perm_t

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDeprecate Cygwin ChangeLog file
Corinna Vinschen [Thu, 7 Jan 2016 12:23:05 +0000 (13:23 +0100)]
Deprecate Cygwin ChangeLog file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix up errors in regenerated files for 2.3.0 release. newlib-snapshot-20160104
Jeff Johnston [Mon, 4 Jan 2016 17:57:31 +0000 (12:57 -0500)]
Fix up errors in regenerated files for 2.3.0 release.

8 years agosetfacl: Remove unused local variable
Corinna Vinschen [Fri, 25 Dec 2015 20:41:52 +0000 (21:41 +0100)]
setfacl: Remove unused local variable

        * setfacl.cc (delacl): Remove unused local variable.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoOnly request WRITE_DAC rights when writing an ACL
Corinna Vinschen [Fri, 25 Dec 2015 20:40:51 +0000 (21:40 +0100)]
Only request WRITE_DAC rights when writing an ACL

        * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request
        query_write_dac rather than query_write_control access when writing
        an ACL.  Fix a comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoaclsort: Honor calclass argument and allow recalculating ACL mask.
Corinna Vinschen [Wed, 23 Dec 2015 23:48:20 +0000 (00:48 +0100)]
aclsort: Honor calclass argument and allow recalculating ACL mask.

        * sec_acl.cc (__aclcalcmask): New function to recalculate ACL masks.
        (aclsort32): Honor calclass argument.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoaclfromtext: Actually return aclcnt parameter
Corinna Vinschen [Wed, 23 Dec 2015 23:39:45 +0000 (00:39 +0100)]
aclfromtext: Actually return aclcnt parameter

        * sec_acl.cc (aclfromtext32): Return missing aclcnt parameter.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUse TLS buffer in ACL<->text conversion
Corinna Vinschen [Wed, 23 Dec 2015 23:32:54 +0000 (00:32 +0100)]
Use TLS buffer in ACL<->text conversion

        * sec_acl.cc (acltotext32): Use tmp_pathbuf rather than stack buffer.
        (aclfromtext32): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosec_acl.cc: Cosmetic changes
Corinna Vinschen [Wed, 23 Dec 2015 23:24:39 +0000 (00:24 +0100)]
sec_acl.cc: Cosmetic changes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRegenerate files for newlib 2.3.0. newlib-2_3_0
Jeff Johnston [Tue, 22 Dec 2015 02:03:25 +0000 (21:03 -0500)]
Regenerate files for newlib 2.3.0.

8 years agosetfacl(1): Fix handling of -m and -x on a single commandline
Corinna Vinschen [Mon, 21 Dec 2015 17:15:57 +0000 (18:15 +0100)]
setfacl(1): Fix handling of -m and -x on a single commandline

        * setfacl.cc (delace): New helper function to delete a single ACE.
        (delacl): Call delace.
        (modacl): Ditto, if entry is supposed to get deleted.  Align comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix atexit logic to honor _ATEXIT_DYNAMIC_ALLOC setting.
Jeff Johnston [Mon, 21 Dec 2015 16:53:14 +0000 (11:53 -0500)]
Fix atexit logic to honor _ATEXIT_DYNAMIC_ALLOC setting.

If small reent is enabled (_REENT_SMALL is defined) then malloc() was
used in __register_exitproc() even if user requested it to be disabled
(_ATEXIT_DYNAMIC_ALLOC is defined). With this fix, function fails when
_ATEXIT_DYNAMIC_ALLOC is defined and whole static storage is already
used.

2015-12-21  Freddie Chopin  <freddie.chopin@gmail.com>

        * libc/stdlib/__atexit.c (__register_exitproc): Fix for
        _ATEXIT_DYNAMIC_ALLOC.

8 years agoAdd static instance of _on_exit_args for _REENT_SMALL platforms.
Jeff Johnston [Mon, 21 Dec 2015 16:49:28 +0000 (11:49 -0500)]
Add static instance of _on_exit_args for _REENT_SMALL platforms.

2015-12-21  Freddie Chopin  <freddie.chopin@gmail.com>

        * libc/stdlib/on_exit_args.{c,h}: New files.
        * libc/stdlib/Makefile.am: Add new source file.
        * libc/stdlib/Makefile.in: Regenerate.
        * libc/stdlib/__atexit.c (__register_exitproc): Initialize
        _on_exit_args_ptr field of _GLOBAL_ATEXIT on first run.
        * libc/stdlib/on_exit.c: Force linking of static instance of
        _on_exit_args.
        * libc/stdlib/cxa_atexit.c: Likewise.

8 years agosetfacl(1): Rewrite support for mask recomputation
Corinna Vinschen [Mon, 21 Dec 2015 12:05:41 +0000 (13:05 +0100)]
setfacl(1): Rewrite support for mask recomputation

        * setfacl.cc (modacl): Move recomputing mask into new function.
        (check_got_mask): New function checking if mask is in input.
        (recompute_mask): New function to recompute mask.
        (addmissing): Align mask computation to Linux setfacl.
        (setfacl): Call check_got_mask and recompute_mask on Set, Delete and
        Modify actions.
        (usage): Rename --substitute to --set.
        (longopts): Add --set option.

        * utils.xml (setfacl): Rename --substitute to --set.
        * new-features.xml (ov-new2.4): Rephrase setfacl changes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agosetfacl --mask/--no-mask really don't need an argument
Houder [Sun, 20 Dec 2015 12:14:34 +0000 (13:14 +0100)]
setfacl --mask/--no-mask really don't need an argument

        * setfacl.cc (longopts): Drop accidentally requiring an argument to
        the --mask and --no-mask options.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix missing arg requirement for setfacl -x option
Houder [Sat, 19 Dec 2015 20:00:46 +0000 (21:00 +0100)]
Fix missing arg requirement for setfacl -x option

        * setfacl.cc (opts): Add colon to x option.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDrop sys_cp_wcstombs and save two arguments per call
Corinna Vinschen [Fri, 18 Dec 2015 11:42:40 +0000 (12:42 +0100)]
Drop sys_cp_wcstombs and save two arguments per call

        * strfuncs.cc (sys_cp_wcstombs): Delete and move functionality into
        sys_wcstombs.
        * wchar.h (sys_cp_wcstombs): Drop declaration.
        * fhandler_console.cc (dev_console::con_to_str): Call sys_wcstombs.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBuild msp430-specific libnosys
DJ Delorie [Thu, 17 Dec 2015 21:49:08 +0000 (16:49 -0500)]
Build msp430-specific libnosys

The MSP430 debuggers support I/O on hardware through CIO, so
we can use a CIO-enabled library as the "nosys" library (in
addition to the libsim library, which talks to our simulator)

* configure.in: Don't build default libnosys for msp430
* configure: Regenerate.
* msp430/Makefile: Rename libcio to libnosys.

8 years agoARC: Use new definitions for optional ARC CPU features
Anton Kolesov [Tue, 15 Dec 2015 17:54:58 +0000 (20:54 +0300)]
ARC: Use new definitions for optional ARC CPU features

GCC for ARC has been updated to provide consistent naming of preprocessor
definitions for different optional architecture features:

    * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for
      -mbarrel-shifter
    * __ARC_LL64__ instead of __LL64__ for -mll64
    * __ARCEM__ instead of __EM__ for -mcpu=arcem
    * __ARCHS__ instead of __HS__ for -mcpu=archs
    * etc (not used in newlib)

This patch updates assembly routines for ARC to use new definitions instead
of a deprecated ones. To ensure compatibility with older compiler new
definitions are also defined in asm.h if needed, based on deprecated
preprocessor definitions.

*** newlib/ChangeLog ***
2015-12-15  Anton Kolesov  <Anton.Kolesov@synopsys.com>

* libc/machine/arc/asm.h: Define new GCC definition for old compiler.
* libc/machine/arc/memcmp-bs-norm.S: Use new GCC defines to detect
  processor features.
* libc/machine/arc/memcmp.S: Likewise.
* libc/machine/arc/memcpy-archs.S: Likewise.
* libc/machine/arc/memcpy-bs.S: Likewise.
* libc/machine/arc/memcpy.S: Likewise.
* libc/machine/arc/memset-archs.S: Likewise.
* libc/machine/arc/memset-bs.S: Likewise.
* libc/machine/arc/memset.S: Likewise.
* libc/machine/arc/setjmp.S: Likewise.
* libc/machine/arc/strchr-bs-norm.S: Likewise.
* libc/machine/arc/strchr-bs.S: Likewise.
* libc/machine/arc/strchr.S: Likewise.
* libc/machine/arc/strcmp-archs.S: Likewise.
* libc/machine/arc/strcmp.S: Likewise.
* libc/machine/arc/strcpy-bs-arc600.S: Likewise.
* libc/machine/arc/strcpy-bs.S: Likewise.
* libc/machine/arc/strcpy.S: Likewise.
* libc/machine/arc/strlen-bs-norm.S: Likewise.
* libc/machine/arc/strlen-bs.S: Likewise.
* libc/machine/arc/strlen.S: Likewise.
* libc/machine/arc/strncpy-bs.S: Likewise.
* libc/machine/arc/strncpy.S: Likewise.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
8 years agoRemove inclusion of sys/select.h in sys/types.h for backward compat
Corinna Vinschen [Thu, 17 Dec 2015 21:45:19 +0000 (22:45 +0100)]
Remove inclusion of sys/select.h in sys/types.h for backward compat

* libc/include/sys/types.h: Remove including <sys/select.h>.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoUpdate CIO hooks to be more flexible.
DJ Delorie [Thu, 17 Dec 2015 21:22:52 +0000 (16:22 -0500)]
Update CIO hooks to be more flexible.

Replace the one hook we had with two to avoid underscore issues.

* msp430/cio.c: Remove, replace with...
* msp430/cio.S: New, this.

8 years agorl78: Don't output CR when LF is encountered in write().
Kevin Buettner [Tue, 15 Dec 2015 03:41:53 +0000 (20:41 -0700)]
rl78: Don't output CR when LF is encountered in write().

The file libgloss/rl78/write.c currently contains code which outputs
\r when \n is seen.  The code will then output the \n as well.

This patch removes the bit of code that tests for \n and then outputs
\r.

I made this change to fix some failures in gdb.base/call-ar-st.exp.  In
that test, I see two carriage returns followed by a newline.  One CR is
output by the libgloss code.  The other is output by the terminal driver.

The total list of failures fixed (using the default rl78 multilib) are:

FAIL: gdb.base/call-ar-st.exp: print print_double_array(double_array) (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_char_array(char_array) (timeout)
FAIL: gdb.base/call-ar-st.exp: continue to tbreak2 (timeout)
FAIL: gdb.base/call-ar-st.exp: continuing to tbreak3 (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_double_array(array_d) (timeout)
FAIL: gdb.base/call-ar-st.exp: continuing to tbreak4 (timeout)
FAIL: gdb.base/call-ar-st.exp: print sum_array_print(10, *list1, *list2, *list3, *list4) (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_small_structs (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065) (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_small_structs from print_long_arg_list (timeout)
FAIL: gdb.base/call-ar-st.exp: print print_struct_rep(*struct1, *struct2, *struct3) (timeout)
FAIL: gdb.base/dprintf.exp: call: printf: 1st dprintf (timeout)
FAIL: gdb.base/dprintf.exp: call: printf: 2nd dprintf (timeout)
FAIL: gdb.base/interrupt.exp: process is alive (the program exited)

There are no regressions.

libgloss/ChangeLog:

* rl78/write.c (_write): Don't output CR when LF is encountered.

8 years agoAdd release message for previous commit
Corinna Vinschen [Wed, 16 Dec 2015 11:35:08 +0000 (12:35 +0100)]
Add release message for previous commit

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix crash reading invalid SIDs from passwd and group files
Corinna Vinschen [Wed, 16 Dec 2015 11:25:27 +0000 (12:25 +0100)]
Fix crash reading invalid SIDs from passwd and group files

        * grp.cc (pwdgrp::parse_group): Only copy the SID if it's valid.
        * passwd.cc (pwdgrp::parse_passwd): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd usertemp to 2.4.0 release text
Corinna Vinschen [Tue, 15 Dec 2015 10:25:23 +0000 (11:25 +0100)]
Add usertemp to 2.4.0 release text

8 years agoAdd _REENT_INIT_PTR_ZEROED()
Sebastian Huber [Mon, 14 Dec 2015 08:57:54 +0000 (09:57 +0100)]
Add _REENT_INIT_PTR_ZEROED()

Provide a _REENT_INIT_PTR_ZEROED() macro to initialize an already
zero-initialized struct _reent.

* libc/include/sys/reent.h (_REENT_INIT_PTR_ZEROED): New.
(_REENT_INIT_PTR): Define only once and use _REENT_INIT_PTR_ZEROED().

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