Re: [PATCH v3] Refactor to avoid nonnull checks on "this" pointer.

2016-04-05 Thread Peter Foley
On Tue, Apr 5, 2016 at 4:32 AM, Corinna Vinschen wrote: > And reverted. This patch is the culprit for the problem reported in > https://cygwin.com/ml/cygwin/2016-04/msg00085.html > > Can you please take another look, Peter? Huh, that's odd... I'll take a look when I

[PATCH v3] Refactor to avoid nonnull checks on "this" pointer.

2016-04-02 Thread Peter Foley
ed from pipe.cc (fhandler_pipe::open) after a null check. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/external.cc | 2 +- winsup/cygwin/fhandler_dsp.cc | 55 --- winsup/cygwin/fhandler_process.cc | 11 +--- winsup/c

[PATCH v2] Rename without-mingw-progs to with-cross-bootstrap

2016-04-02 Thread Peter Foley
AC_WINDOWS_LIBS when using with-cross-bootstrap configure: regenerate Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/configure | 19 +++ winsup/configure.ac | 8 +--- winsup/cygserver/configure| 2 ++ winsup/cygserver/configure.a

[RFC PATCH v3] Refactor to avoid nonnull checks on "this" pointer.

2016-04-01 Thread Peter Foley
G++ 6.0 asserts that the "this" pointer is non-null for member functions. Refactor methods that check if this is non-null to resolve this. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- Just wanted to make sure that this approach looked good before I fix all the p

Re: [PATCH v2] Refactor to avoid nonnull checks on "this" pointer.

2016-04-01 Thread Peter Foley
On Fri, Apr 1, 2016 at 11:10 AM, Corinna Vinschen wrote: > As I mentioned in my first reply, I'd prefer if the callers check the > pointer explicitly. Changing the methods to static methods seems ... > wrong. Ugly, if you don't mind me saying so. Fair enough, I'll

Re: [PATCH v2] Refactor to avoid nonnull checks on "this" pointer.

2016-04-01 Thread Peter Foley
On Fri, Apr 1, 2016 at 9:12 AM, Yaakov Selkowitz wrote: > See https://gcc.gnu.org/gcc-6/porting_to.html, section named "Optimizations > remove null pointer checks for this". If there's an better way to do this, I'm all ears. However, it seems to come down to either making

Re: [PATCH] Add without-library-checks

2016-04-01 Thread Peter Foley
On Fri, Apr 1, 2016 at 8:16 AM, Corinna Vinschen wrote: > Can we please fold the --without-mingw-progs and --without-library-checks > into a single option? Given the task is basically the same, the option > name should reflect something along the lines of

[PATCH 4/4] Update autoconf for doc/lsaauth/utils

2016-03-31 Thread Peter Foley
Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/doc/aclocal.m4 | 875 winsup/doc/configure| 95 - winsup/doc/configure.ac | 5 +- winsup/lsaauth/aclocal.m4 | 875

[PATCH 3/4] Remove remnants of never-defined MALLOC_DEBUG and NEWVFORK

2016-03-31 Thread Peter Foley
. malloc_wrapper.cc: ditto. malloc_wrapper.cc (malloc_init): ditto. spawn.cc (spawnve): ditto. syscalls.cc (setsid): ditto. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/acconfig.h| 5 - winsup/cygwin/config.h.in | 5 - winsup/cygwin/dcrt0.cc

[PATCH 1/4] Remove leftover cruft from config.h.in

2016-03-31 Thread Peter Foley
HAVE_BUILTIN_MEMTEST and AC_ALLOCA were removed in 4bd8eb7d1b. Cleanup leftover references. winsup/cygwin/ChangeLog acconfig.h: remove HAVE_BUILTIN_MEMTEST config.h.in: regenerate Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/acconfig.h | 3 --- winsup/cygwin/confi

[PATCH 2/4] Don't use deprecated acconfig.h for DEBUGGING

