public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
@ 2020-12-16 13:38 Jonathan Wakely
  2020-12-17 14:05 ` Jonathan Wakely
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2020-12-16 13:38 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

This fixes a bug caused by a mismatch between the macros defined by
<errno.h> when GCC is built and the macros defined by <errno.h> when
users include <system_error>. If the user code is compiled with
_XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the
ENOTRECOVERABLE and EOWNERDEAD macros, which are not defined by SUSv3
(aka POSIX.1-2001).

Since POSIX requires the errno macros to be macros (and not variables or
enumerators) we can just test for them directly using the preprocessor.
That means that <system_error> will match what is actuallydefined when
it's included, not what was defined when GCC was built. With that change
there is no need for the GLIBCXX_CHECK_SYSTEM_ERROR configure checks and
they can be removed.

libstdc++-v3/ChangeLog:

	PR libstdc++/93151
	* acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Remove.
	* configure.ac: Regenerate.
	* config/os/generic/error_constants.h: Test POSIX errno macros
	directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
	* testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
	Likewise.
	* testsuite/19_diagnostics/headers/system_error/93151.cc: New
	test.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 10030 bytes --]

commit a2c2eec183acf25c9b214fa0827718e4d2fdfc93
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Dec 15 20:28:11 2020

    libstdc++: Test errno macros directly, not via autoconf [PR 93151]
    
    This fixes a bug caused by a mismatch between the macros defined by
    <errno.h> when GCC is built and the macros defined by <errno.h> when
    users include <system_error>. If the user code is compiled with
    _XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the
    ENOTRECOVERABLE and EOWNERDEAD macros, which are not defined by SUSv3
    (aka POSIX.1-2001).
    
    Since POSIX requires the errno macros to be macros (and not variables or
    enumerators) we can just test for them directly using the preprocessor.
    That means that <system_error> will match what is actuallydefined when
    it's included, not what was defined when GCC was built. With that change
    there is no need for the GLIBCXX_CHECK_SYSTEM_ERROR configure checks and
    they can be removed.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/93151
            * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Remove.
            * configure.ac: Regenerate.
            * config/os/generic/error_constants.h: Test POSIX errno macros
            directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
            * testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
            Likewise.
            * testsuite/19_diagnostics/headers/system_error/93151.cc: New
            test.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index df8be3bf805..e4175ea3e64 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2372,35 +2372,6 @@ AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
   AC_LANG_RESTORE
 ])
 
-dnl
-dnl Check whether macros, etc are present for <system_error>
-dnl
-AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [
-
-m4_pushdef([n_syserr], [1])dnl
-m4_foreach([syserr], [EOWNERDEAD, ENOTRECOVERABLE, ENOLINK, EPROTO, ENODATA,
-		      ENOSR, ENOSTR, ETIME, EBADMSG, ECANCELED,
-		      EOVERFLOW, ENOTSUP, EIDRM, ETXTBSY,
-		      ECHILD, ENOSPC, EPERM,
-		      ETIMEDOUT, EWOULDBLOCK],
-[m4_pushdef([SYSERR], m4_toupper(syserr))dnl
-AC_MSG_CHECKING([for syserr])
-AC_CACHE_VAL([glibcxx_cv_system_error[]n_syserr], [
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
-				   [int i = syserr;])],
-		  [glibcxx_cv_system_error[]n_syserr=yes],
-		  [glibcxx_cv_system_error[]n_syserr=no])
-])
-AC_MSG_RESULT([$glibcxx_cv_system_error[]n_syserr])
-if test x"$glibcxx_cv_system_error[]n_syserr" = x"yes"; then
-  AC_DEFINE([HAVE_]SYSERR, 1, [Define if ]syserr[ exists.])
-fi
-m4_define([n_syserr], m4_incr(n_syserr))dnl
-m4_popdef([SYSERR])dnl
-])
-m4_popdef([n_syserr])dnl
-])
-
 dnl
 dnl Check for what type of C headers to use.
 dnl
diff --git a/libstdc++-v3/config/os/generic/error_constants.h b/libstdc++-v3/config/os/generic/error_constants.h
index b5b0ea6b9ad..0d34f7179b6 100644
--- a/libstdc++-v3/config/os/generic/error_constants.h
+++ b/libstdc++-v3/config/os/generic/error_constants.h
@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       bad_address = 				EFAULT,
       bad_file_descriptor = 			EBADF,
 
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
       bad_message = 				EBADMSG,
 #endif
 
@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       function_not_supported = 			ENOSYS,
       host_unreachable = 			EHOSTUNREACH,
 
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
       identifier_removed = 			EIDRM,
 #endif
 
@@ -86,13 +86,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       no_buffer_space = 			ENOBUFS,
       no_child_process = 			ECHILD,
 
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
       no_link = 				ENOLINK,
 #endif
 
       no_lock_available = 			ENOLCK,
 
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
       no_message_available = 			ENODATA,
 #endif
 
@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       no_protocol_option = 			ENOPROTOOPT,
       no_space_on_device = 			ENOSPC,
 
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
       no_stream_resources = 			ENOSR,
 #endif
 
@@ -111,18 +111,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       not_a_directory = 			ENOTDIR,
       not_a_socket = 				ENOTSOCK,
 
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
       not_a_stream = 				ENOSTR,
 #endif
 
       not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
 
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ECANCELED
+#ifdef ECANCELED
       operation_canceled = 			ECANCELED,
 #endif
 
@@ -131,13 +131,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       operation_not_supported = 		EOPNOTSUPP,
       operation_would_block = 			EWOULDBLOCK,
 
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
       owner_dead = 				EOWNERDEAD,
 #endif
 
       permission_denied = 			EACCES,
 
-#ifdef _GLIBCXX_HAVE_EPROTO
+#ifdef EPROTO
       protocol_error = 				EPROTO,
 #endif
 
@@ -147,15 +147,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       resource_unavailable_try_again = 		EAGAIN,
       result_out_of_range = 			ERANGE,
 
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
       state_not_recoverable = 			ENOTRECOVERABLE,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
       stream_timeout = 				ETIME,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
       text_file_busy = 				ETXTBSY,
 #endif
 
@@ -165,7 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       too_many_links = 				EMLINK,
       too_many_symbolic_link_levels = 		ELOOP,
 
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
       value_too_large = 			EOVERFLOW,
 #endif
 
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 771814110a1..9138ba22588 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -183,7 +183,6 @@ GLIBCXX_ENABLE_VTABLE_VERIFY([no])
 # Checks for operating systems support that doesn't require linking.
 GLIBCXX_CHECK_STDIO_PROTO
 GLIBCXX_CHECK_MATH11_PROTO
-GLIBCXX_CHECK_SYSTEM_ERROR
 GLIBCXX_CHECK_UCHAR_H
 
 # For the streamoff typedef.
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/93151.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/93151.cc
new file mode 100644
index 00000000000..2d8efc76deb
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/93151.cc
@@ -0,0 +1,23 @@
+// { dg-do compile { target c++11 } }
+
+// Copyright (C) 2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/93151
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+#include <system_error>
diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
index 0f006ae47d9..72c4b53124d 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
@@ -34,7 +34,7 @@ void test01()
   TEST_ERRC(bad_address);
   TEST_ERRC(bad_file_descriptor);
 
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
   TEST_ERRC(bad_message);
 #endif
 
@@ -54,7 +54,7 @@ void test01()
   TEST_ERRC(function_not_supported);
   TEST_ERRC(host_unreachable);
 
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
   TEST_ERRC(identifier_removed);
 #endif
 
@@ -72,23 +72,23 @@ void test01()
   TEST_ERRC(no_buffer_space);
   TEST_ERRC(no_child_process);
 
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
   TEST_ERRC(no_link);
 #endif
 
   TEST_ERRC(no_lock_available);
 
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
   TEST_ERRC(no_message_available);
 #endif
 
-#ifdef _GLIBCXX_HAVE_ENOMSG
+#ifdef ENOMSG
   TEST_ERRC(no_message);
 #endif
   TEST_ERRC(no_protocol_option);
   TEST_ERRC(no_space_on_device);
 
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
   TEST_ERRC(no_stream_resources);
 #endif
 
@@ -99,15 +99,15 @@ void test01()
   TEST_ERRC(not_a_directory);
   TEST_ERRC(not_a_socket);
 
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
   TEST_ERRC(not_a_stream);
 #endif
 
-  TEST_ERRC(not_connected); 
+  TEST_ERRC(not_connected);
   TEST_ERRC(not_enough_memory);
   TEST_ERRC(not_supported);
 
-#ifdef _GLIBCXX_HAVE_ECANCELED
+#ifdef ECANCELED
   TEST_ERRC(operation_canceled);
 #endif
 
@@ -116,31 +116,31 @@ void test01()
   TEST_ERRC(operation_not_supported);
   TEST_ERRC(operation_would_block);
 
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
   TEST_ERRC(owner_dead);
 #endif
 
   TEST_ERRC(permission_denied);
 
-#ifdef _GLIBCXX_HAVE_EPROTO
+#ifdef EPROTO
   TEST_ERRC(protocol_error);
 #endif
 
   TEST_ERRC(protocol_not_supported);
   TEST_ERRC(read_only_file_system);
   TEST_ERRC(resource_deadlock_would_occur);
-  TEST_ERRC(resource_unavailable_try_again); 
+  TEST_ERRC(resource_unavailable_try_again);
   TEST_ERRC(result_out_of_range);
 
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
   TEST_ERRC(state_not_recoverable);
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
   TEST_ERRC(stream_timeout);
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
   TEST_ERRC(text_file_busy);
 #endif
 
@@ -150,7 +150,7 @@ void test01()
   TEST_ERRC(too_many_links);
   TEST_ERRC(too_many_symbolic_link_levels);
 
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
   TEST_ERRC(value_too_large);
 #endif
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2020-12-16 13:38 [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151] Jonathan Wakely
@ 2020-12-17 14:05 ` Jonathan Wakely
  2020-12-17 16:21   ` Jonathan Wakely
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2020-12-17 14:05 UTC (permalink / raw)
  To: libstdc++, gcc-patches

On 16/12/20 13:38 +0000, Jonathan Wakely wrote:
>This fixes a bug caused by a mismatch between the macros defined by
><errno.h> when GCC is built and the macros defined by <errno.h> when
>users include <system_error>. If the user code is compiled with
>_XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the
>ENOTRECOVERABLE and EOWNERDEAD macros, which are not defined by SUSv3
>(aka POSIX.1-2001).
>
>Since POSIX requires the errno macros to be macros (and not variables or
>enumerators) we can just test for them directly using the preprocessor.
>That means that <system_error> will match what is actuallydefined when
>it's included, not what was defined when GCC was built. With that change
>there is no need for the GLIBCXX_CHECK_SYSTEM_ERROR configure checks and
>they can be removed.
>
>libstdc++-v3/ChangeLog:
>
>	PR libstdc++/93151
>	* acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Remove.
>	* configure.ac: Regenerate.

Oops, that changelog was wrong.

>	* config/os/generic/error_constants.h: Test POSIX errno macros
>	directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
>	* testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
>	Likewise.
>	* testsuite/19_diagnostics/headers/system_error/93151.cc: New
>	test.

I forgot to regenerate the autoconf files. Fixed in r11-6229.

Tested powerpc64le-linux. Committed to trunk.

     libstdc++-v3/ChangeLog:

             * config.h.in: Regenerate.
             * configure: Regenerate.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2020-12-17 14:05 ` Jonathan Wakely