2016-03-31 Thread Peter Foley
Use the 3-arg form of AC_DEFINE. winsup/cygwin/ChangeLog: acconfig.h: Remove DEBUGGING define. configure.ac: Add description to DEBUGGING define. config.h.in: Regenerate. configure: Ditto. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/acconfig.h | 3 --- winsup/

[PATCH] Add without-library-checks

2016-03-31 Thread Peter Foley
AC_WINDOWS_LIBS when using without-library-checks configure: regenerate Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/configure | 14 ++ winsup/configure.ac | 5 - winsup/cygserver/configure| 2 ++ winsup/cygserver/configure.ac | 9 ++---

[PATCH v2] Refactor to avoid nonnull checks on "this" pointer.

2016-03-31 Thread Peter Foley
: Call _pinfo::exists staticly. times.cc (clock_gettime): Call _pinfo::exists staticly. times.cc (clock_getcpuclockid): Call _pinfo::exists staticly. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- I'm not 100% sure that the __reg1/2->__reg2/3 changes are necessary, but i'm pretty

[PATCH] fix typo in netinit/ip.h

2016-03-30 Thread Peter Foley
The type for the ip_tos member was typoed, fix it. winsup/cygwin/ChangeLog: include/netinet/ip.h: fix type of ip_tos Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/include/netinet/ip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/i

Re: [PATCH 06/11] Remove always true nonnull check on "this" pointer.

2016-03-30 Thread Peter Foley
On Wed, Mar 30, 2016 at 7:24 AM, Corinna Vinschen <corinna-cyg...@cygwin.com> wrote: > Hi Peter, > > On Mar 19 13:45, Peter Foley wrote: >> G++ 6.0 can assert that the this pointer is non-null for member functions. > > Maybe, but if it compains, it's bound to find fa

Re: [PATCH v2 1/3] Add option to not build mingw programs when cross compiling.

2016-03-30 Thread Peter Foley
On Wed, Mar 30, 2016 at 8:11 AM, Corinna Vinschen wrote: > Applied with changes. The below check was skewed. > >> +if test "x$with_mingw_progs" != xyes; then >> +AC_CONFIG_SUBDIRS([utils lsaauth]) >> +fi Whoops, good catch.

Re: [PATCH 3/3] Use just-built gcc for windres

2016-03-30 Thread Peter Foley
On Wed, Mar 30, 2016 at 8:31 AM, Corinna Vinschen wrote: > Are you sure this works as desired? In my standard cross build > environment, the only -B option added here is > > --preprocessor-arg=-B/build/cygwin/x86_64/vanilla/x86_64-pc-cygwin/newlib/ The only case in

Re: [PATCH 06/11] Remove always true nonnull check on "this" pointer.