@ 2020-12-17 16:21   ` Jonathan Wakely
  2021-04-01 14:04     ` Eric Botcazou
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2020-12-17 16:21 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

On 17/12/20 14:05 +0000, Jonathan Wakely wrote:
>On 16/12/20 13:38 +0000, Jonathan Wakely wrote:
>>This fixes a bug caused by a mismatch between the macros defined by
>><errno.h> when GCC is built and the macros defined by <errno.h> when
>>users include <system_error>. If the user code is compiled with
>>_XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the
>>ENOTRECOVERABLE and EOWNERDEAD macros, which are not defined by SUSv3
>>(aka POSIX.1-2001).
>>
>>Since POSIX requires the errno macros to be macros (and not variables or
>>enumerators) we can just test for them directly using the preprocessor.
>>That means that <system_error> will match what is actuallydefined when
>>it's included, not what was defined when GCC was built. With that change
>>there is no need for the GLIBCXX_CHECK_SYSTEM_ERROR configure checks and
>>they can be removed.
>>
>>libstdc++-v3/ChangeLog:
>>
>>	PR libstdc++/93151
>>	* acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Remove.
>>	* configure.ac: Regenerate.
>
>Oops, that changelog was wrong.
>
>>	* config/os/generic/error_constants.h: Test POSIX errno macros
>>	directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
>>	* testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
>>	Likewise.
>>	* testsuite/19_diagnostics/headers/system_error/93151.cc: New
>>	test.
>
>I forgot to regenerate the autoconf files. Fixed in r11-6229.
>
>Tested powerpc64le-linux. Committed to trunk.
>
>    libstdc++-v3/ChangeLog:
>
>            * config.h.in: Regenerate.
>            * configure: Regenerate.

Oops, and I also forgot to update the other headers that were using
those autoconf-generated macros!

Fixed by this patch. Tested on mingw-w64, pushed to trunk.



>

[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 9161 bytes --]

commit 217d5beaff9987a9845155fc796322b5f8bb876d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Dec 17 16:03:07 2020

    libstdc++: Test errno macros directly for all targets [PR 93151]
    
    This applies the same changes to the djgpp and mingw versions of
    error_constants.h as r11-6137 did for the generic version.
    
    All of these constants are defined as macros by <errno.h> on these
    targets, so we can just test the macro directly instead of checking for
    it at configure time.
    
    libstdc++-v3/ChangeLog:
    
            * config/os/djgpp/error_constants.h: Test POSIX errno macros
            directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
            * config/os/mingw32-w64/error_constants.h: Likewise.
            * config/os/mingw32/error_constants.h: Likewise.

diff --git a/libstdc++-v3/config/os/djgpp/error_constants.h b/libstdc++-v3/config/os/djgpp/error_constants.h
index e0a67bc8d6d..8f947e69e37 100644
--- a/libstdc++-v3/config/os/djgpp/error_constants.h
+++ b/libstdc++-v3/config/os/djgpp/error_constants.h
@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       bad_address = 				EFAULT,
       bad_file_descriptor = 			EBADF,
 
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
       bad_message = 				EBADMSG,
 #endif
 
@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       function_not_supported = 			ENOSYS,
 //    host_unreachable = 			EHOSTUNREACH,
 
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
       identifier_removed = 			EIDRM,
 #endif
 
@@ -86,13 +86,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    no_buffer_space = 			ENOBUFS,
       no_child_process = 			ECHILD,
 
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
       no_link = 				ENOLINK,
 #endif
 
       no_lock_available = 			ENOLCK,
 
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
       no_message_available = 			ENODATA,
 #endif
 
@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    no_protocol_option = 			ENOPROTOOPT,
       no_space_on_device = 			ENOSPC,
 
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
       no_stream_resources = 			ENOSR,
 #endif
 
@@ -111,18 +111,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       not_a_directory = 			ENOTDIR,
 //    not_a_socket = 				ENOTSOCK,
 
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
       not_a_stream = 				ENOSTR,
 #endif
 
 //    not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
 
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ECANCELED
+#ifdef ECANCELED
       operation_canceled = 			ECANCELED,
 #endif
 
@@ -131,13 +131,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    operation_not_supported = 		EOPNOTSUPP,
 //    operation_would_block = 			EWOULDBLOCK,
 
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
       owner_dead = 				EOWNERDEAD,
 #endif
 
       permission_denied = 			EACCES,
 
-#ifdef _GLIBCXX_HAVE_EPROTO
+#ifdef EPROTO
       protocol_error = 				EPROTO,
 #endif
 
@@ -147,15 +147,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       resource_unavailable_try_again = 		EAGAIN,
       result_out_of_range = 			ERANGE,
 
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
       state_not_recoverable = 			ENOTRECOVERABLE,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
       stream_timeout = 				ETIME,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
       text_file_busy = 				ETXTBSY,
 #endif
 
@@ -165,7 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       too_many_links = 				EMLINK,
       too_many_symbolic_link_levels = 		ELOOP,
 
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
       value_too_large = 			EOVERFLOW,
 #endif
 
diff --git a/libstdc++-v3/config/os/mingw32-w64/error_constants.h b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
index 72422299def..3534c3e11b7 100644
--- a/libstdc++-v3/config/os/mingw32-w64/error_constants.h
+++ b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
@@ -49,7 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       argument_out_of_domain = 			EDOM,
       bad_address = 				EFAULT,
       bad_file_descriptor = 			EBADF,
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
       bad_message = 				EBADMSG,
 #endif
       broken_pipe = 				EPIPE,
@@ -67,7 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       filename_too_long = 			ENAMETOOLONG,
       function_not_supported = 			ENOSYS,
       host_unreachable = 			EHOSTUNREACH,
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
       identifier_removed = 			EIDRM,
 #endif
       illegal_byte_sequence = 			EILSEQ,
@@ -82,24 +82,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       network_reset = 				ENETRESET,
       network_unreachable = 			ENETUNREACH,
       no_buffer_space = 			ENOBUFS,
-#ifdef _GLIBCXX_HAVE_ECHILD
+#ifdef ECHILD
       no_child_process = 			ECHILD,
 #endif
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
       no_link = 				ENOLINK,
 #endif
       no_lock_available = 			ENOLCK,
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
       no_message_available = 			ENODATA,
 #endif
-#ifdef _GLIBCXX_HAVE_ENOMSG
+#ifdef ENOMSG
       no_message = 				ENOMSG,
 #endif
       no_protocol_option = 			ENOPROTOOPT,
-#ifdef _GLIBCXX_HAVE_ENOSPC
+#ifdef ENOSPC
       no_space_on_device = 			ENOSPC,
 #endif
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
       no_stream_resources = 			ENOSR,
 #endif
       no_such_device_or_address = 		ENXIO,
@@ -108,24 +108,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       no_such_process = 			ESRCH,
       not_a_directory = 			ENOTDIR,
       not_a_socket = 				ENOTSOCK,
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
       not_a_stream = 				ENOSTR,
 #endif
       not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
       operation_canceled = 			ECANCELED,
       operation_in_progress = 			EINPROGRESS,
-#ifdef _GLIBCXX_HAVE_EPERM
+#ifdef EPERM
       operation_not_permitted = 		EPERM,
 #endif
       operation_not_supported = 		EOPNOTSUPP,
-#ifdef _GLIBCXX_HAVE_EWOULDBLOCK
+#ifdef EWOULDBLOCK
       operation_would_block = 			EWOULDBLOCK,
 #endif
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
       owner_dead = 				EOWNERDEAD,
 #endif
       permission_denied = 			EACCES,