2016-03-29 Thread Peter Foley
On Sat, Mar 19, 2016 at 1:45 PM, Peter Foley <pefol...@pefoley.com> wrote: > G++ 6.0 can assert that the this pointer is non-null for member functions. > > winsup/cygserver/ChangeLog > process.cc (submission_loop::request_loop): Remove nonnull check on this. > process.cc (sy

[PATCH 3/3] Use just-built gcc for windres

2016-03-23 Thread Peter Foley
/ChangeLog mkvers.sh: Manually specify preprocessor based on $CC Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/mkvers.sh | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/mkvers.sh b/winsup/cygwin/mkvers.sh index d

[PATCH v2 1/3] Add option to not build mingw programs when cross compiling.

2016-03-23 Thread Peter Foley
Add an option to not require a mingw compiler when bootstrapping a cross toolchain. Defaults to existing behavior. Also update some obsolete macros. winsup/ChangeLog configure.ac: Add option to skip building programs that require mingw. configure: Regenerate. Signed-off-by: Peter Foley <pe

[PATCH 2/3] Add with-only-headers

2016-03-23 Thread Peter Foley
winsup/cygwin/ChangeLog configure.ac: don't check AC_WINDOWS_LIBS when using with-only-headers configure: regenerate Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/Makefile.in| 5 + winsup/configure | 13 + winsup/configure.ac

Re: Update toplevel files from gcc

2016-03-23 Thread Peter Foley
On Wed, Mar 23, 2016 at 6:41 AM, Corinna Vinschen wrote: > Done yesterday. Thanks!

Re: [PATCH 4/5] Don't build utils/lsaauth when cross compiling.

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 9:49 PM, Yaakov Selkowitz wrote: > I really don't see the point of this. I maintain the pseudo-official cross > toolchains for Cygwin, and I just remove what is not needed for > cross-compiling from the DESTDIR after install. This is also a fairly

Re: [PATCH 5/5] Add with-only-headers

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 5:03 PM, Peter Foley <pefol...@pefoley.com> wrote: > On Mon, Mar 21, 2016 at 4:32 PM, Corinna Vinschen > <corinna-cyg...@cygwin.com> wrote: >> Still hmm at this point. AFAICS we only need the handful of definitions >> for new and

Re: [PATCH 5/5] Add with-only-headers

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 4:32 PM, Corinna Vinschen wrote: > Still hmm at this point. AFAICS we only need the handful of definitions > for new and delete operators, nothing else. Is there perhaps a way to > define this stuff by ourselves to avoid any requirement for

[PATCH v2] Use DnsFree instead of deprecated DnsRecordListFree

2016-03-21 Thread Peter Foley
' winsup/cygwin/ChangeLog autoload.cc: Load DnsFree rather then DnsRecordListFree libc/minires-os-if.cc (cygwin_query): Use DnsFree rather then DnsRecordListFree Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/autoload.cc | 2 +- winsup/cygwin/libc/minires-os-if

Re: [PATCH 5/5] Add with-only-headers

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 4:32 PM, Corinna Vinschen wrote: > Still hmm at this point. AFAICS we only need the handful of definitions > for new and delete operators, nothing else. Is there perhaps a way to > define this stuff by ourselves to avoid any requirement for

Re: [PATCH 2/5] Link against libdnsapi to avoid undefined reference

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:52 PM, Corinna Vinschen wrote: > While you're at it, ideally we make ourselves independent of the MingW > header version and use DnsFree directly, replacing DnsRecordListFree > in autoload.cc and libc/minires-os-if.c, no? Hmm, it isn't

Re: Update toplevel files from gcc

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:25 PM, Corinna Vinschen wrote: > Yes, but that's time-consuming since there's no automatism. Give me > a few days. Sure, I can just carry my local patch until you get a chance to work on it. Thanks, Peter

Re: [PATCH 2/5] Link against libdnsapi to avoid undefined reference

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:52 PM, Corinna Vinschen wrote: > While you're at it, ideally we make ourselves independent of the MingW > header version and use DnsFree directly, replacing DnsRecordListFree > in autoload.cc and libc/minires-os-if.c, no? Alright, I'll work on

Re: [PATCH 09/11] Add c++14 sized deallocation operator

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:55 PM, Corinna Vinschen wrote: > But using -std= when building Cygwin wouldn't change the fact that we > might need this delete anyway for applications built with -std=c++14 > or do I miss something? This patch is specifically for building

Re: [PATCH 4/5] Don't build utils/lsaauth when cross compiling.

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:58 PM, Corinna Vinschen wrote: > Again, I'm cross compiling all the time since I build Cygwin on Linux > for development and package building, and I'm certianly not the only > person doing that. This is the default case. Not building utils

Re: [PATCH 5/5] Add with-only-headers

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:47 PM, Corinna Vinschen <corinna-cyg...@cygwin.com> wrote: > On Mar 21 13:15, Peter Foley wrote: >> When cross-compiling a toolchan targeting cygwin, building cygwin1.dll >> requires libstdc++v3 to be built. > > Building cygwin1.dll d

Re: [PATCH 4/5] Don't build utils/lsaauth when cross compiling.

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:30 PM, Corinna Vinschen wrote: > I'm not sure this is the right thing to do. I'm cross compiling > Cygwin all the time, and I certainly need the mingw compiler to > build the utils and lsaauth dir. In what case do you not need them, > and

Re: [PATCH 2/5] Link against libdnsapi to avoid undefined reference

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 3:24 PM, Corinna Vinschen <corinna-cyg...@cygwin.com> wrote: > On Mar 21 13:15, Peter Foley wrote: >> /home/peter/cross/src/cygwin/winsup/cygwin/libc/minires-os-if.c:289: >> undefined reference to `DnsFree' >> >> winsup/cygwin/Change

Re: [PATCH 09/11] Add c++14 sized deallocation operator

2016-03-21 Thread Peter Foley
lt changes to c++14 in gcc 6.0 I'm not sure what level of -std would be appropriate by default though. Thanks, Peter Foley

Re: [PATCH 09/11] Add c++14 sized deallocation operator

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 1:13 PM, Corinna Vinschen wrote: > But we export these functions as fallback functions to the applications. > See libstdcxx_wrapper.cc and the end of cxx.cc. While the comment in > cxx.cc claims that this should "not be used in practice", there

[PATCH v2 1/5] Add nonnull annotation to posix_memalign.

2016-03-21 Thread Peter Foley
/cygwin/ChangeLog malloc_wrapper.cc (posix_memalign): Remove always true nonnull check. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- newlib/libc/include/stdlib.h| 2 +- winsup/cygwin/malloc_wrapper.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/newli

[PATCH 4/5] Don't build utils/lsaauth when cross compiling.

2016-03-21 Thread Peter Foley
Don't require a mingw compiler when bootstrapping a cross toolchain. Also update some obsolete macros. winsup/ChangeLog configure.ac: Only build lsaauth and utils when compiling natively configure: Regenerate. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/configure

[PATCH 5/5] Add with-only-headers

2016-03-21 Thread Peter Foley
winsup/cygwin/ChangeLog configure.ac: don't check AC_WINDOWS_LIBS when using with-only-headers configure: regenerate Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/Makefile.in| 5 + winsup/configure | 15 ++- winsup/config

[PATCH 2/5] Link against libdnsapi to avoid undefined reference

2016-03-21 Thread Peter Foley
/home/peter/cross/src/cygwin/winsup/cygwin/libc/minires-os-if.c:289: undefined reference to `DnsFree' winsup/cygwin/ChangeLog Makefile.in: Add libdnsapi to DLL_IMPORTS Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/Makefile.in | 3 ++- 1 file changed, 2 insertions

Update toplevel files from gcc

2016-03-21 Thread Peter Foley
, Makefile.tpl and configure.ac from gcc and regenerate Makefile.in and configure is 1.4M, so too large to send to the mailing list. Would it be possible for someone to sync the latest toplevel files from gcc? Thanks, Peter Foley

Re: [PATCH 09/11] Add c++14 sized deallocation operator

2016-03-21 Thread Peter Foley
On Sun, Mar 20, 2016 at 7:28 AM, Corinna Vinschen wrote: > This looks incomplete to me. Don't we have to export the symbol? I don't believe so. As I understand it, if you're overriding the standard c++ delete implementation, starting with c++14, you also need to

Re: [PATCH 05/11] A pointer to a pointer is nonnull.

2016-03-21 Thread Peter Foley
On Mon, Mar 21, 2016 at 11:05 AM, Corinna Vinschen wrote: > Yes, but in glibc this is combined with a header disallowing a non-NULL > argument. This is missing in newlib yet. I guess this would make the > change acceptable. Alternatively a __try/__except block in >

Re: [PATCH 05/11] A pointer to a pointer is nonnull.

2016-03-21 Thread Peter Foley
On Sun, Mar 20, 2016 at 7:15 AM, Corinna Vinschen wrote: > Eh, what?!? How on earth can gcc assert memptr is always non-NULL? > An application can call posix_memalign(NULL, 4096, 4096) just fine, > can't it? If so, *memptr = res crashes. > So, it looks like what's

Re: [PATCH 01/11] Remove unused and unsafe call to __builtin_frame_address

2016-03-20 Thread Peter Foley
On Sun, Mar 20, 2016 at 5:55 AM, Corinna Vinschen <corinna-cyg...@cygwin.com> wrote: > There's an assign.txt document you (and potentiall your employer) can > sign and send as PDF. It's usually rather painless. > > > Thanks, > Corinna Copyright assignment form signed and

[PATCH 09/11] Add c++14 sized deallocation operator

2016-03-19 Thread Peter Foley
When compiling with -std=c++14 (the default for gcc 6.0+), the sized deallocation operator must be defined to prevent undefined symbols when linking. winsup/cygwin/ChangeLog: cxx.cc (operator delete(void *p, size_t)): Define. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/

[PATCH 07/11] The address of an class always evaluates to true

2016-03-19 Thread Peter Foley
winsup/cygwin/pinfo.cc:465:14: error: the compiler can assume that the address of 'tc' will always evaluate to 'true' [-Werror=address] winsup/cygwin/ChangeLog * pinfo.cc (_pinfo::set_ctty): remove always true check. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/pi

[PATCH 11/11] respect datarootdir

2016-03-19 Thread Peter Foley
Recent versions of autoconf define datadir/infodir in terms of datarootdir. Add it. winsup/ChangeLog * Makefile.in: define datarootdir Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/winsup/Makefile.in b/

[PATCH 10/11] Fix strict aliasing

2016-03-19 Thread Peter Foley
Fix a strict aliasing error detected by gcc 6.0+ winsup/cygwin/ChangeLog * pinfo.cc (winpids::enum_process): Fix strict aliasing. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/pinfo.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/winsup/

[PATCH 06/11] Remove always true nonnull check on "this" pointer.

2016-03-19 Thread Peter Foley
. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygserver/process.cc| 3 --- winsup/cygserver/threaded_queue.cc | 4 winsup/cygwin/fhandler_dsp.cc | 4 ++-- winsup/cygwin/path.cc | 2 +- winsup/cygwin/pinfo.cc | 16

[PATCH 05/11] A pointer to a pointer is nonnull.

2016-03-19 Thread Peter Foley
GCC 6.0+ can assert that this argument is nonnull. Remove the unnecessary check to fix a warning. winsup/cygwin/ChangeLog malloc_wrapper.cc (posix_memalign): Remove always true nonnull check. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/malloc_wrapper.cc | 3 +--

[PATCH 08/11] Fix typoed comparison

2016-03-19 Thread Peter Foley
winsup/cygwin/ChangeLog * thread.cc (semaphore::open): Fix mistaken conditional. Signed-off-by: Peter Foley <pefol...@pefoley.com> --- winsup/cygwin/thread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 5

[PATCH 01/11] Remove unused and unsafe call to __builtin_frame_address

2016-03-19 Thread Peter Foley
] 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 <pefol...@pefoley.com> --- winsup/cygwin/lib/_cygwin_crt0_common.cc | 5 ++--- 1 file c