@@ -135,23 +135,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       resource_deadlock_would_occur = 		EDEADLK,
       resource_unavailable_try_again = 		EAGAIN,
       result_out_of_range = 			ERANGE,
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
       state_not_recoverable = 			ENOTRECOVERABLE,
 #endif
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
       stream_timeout = 				ETIME,
 #endif
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
       text_file_busy = 				ETXTBSY,
 #endif
-#ifdef _GLIBCXX_HAVE_ETIMEDOUT
+#ifdef ETIMEDOUT
       timed_out = 				ETIMEDOUT,
 #endif
       too_many_files_open_in_system = 		ENFILE,
       too_many_files_open = 			EMFILE,
       too_many_links = 				EMLINK,
       too_many_symbolic_link_levels = 		ELOOP,
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
       value_too_large = 			EOVERFLOW,
 #endif
       wrong_protocol_type = 			EPROTOTYPE
diff --git a/libstdc++-v3/config/os/mingw32/error_constants.h b/libstdc++-v3/config/os/mingw32/error_constants.h
index 68ac72a78fb..2222c5227c4 100644
--- a/libstdc++-v3/config/os/mingw32/error_constants.h
+++ b/libstdc++-v3/config/os/mingw32/error_constants.h
@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    network_reset = 				ENETRESET,
 //    network_unreachable = 			ENETUNREACH,
 //    no_buffer_space = 			ENOBUFS,
-#ifdef _GLIBCXX_HAVE_ECHILD
+#ifdef ECHILD
       no_child_process = 			ECHILD,
 #endif
 //    no_link = 				ENOLINK,
@@ -86,7 +86,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    no_message_available = 			ENODATA,
 //    no_message = 				ENOMSG,
 //    no_protocol_option = 			ENOPROTOOPT,
-#ifdef _GLIBCXX_HAVE_ENOSPC
+#ifdef ENOSPC
       no_space_on_device = 			ENOSPC,
 #endif
 //    no_stream_resources = 			ENOSR,
@@ -99,16 +99,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    not_a_stream = 				ENOSTR,
 //    not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
 //    operation_canceled = 			ECANCELED,
 //    operation_in_progress = 			EINPROGRESS,
-#ifdef _GLIBCXX_HAVE_EPERM
+#ifdef EPERM
       operation_not_permitted = 		EPERM,
 #endif
 //    operation_not_supported = 		EOPNOTSUPP,
-#ifdef _GLIBCXX_HAVE_EWOULDBLOCK
+#ifdef EWOULDBLOCK
       operation_would_block = 			EWOULDBLOCK,
 #endif
 //    owner_dead = 				EOWNERDEAD,
@@ -122,14 +122,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    state_not_recoverable = 			ENOTRECOVERABLE,
 //    stream_timeout = 				ETIME,
 //    text_file_busy = 				ETXTBSY,
-#ifdef _GLIBCXX_HAVE_ETIMEDOUT
+#ifdef ETIMEDOUT
       timed_out = 				ETIMEDOUT,
 #endif
       too_many_files_open_in_system = 		ENFILE,
       too_many_files_open = 			EMFILE,
       too_many_links = 				EMLINK
 //    too_many_symbolic_link_levels = 		ELOOP,
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
 	,
       value_too_large = 			EOVERFLOW
 #endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2020-12-17 16:21   ` Jonathan Wakely
@ 2021-04-01 14:04     ` Eric Botcazou
  2021-04-01 14:25       ` Jonathan Wakely
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Botcazou @ 2021-04-01 14:04 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches

> Oops, and I also forgot to update the other headers that were using
> those autoconf-generated macros!
> 
> Fixed by this patch. Tested on mingw-w64, pushed to trunk.

The original patch was apparently backported onto the gcc-10 branch, but not 
this follow-up fix, so Windows builds are now broken on the branch.

-- 
Eric Botcazou



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2021-04-01 14:04     ` Eric Botcazou
@ 2021-04-01 14:25       ` Jonathan Wakely
  2021-04-01 14:27         ` Jakub Jelinek
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2021-04-01 14:25 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

On 01/04/21 16:04 +0200, Eric Botcazou wrote:
>> Oops, and I also forgot to update the other headers that were using
>> those autoconf-generated macros!
>>
>> Fixed by this patch. Tested on mingw-w64, pushed to trunk.
>
>The original patch was apparently backported onto the gcc-10 branch, but not
>this follow-up fix, so Windows builds are now broken on the branch.

Sorry. I did try to test a mingw-w64 cross, but I think I probably
tested it against trunk not the branch. So didn't test it at all.

It should be fixed by the attached patch for gcc-10. I'm testing it
now on linux and mingw.

I'll wait for RM approval before pushing.




[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 9321 bytes --]

commit 03a430a55093d2ea5b80db3273c3a7134367272a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Dec 17 13:27:04 2020 +0000

    libstdc++: Test errno macros directly for all targets [PR 93151]
    
    This applies the same changes to the djgpp and mingw versions of
    error_constants.h as r11-6137 did for the generic version.
    
    All of these constants are defined as macros by <errno.h> on these
    targets, so we can just test the macro directly instead of checking for
    it at configure time.
    
    libstdc++-v3/ChangeLog:
    
            * config.h.in: Regenerate.
            * config/os/djgpp/error_constants.h: Test POSIX errno macros
            directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
            * config/os/mingw32-w64/error_constants.h: Likewise.
            * config/os/mingw32/error_constants.h: Likewise.
            * configure: Regenerate.
    
    (cherry picked from commit 217d5beaff9987a9845155fc796322b5f8bb876d)

diff --git a/libstdc++-v3/config/os/djgpp/error_constants.h b/libstdc++-v3/config/os/djgpp/error_constants.h
index e0a67bc8d6d..8f947e69e37 100644
--- a/libstdc++-v3/config/os/djgpp/error_constants.h
+++ b/libstdc++-v3/config/os/djgpp/error_constants.h
@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       bad_address = 				EFAULT,
       bad_file_descriptor = 			EBADF,
 
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
       bad_message = 				EBADMSG,
 #endif
 
@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       function_not_supported = 			ENOSYS,
 //    host_unreachable = 			EHOSTUNREACH,
 
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
       identifier_removed = 			EIDRM,
 #endif
 
@@ -86,13 +86,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    no_buffer_space = 			ENOBUFS,
       no_child_process = 			ECHILD,
 
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
       no_link = 				ENOLINK,
 #endif
 
       no_lock_available = 			ENOLCK,
 
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
       no_message_available = 			ENODATA,
 #endif
 
@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    no_protocol_option = 			ENOPROTOOPT,
       no_space_on_device = 			ENOSPC,
 
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
       no_stream_resources = 			ENOSR,
 #endif
 
@@ -111,18 +111,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       not_a_directory = 			ENOTDIR,
 //    not_a_socket = 				ENOTSOCK,
 
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
       not_a_stream = 				ENOSTR,
 #endif
 
 //    not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
 
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ECANCELED
+#ifdef ECANCELED
       operation_canceled = 			ECANCELED,
 #endif
 
@@ -131,13 +131,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    operation_not_supported = 		EOPNOTSUPP,
 //    operation_would_block = 			EWOULDBLOCK,
 
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
       owner_dead = 				EOWNERDEAD,
 #endif
 
       permission_denied = 			EACCES,
 
-#ifdef _GLIBCXX_HAVE_EPROTO
+#ifdef EPROTO
       protocol_error = 				EPROTO,
 #endif
 
@@ -147,15 +147,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       resource_unavailable_try_again = 		EAGAIN,
       result_out_of_range = 			ERANGE,
 
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
       state_not_recoverable = 			ENOTRECOVERABLE,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
       stream_timeout = 				ETIME,
 #endif
 
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
       text_file_busy = 				ETXTBSY,
 #endif
 
@@ -165,7 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       too_many_links = 				EMLINK,
       too_many_symbolic_link_levels = 		ELOOP,
 
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
       value_too_large = 			EOVERFLOW,
 #endif
 
diff --git a/libstdc++-v3/config/os/mingw32-w64/error_constants.h b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
index 72422299def..3534c3e11b7 100644
--- a/libstdc++-v3/config/os/mingw32-w64/error_constants.h
+++ b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
@@ -49,7 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       argument_out_of_domain = 			EDOM,
       bad_address = 				EFAULT,
       bad_file_descriptor = 			EBADF,
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
       bad_message = 				EBADMSG,
 #endif
       broken_pipe = 				EPIPE,
@@ -67,7 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       filename_too_long = 			ENAMETOOLONG,
       function_not_supported = 			ENOSYS,
       host_unreachable = 			EHOSTUNREACH,
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
       identifier_removed = 			EIDRM,
 #endif
       illegal_byte_sequence = 			EILSEQ,
@@ -82,24 +82,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       network_reset = 				ENETRESET,
       network_unreachable = 			ENETUNREACH,
       no_buffer_space = 			ENOBUFS,
-#ifdef _GLIBCXX_HAVE_ECHILD
+#ifdef ECHILD
       no_child_process = 			ECHILD,
 #endif
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
       no_link = 				ENOLINK,
 #endif
       no_lock_available = 			ENOLCK,
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
       no_message_available = 			ENODATA,
 #endif
-#ifdef _GLIBCXX_HAVE_ENOMSG
+#ifdef ENOMSG
       no_message = 				ENOMSG,
 #endif
       no_protocol_option = 			ENOPROTOOPT,
-#ifdef _GLIBCXX_HAVE_ENOSPC
+#ifdef ENOSPC
       no_space_on_device = 			ENOSPC,
 #endif
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
       no_stream_resources = 			ENOSR,
 #endif
       no_such_device_or_address = 		ENXIO,
@@ -108,24 +108,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       no_such_process = 			ESRCH,
       not_a_directory = 			ENOTDIR,
       not_a_socket = 				ENOTSOCK,
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
       not_a_stream = 				ENOSTR,
 #endif
       not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
       operation_canceled = 			ECANCELED,
       operation_in_progress = 			EINPROGRESS,
-#ifdef _GLIBCXX_HAVE_EPERM
+#ifdef EPERM
       operation_not_permitted = 		EPERM,
 #endif
       operation_not_supported = 		EOPNOTSUPP,
-#ifdef _GLIBCXX_HAVE_EWOULDBLOCK
+#ifdef EWOULDBLOCK
       operation_would_block = 			EWOULDBLOCK,
 #endif
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
       owner_dead = 				EOWNERDEAD,
 #endif
       permission_denied = 			EACCES,
@@ -135,23 +135,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       resource_deadlock_would_occur = 		EDEADLK,
       resource_unavailable_try_again = 		EAGAIN,
       result_out_of_range = 			ERANGE,
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
       state_not_recoverable = 			ENOTRECOVERABLE,
 #endif
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
       stream_timeout = 				ETIME,
 #endif
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
       text_file_busy = 				ETXTBSY,
 #endif
-#ifdef _GLIBCXX_HAVE_ETIMEDOUT
+#ifdef ETIMEDOUT
       timed_out = 				ETIMEDOUT,
 #endif
       too_many_files_open_in_system = 		ENFILE,
       too_many_files_open = 			EMFILE,
       too_many_links = 				EMLINK,
       too_many_symbolic_link_levels = 		ELOOP,
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
       value_too_large = 			EOVERFLOW,
 #endif
       wrong_protocol_type = 			EPROTOTYPE
diff --git a/libstdc++-v3/config/os/mingw32/error_constants.h b/libstdc++-v3/config/os/mingw32/error_constants.h
index 68ac72a78fb..2222c5227c4 100644
--- a/libstdc++-v3/config/os/mingw32/error_constants.h
+++ b/libstdc++-v3/config/os/mingw32/error_constants.h
@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    network_reset = 				ENETRESET,
 //    network_unreachable = 			ENETUNREACH,
 //    no_buffer_space = 			ENOBUFS,
-#ifdef _GLIBCXX_HAVE_ECHILD
+#ifdef ECHILD
       no_child_process = 			ECHILD,
 #endif
 //    no_link = 				ENOLINK,
@@ -86,7 +86,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    no_message_available = 			ENODATA,
 //    no_message = 				ENOMSG,
 //    no_protocol_option = 			ENOPROTOOPT,
-#ifdef _GLIBCXX_HAVE_ENOSPC
+#ifdef ENOSPC
       no_space_on_device = 			ENOSPC,
 #endif
 //    no_stream_resources = 			ENOSR,
@@ -99,16 +99,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    not_a_stream = 				ENOSTR,
 //    not_connected = 				ENOTCONN,
       not_enough_memory = 			ENOMEM,
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
       not_supported = 				ENOTSUP,
 #endif
 //    operation_canceled = 			ECANCELED,
 //    operation_in_progress = 			EINPROGRESS,
-#ifdef _GLIBCXX_HAVE_EPERM
+#ifdef EPERM
       operation_not_permitted = 		EPERM,
 #endif
 //    operation_not_supported = 		EOPNOTSUPP,
-#ifdef _GLIBCXX_HAVE_EWOULDBLOCK
+#ifdef EWOULDBLOCK
       operation_would_block = 			EWOULDBLOCK,
 #endif
 //    owner_dead = 				EOWNERDEAD,
@@ -122,14 +122,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 //    state_not_recoverable = 			ENOTRECOVERABLE,
 //    stream_timeout = 				ETIME,
 //    text_file_busy = 				ETXTBSY,
-#ifdef _GLIBCXX_HAVE_ETIMEDOUT
+#ifdef ETIMEDOUT
       timed_out = 				ETIMEDOUT,
 #endif
       too_many_files_open_in_system = 		ENFILE,
       too_many_files_open = 			EMFILE,
       too_many_links = 				EMLINK
 //    too_many_symbolic_link_levels = 		ELOOP,
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
 	,
       value_too_large = 			EOVERFLOW
 #endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2021-04-01 14:25       ` Jonathan Wakely