[PATCH 04/11] Remove misleading indentation

2016-03-19 Thread Peter Foley
GCC 6.0+ warns on misleading indentation, so fix it. winsup/cygserver/ChangeLog * sysv_msg.cc (msgsnd): Fix misleading indentation. * sysv_msg.cc (msgrcv): Ditto. * sysv_sem.cc (semop): Ditto. winsup/cygwing/ChangeLog * syscalls.cc (getpriority): Fix misleading indentation. Signed-off-by: Peter

Re: [PATCH] Regenerate newlib/configure

2016-03-14 Thread Peter Foley
On Mon, Mar 14, 2016 at 12:23 PM, Peter Foley <pefol...@pefoley.com> wrote: > Fix undefined libtool macros _LT_DECL_SED and _LT_PROG_ECHO_BACKSLASH > > newlib/ChangeLog > * configure: Regenerate. > > --- > newlib/configure | 9339 > ++

FW: [PATCH] Crosscompiling configure fix

2011-02-11 Thread Peter Foley
to skip tests that involve linking. Note: I submitted a previous patch that included this change, however only part of that patch was applied (the removal of AC_ALLOCA) so I am resubmitting the GCC_NO_EXECUTABLES part of the patch. Thanks, Peter Foley winsup/cygserver/ChangeLog: 2011-02-11 Peter