@ 2021-04-01 14:27         ` Jakub Jelinek
  2021-04-01 15:15           ` Jonathan Wakely
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Jelinek @ 2021-04-01 14:27 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Eric Botcazou, libstdc++, gcc-patches

On Thu, Apr 01, 2021 at 03:25:56PM +0100, Jonathan Wakely via Gcc-patches wrote:
> On 01/04/21 16:04 +0200, Eric Botcazou wrote:
> > > Oops, and I also forgot to update the other headers that were using
> > > those autoconf-generated macros!
> > > 
> > > Fixed by this patch. Tested on mingw-w64, pushed to trunk.
> > 
> > The original patch was apparently backported onto the gcc-10 branch, but not
> > this follow-up fix, so Windows builds are now broken on the branch.
> 
> Sorry. I did try to test a mingw-w64 cross, but I think I probably
> tested it against trunk not the branch. So didn't test it at all.
> 
> It should be fixed by the attached patch for gcc-10. I'm testing it
> now on linux and mingw.
> 
> I'll wait for RM approval before pushing.

Ok for 10.3, thanks.

> commit 03a430a55093d2ea5b80db3273c3a7134367272a
> Author: Jonathan Wakely <jwakely@redhat.com>
> Date:   Thu Dec 17 13:27:04 2020 +0000
> 
>     libstdc++: Test errno macros directly for all targets [PR 93151]
>     
>     This applies the same changes to the djgpp and mingw versions of
>     error_constants.h as r11-6137 did for the generic version.
>     
>     All of these constants are defined as macros by <errno.h> on these
>     targets, so we can just test the macro directly instead of checking for
>     it at configure time.
>     
>     libstdc++-v3/ChangeLog:
>     
>             * config.h.in: Regenerate.
>             * config/os/djgpp/error_constants.h: Test POSIX errno macros
>             directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
>             * config/os/mingw32-w64/error_constants.h: Likewise.
>             * config/os/mingw32/error_constants.h: Likewise.
>             * configure: Regenerate.
>     
>     (cherry picked from commit 217d5beaff9987a9845155fc796322b5f8bb876d)
> 
> diff --git a/libstdc++-v3/config/os/djgpp/error_constants.h b/libstdc++-v3/config/os/djgpp/error_constants.h
> index e0a67bc8d6d..8f947e69e37 100644
> --- a/libstdc++-v3/config/os/djgpp/error_constants.h
> +++ b/libstdc++-v3/config/os/djgpp/error_constants.h
> @@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        bad_address = 				EFAULT,
>        bad_file_descriptor = 			EBADF,
>  
> -#ifdef _GLIBCXX_HAVE_EBADMSG
> +#ifdef EBADMSG
>        bad_message = 				EBADMSG,
>  #endif
>  
> @@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        function_not_supported = 			ENOSYS,
>  //    host_unreachable = 			EHOSTUNREACH,
>  
> -#ifdef _GLIBCXX_HAVE_EIDRM
> +#ifdef EIDRM
>        identifier_removed = 			EIDRM,
>  #endif
>  
> @@ -86,13 +86,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    no_buffer_space = 			ENOBUFS,
>        no_child_process = 			ECHILD,
>  
> -#ifdef _GLIBCXX_HAVE_ENOLINK
> +#ifdef ENOLINK
>        no_link = 				ENOLINK,
>  #endif
>  
>        no_lock_available = 			ENOLCK,
>  
> -#ifdef _GLIBCXX_HAVE_ENODATA
> +#ifdef ENODATA
>        no_message_available = 			ENODATA,
>  #endif
>  
> @@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    no_protocol_option = 			ENOPROTOOPT,
>        no_space_on_device = 			ENOSPC,
>  
> -#ifdef _GLIBCXX_HAVE_ENOSR
> +#ifdef ENOSR
>        no_stream_resources = 			ENOSR,
>  #endif
>  
> @@ -111,18 +111,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        not_a_directory = 			ENOTDIR,
>  //    not_a_socket = 				ENOTSOCK,
>  
> -#ifdef _GLIBCXX_HAVE_ENOSTR
> +#ifdef ENOSTR
>        not_a_stream = 				ENOSTR,
>  #endif
>  
>  //    not_connected = 				ENOTCONN,
>        not_enough_memory = 			ENOMEM,
>  
> -#ifdef _GLIBCXX_HAVE_ENOTSUP
> +#ifdef ENOTSUP
>        not_supported = 				ENOTSUP,
>  #endif
>  
> -#ifdef _GLIBCXX_HAVE_ECANCELED
> +#ifdef ECANCELED
>        operation_canceled = 			ECANCELED,
>  #endif
>  
> @@ -131,13 +131,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    operation_not_supported = 		EOPNOTSUPP,
>  //    operation_would_block = 			EWOULDBLOCK,
>  
> -#ifdef _GLIBCXX_HAVE_EOWNERDEAD
> +#ifdef EOWNERDEAD
>        owner_dead = 				EOWNERDEAD,
>  #endif
>  
>        permission_denied = 			EACCES,
>  
> -#ifdef _GLIBCXX_HAVE_EPROTO
> +#ifdef EPROTO
>        protocol_error = 				EPROTO,
>  #endif
>  
> @@ -147,15 +147,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        resource_unavailable_try_again = 		EAGAIN,
>        result_out_of_range = 			ERANGE,
>  
> -#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
> +#ifdef ENOTRECOVERABLE
>        state_not_recoverable = 			ENOTRECOVERABLE,
>  #endif
>  
> -#ifdef _GLIBCXX_HAVE_ETIME
> +#ifdef ETIME
>        stream_timeout = 				ETIME,
>  #endif
>  
> -#ifdef _GLIBCXX_HAVE_ETXTBSY
> +#ifdef ETXTBSY
>        text_file_busy = 				ETXTBSY,
>  #endif
>  
> @@ -165,7 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        too_many_links = 				EMLINK,
>        too_many_symbolic_link_levels = 		ELOOP,
>  
> -#ifdef _GLIBCXX_HAVE_EOVERFLOW
> +#ifdef EOVERFLOW
>        value_too_large = 			EOVERFLOW,
>  #endif
>  
> diff --git a/libstdc++-v3/config/os/mingw32-w64/error_constants.h b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
> index 72422299def..3534c3e11b7 100644
> --- a/libstdc++-v3/config/os/mingw32-w64/error_constants.h
> +++ b/libstdc++-v3/config/os/mingw32-w64/error_constants.h
> @@ -49,7 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        argument_out_of_domain = 			EDOM,
>        bad_address = 				EFAULT,
>        bad_file_descriptor = 			EBADF,
> -#ifdef _GLIBCXX_HAVE_EBADMSG
> +#ifdef EBADMSG
>        bad_message = 				EBADMSG,
>  #endif
>        broken_pipe = 				EPIPE,
> @@ -67,7 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        filename_too_long = 			ENAMETOOLONG,
>        function_not_supported = 			ENOSYS,
>        host_unreachable = 			EHOSTUNREACH,
> -#ifdef _GLIBCXX_HAVE_EIDRM
> +#ifdef EIDRM
>        identifier_removed = 			EIDRM,
>  #endif
>        illegal_byte_sequence = 			EILSEQ,
> @@ -82,24 +82,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        network_reset = 				ENETRESET,
>        network_unreachable = 			ENETUNREACH,
>        no_buffer_space = 			ENOBUFS,
> -#ifdef _GLIBCXX_HAVE_ECHILD
> +#ifdef ECHILD
>        no_child_process = 			ECHILD,
>  #endif
> -#ifdef _GLIBCXX_HAVE_ENOLINK
> +#ifdef ENOLINK
>        no_link = 				ENOLINK,
>  #endif
>        no_lock_available = 			ENOLCK,
> -#ifdef _GLIBCXX_HAVE_ENODATA
> +#ifdef ENODATA
>        no_message_available = 			ENODATA,
>  #endif
> -#ifdef _GLIBCXX_HAVE_ENOMSG
> +#ifdef ENOMSG
>        no_message = 				ENOMSG,
>  #endif
>        no_protocol_option = 			ENOPROTOOPT,
> -#ifdef _GLIBCXX_HAVE_ENOSPC
> +#ifdef ENOSPC
>        no_space_on_device = 			ENOSPC,
>  #endif
> -#ifdef _GLIBCXX_HAVE_ENOSR
> +#ifdef ENOSR
>        no_stream_resources = 			ENOSR,
>  #endif
>        no_such_device_or_address = 		ENXIO,
> @@ -108,24 +108,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        no_such_process = 			ESRCH,
>        not_a_directory = 			ENOTDIR,
>        not_a_socket = 				ENOTSOCK,
> -#ifdef _GLIBCXX_HAVE_ENOSTR
> +#ifdef ENOSTR
>        not_a_stream = 				ENOSTR,
>  #endif
>        not_connected = 				ENOTCONN,
>        not_enough_memory = 			ENOMEM,
> -#ifdef _GLIBCXX_HAVE_ENOTSUP
> +#ifdef ENOTSUP
>        not_supported = 				ENOTSUP,
>  #endif
>        operation_canceled = 			ECANCELED,
>        operation_in_progress = 			EINPROGRESS,
> -#ifdef _GLIBCXX_HAVE_EPERM
> +#ifdef EPERM
>        operation_not_permitted = 		EPERM,
>  #endif
>        operation_not_supported = 		EOPNOTSUPP,
> -#ifdef _GLIBCXX_HAVE_EWOULDBLOCK
> +#ifdef EWOULDBLOCK
>        operation_would_block = 			EWOULDBLOCK,
>  #endif
> -#ifdef _GLIBCXX_HAVE_EOWNERDEAD
> +#ifdef EOWNERDEAD
>        owner_dead = 				EOWNERDEAD,
>  #endif
>        permission_denied = 			EACCES,
> @@ -135,23 +135,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>        resource_deadlock_would_occur = 		EDEADLK,
>        resource_unavailable_try_again = 		EAGAIN,
>        result_out_of_range = 			ERANGE,
> -#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
> +#ifdef ENOTRECOVERABLE
>        state_not_recoverable = 			ENOTRECOVERABLE,
>  #endif
> -#ifdef _GLIBCXX_HAVE_ETIME
> +#ifdef ETIME
>        stream_timeout = 				ETIME,
>  #endif
> -#ifdef _GLIBCXX_HAVE_ETXTBSY
> +#ifdef ETXTBSY
>        text_file_busy = 				ETXTBSY,
>  #endif
> -#ifdef _GLIBCXX_HAVE_ETIMEDOUT
> +#ifdef ETIMEDOUT
>        timed_out = 				ETIMEDOUT,
>  #endif
>        too_many_files_open_in_system = 		ENFILE,
>        too_many_files_open = 			EMFILE,
>        too_many_links = 				EMLINK,
>        too_many_symbolic_link_levels = 		ELOOP,
> -#ifdef _GLIBCXX_HAVE_EOVERFLOW
> +#ifdef EOVERFLOW
>        value_too_large = 			EOVERFLOW,
>  #endif
>        wrong_protocol_type = 			EPROTOTYPE
> diff --git a/libstdc++-v3/config/os/mingw32/error_constants.h b/libstdc++-v3/config/os/mingw32/error_constants.h
> index 68ac72a78fb..2222c5227c4 100644
> --- a/libstdc++-v3/config/os/mingw32/error_constants.h
> +++ b/libstdc++-v3/config/os/mingw32/error_constants.h
> @@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    network_reset = 				ENETRESET,
>  //    network_unreachable = 			ENETUNREACH,
>  //    no_buffer_space = 			ENOBUFS,
> -#ifdef _GLIBCXX_HAVE_ECHILD
> +#ifdef ECHILD
>        no_child_process = 			ECHILD,
>  #endif
>  //    no_link = 				ENOLINK,
> @@ -86,7 +86,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    no_message_available = 			ENODATA,
>  //    no_message = 				ENOMSG,
>  //    no_protocol_option = 			ENOPROTOOPT,
> -#ifdef _GLIBCXX_HAVE_ENOSPC
> +#ifdef ENOSPC
>        no_space_on_device = 			ENOSPC,
>  #endif
>  //    no_stream_resources = 			ENOSR,
> @@ -99,16 +99,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    not_a_stream = 				ENOSTR,
>  //    not_connected = 				ENOTCONN,
>        not_enough_memory = 			ENOMEM,
> -#ifdef _GLIBCXX_HAVE_ENOTSUP
> +#ifdef ENOTSUP
>        not_supported = 				ENOTSUP,
>  #endif
>  //    operation_canceled = 			ECANCELED,
>  //    operation_in_progress = 			EINPROGRESS,
> -#ifdef _GLIBCXX_HAVE_EPERM
> +#ifdef EPERM
>        operation_not_permitted = 		EPERM,
>  #endif
>  //    operation_not_supported = 		EOPNOTSUPP,
> -#ifdef _GLIBCXX_HAVE_EWOULDBLOCK
> +#ifdef EWOULDBLOCK
>        operation_would_block = 			EWOULDBLOCK,
>  #endif
>  //    owner_dead = 				EOWNERDEAD,
> @@ -122,14 +122,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  //    state_not_recoverable = 			ENOTRECOVERABLE,
>  //    stream_timeout = 				ETIME,
>  //    text_file_busy = 				ETXTBSY,
> -#ifdef _GLIBCXX_HAVE_ETIMEDOUT
> +#ifdef ETIMEDOUT
>        timed_out = 				ETIMEDOUT,
>  #endif
>        too_many_files_open_in_system = 		ENFILE,
>        too_many_files_open = 			EMFILE,
>        too_many_links = 				EMLINK
>  //    too_many_symbolic_link_levels = 		ELOOP,
> -#ifdef _GLIBCXX_HAVE_EOVERFLOW
> +#ifdef EOVERFLOW
>  	,
>        value_too_large = 			EOVERFLOW
>  #endif


	Jakub


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2021-04-01 14:27         ` Jakub Jelinek
@ 2021-04-01 15:15           ` Jonathan Wakely
  2021-04-01 16:47             ` Eric Botcazou
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Wakely @ 2021-04-01 15:15 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: libstdc++, gcc-patches, Eric Botcazou

On 01/04/21 16:27 +0200, Jakub Jelinek via Libstdc++ wrote:
>On Thu, Apr 01, 2021 at 03:25:56PM +0100, Jonathan Wakely via Gcc-patches wrote:
>> On 01/04/21 16:04 +0200, Eric Botcazou wrote:
>> > > Oops, and I also forgot to update the other headers that were using
>> > > those autoconf-generated macros!
>> > >
>> > > Fixed by this patch. Tested on mingw-w64, pushed to trunk.
>> >
>> > The original patch was apparently backported onto the gcc-10 branch, but not
>> > this follow-up fix, so Windows builds are now broken on the branch.
>>
>> Sorry. I did try to test a mingw-w64 cross, but I think I probably
>> tested it against trunk not the branch. So didn't test it at all.
>>
>> It should be fixed by the attached patch for gcc-10. I'm testing it
>> now on linux and mingw.
>>
>> I'll wait for RM approval before pushing.
>
>Ok for 10.3, thanks.

Thanks, pushed.

I was unable to reproduce the problem on the gcc-10 branch or with the
gcc-10.3.0-RC-20210401.tar.xz release candidate. That's because I
didn't backport r11-6226-gf5feee6adc8350a292c235eb21e31a5082350d94
either. The follow-up fix referred to above was only needed because
r11-6226 regenerated libstdc++-v3/configure and libstdc++-v3/config.h.in. But because I didn't backport that (or the follow-up fix) to gcc-10, it still checks for the errno macros during configure, and so the HAVE_EXXX macros that the Windows headers need should be defined.

Eric, are you building the RC with --enable-maintainer-mode maybe? Or
regenerating the autoconf files yourself?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2021-04-01 15:15           ` Jonathan Wakely
@ 2021-04-01 16:47             ` Eric Botcazou
  2021-04-01 17:51               ` Jonathan Wakely
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Botcazou @ 2021-04-01 16:47 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Jakub Jelinek, libstdc++, gcc-patches

> Thanks, pushed.

I can confirm that the build failure we had is now gone, thanks!

> Eric, are you building the RC with --enable-maintainer-mode maybe? Or
> regenerating the autoconf files yourself?

The latter, we have local configure changes so we regenerate the script.

-- 
Eric Botcazou



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
  2021-04-01 16:47             ` Eric Botcazou
@ 2021-04-01 17:51               ` Jonathan Wakely
  0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Wakely @ 2021-04-01 17:51 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Jakub Jelinek, libstdc++, gcc-patches

On 01/04/21 18:47 +0200, Eric Botcazou wrote:
>> Thanks, pushed.
>
>I can confirm that the build failure we had is now gone, thanks!
>
>> Eric, are you building the RC with --enable-maintainer-mode maybe? Or
>> regenerating the autoconf files yourself?
>
>The latter, we have local configure changes so we regenerate the script.

Aha, that explains it then. And it's useful that you noticed this
before the final release!




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-01 17:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:38 [committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151] Jonathan Wakely
2020-12-17 14:05 ` Jonathan Wakely
2020-12-17 16:21   ` Jonathan Wakely
2021-04-01 14:04     ` Eric Botcazou
2021-04-01 14:25       ` Jonathan Wakely
2021-04-01 14:27         ` Jakub Jelinek
2021-04-01 15:15           ` Jonathan Wakely
2021-04-01 16:47             ` Eric Botcazou
2021-04-01 17:51               ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).