public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH glibc] Stop checking if MiG supports retcode.
@ 2023-05-10  5:20 Flavio Cruz
  2023-05-10  5:36 ` Sergey Bugaev
  2023-05-10 23:28 ` Samuel Thibault
  0 siblings, 2 replies; 4+ messages in thread
From: Flavio Cruz @ 2023-05-10  5:20 UTC (permalink / raw)
  To: bug-hurd, libc-alpha; +Cc: samuel.thibault

We already did the same change for Hurd
(https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=ef5924402864ef049f40a39e73967628583bc1a4)

Due to MiG requiring the subsystem to be defined early in order to know the
size of a port, this was causing a division by zero error during ./configure.
We could have just move subsystem to the top of the snippet, however it is
simpler to just remove the check given that we have no plans to use some other
MiG anyway.

HAVE_MIG_RETCODE is removed completely since this will be a no-op either
way (compiling against old Hurd headers will work the same, new Hurd
headers will result in the same stubs since retcode is a no-op).
---
 config.h.in               |  3 ---
 sysdeps/mach/configure    | 36 ------------------------------------
 sysdeps/mach/configure.ac | 26 --------------------------
 3 files changed, 65 deletions(-)

diff --git a/config.h.in b/config.h.in
index c87008b6a9..44a34072a4 100644
--- a/config.h.in
+++ b/config.h.in
@@ -150,9 +150,6 @@
 /* Override abi-tags ABI version if necessary.  */
 #undef  __ABI_TAG_VERSION
 
-/* Mach/Hurd specific: define if mig supports the `retcode' keyword.  */
-#undef	HAVE_MIG_RETCODE
-
 /* Mach specific: define if the `host_page_size' RPC is available.  */
 #undef	HAVE_HOST_PAGE_SIZE
 
diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index b08872b8bc..df20d8640f 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -485,40 +485,4 @@ if test $libc_cv_mach_i386_gdt = yes; then
 fi
 
 
-
-# See if mig groks `retcode'.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $MIG supports the retcode keyword" >&5
-$as_echo_n "checking whether $MIG supports the retcode keyword... " >&6; }
-if ${hurd_cv_mig_retcode+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.defs <<\EOF
-#include <mach/std_types.defs>
-#include <mach/mach_types.defs>
-subsystem foobar 1000;
-type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
-	ctype: mach_port_t;
-simpleroutine foobar_reply (
-	reply_port: reply_port_t;
-	err: kern_return_t, RetCode);
-EOF
-if { ac_try='CC="${CC}" ${MIG-false} -n conftest.defs 1>&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-  hurd_cv_mig_retcode=yes
-else
-  hurd_cv_mig_retcode=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_mig_retcode" >&5
-$as_echo "$hurd_cv_mig_retcode" >&6; }
-if test $hurd_cv_mig_retcode = yes; then
-  $as_echo "#define HAVE_MIG_RETCODE 1" >>confdefs.h
-
-fi
-
 CPPFLAGS=$OLD_CPPFLAGS
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index 537677c1d7..869cc9f820 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -104,30 +104,4 @@ if test $libc_cv_mach_i386_gdt = yes; then
   AC_DEFINE([HAVE_I386_SET_GDT])
 fi
 
-dnl Swiped from hurd/aclocal.m4
-AC_DEFUN([hurd_MIG_RETCODE], [dnl
-# See if mig groks `retcode'.
-AC_CACHE_CHECK(whether $MIG supports the retcode keyword, hurd_cv_mig_retcode,
-[cat > conftest.defs <<\EOF
-#include <mach/std_types.defs>
-#include <mach/mach_types.defs>
-subsystem foobar 1000;
-type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
-	ctype: mach_port_t;
-simpleroutine foobar_reply (
-	reply_port: reply_port_t;
-	err: kern_return_t, RetCode);
-EOF
-if AC_TRY_COMMAND([CC="${CC}" ${MIG-false} -n conftest.defs 1>&AS_MESSAGE_LOG_FD]); then
-  hurd_cv_mig_retcode=yes
-else
-  hurd_cv_mig_retcode=no
-fi
-rm -f conftest*])
-if test $hurd_cv_mig_retcode = yes; then
-  AC_DEFINE(HAVE_MIG_RETCODE)
-fi])
-
-hurd_MIG_RETCODE
-
 CPPFLAGS=$OLD_CPPFLAGS
-- 
2.39.2


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

* Re: [PATCH glibc] Stop checking if MiG supports retcode.
  2023-05-10  5:20 [PATCH glibc] Stop checking if MiG supports retcode Flavio Cruz
@ 2023-05-10  5:36 ` Sergey Bugaev
  2023-05-15  4:09   ` Flávio Cruz
  2023-05-10 23:28 ` Samuel Thibault
  1 sibling, 1 reply; 4+ messages in thread
From: Sergey Bugaev @ 2023-05-10  5:36 UTC (permalink / raw)
  To: Flavio Cruz; +Cc: bug-hurd, libc-alpha, Samuel Thibault

Hello,

On Wed, May 10, 2023, 08:21 Flavio Cruz <flaviocruz@gmail.com> wrote:
> HAVE_MIG_RETCODE is removed completely since this will be a no-op either
> way (compiling against old Hurd headers will work the same, new Hurd
> headers will result in the same stubs since retcode is a no-op).

It is a no-op currently, but please note that I was planning to make
it not a no-op some time (I wanted my epoll server to return error
replies properly). Will that cause any issues?

Sergey

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

* Re: [PATCH glibc] Stop checking if MiG supports retcode.
  2023-05-10  5:20 [PATCH glibc] Stop checking if MiG supports retcode Flavio Cruz
  2023-05-10  5:36 ` Sergey Bugaev
@ 2023-05-10 23:28 ` Samuel Thibault
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Thibault @ 2023-05-10 23:28 UTC (permalink / raw)
  To: Flavio Cruz; +Cc: bug-hurd, libc-alpha

Applied, thanks!

Flavio Cruz, le mer. 10 mai 2023 01:20:34 -0400, a ecrit:
> We already did the same change for Hurd
> (https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=ef5924402864ef049f40a39e73967628583bc1a4)
> 
> Due to MiG requiring the subsystem to be defined early in order to know the
> size of a port, this was causing a division by zero error during ./configure.
> We could have just move subsystem to the top of the snippet, however it is
> simpler to just remove the check given that we have no plans to use some other
> MiG anyway.
> 
> HAVE_MIG_RETCODE is removed completely since this will be a no-op either
> way (compiling against old Hurd headers will work the same, new Hurd
> headers will result in the same stubs since retcode is a no-op).
> ---
>  config.h.in               |  3 ---
>  sysdeps/mach/configure    | 36 ------------------------------------
>  sysdeps/mach/configure.ac | 26 --------------------------
>  3 files changed, 65 deletions(-)
> 
> diff --git a/config.h.in b/config.h.in
> index c87008b6a9..44a34072a4 100644
> --- a/config.h.in
> +++ b/config.h.in
> @@ -150,9 +150,6 @@
>  /* Override abi-tags ABI version if necessary.  */
>  #undef  __ABI_TAG_VERSION
>  
> -/* Mach/Hurd specific: define if mig supports the `retcode' keyword.  */
> -#undef	HAVE_MIG_RETCODE
> -
>  /* Mach specific: define if the `host_page_size' RPC is available.  */
>  #undef	HAVE_HOST_PAGE_SIZE
>  
> diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
> index b08872b8bc..df20d8640f 100644
> --- a/sysdeps/mach/configure
> +++ b/sysdeps/mach/configure
> @@ -485,40 +485,4 @@ if test $libc_cv_mach_i386_gdt = yes; then
>  fi
>  
>  
> -
> -# See if mig groks `retcode'.
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $MIG supports the retcode keyword" >&5
> -$as_echo_n "checking whether $MIG supports the retcode keyword... " >&6; }
> -if ${hurd_cv_mig_retcode+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  cat > conftest.defs <<\EOF
> -#include <mach/std_types.defs>
> -#include <mach/mach_types.defs>
> -subsystem foobar 1000;
> -type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
> -	ctype: mach_port_t;
> -simpleroutine foobar_reply (
> -	reply_port: reply_port_t;
> -	err: kern_return_t, RetCode);
> -EOF
> -if { ac_try='CC="${CC}" ${MIG-false} -n conftest.defs 1>&5'
> -  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> -  (eval $ac_try) 2>&5
> -  ac_status=$?
> -  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> -  test $ac_status = 0; }; }; then
> -  hurd_cv_mig_retcode=yes
> -else
> -  hurd_cv_mig_retcode=no
> -fi
> -rm -f conftest*
> -fi
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_mig_retcode" >&5
> -$as_echo "$hurd_cv_mig_retcode" >&6; }
> -if test $hurd_cv_mig_retcode = yes; then
> -  $as_echo "#define HAVE_MIG_RETCODE 1" >>confdefs.h
> -
> -fi
> -
>  CPPFLAGS=$OLD_CPPFLAGS
> diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
> index 537677c1d7..869cc9f820 100644
> --- a/sysdeps/mach/configure.ac
> +++ b/sysdeps/mach/configure.ac
> @@ -104,30 +104,4 @@ if test $libc_cv_mach_i386_gdt = yes; then
>    AC_DEFINE([HAVE_I386_SET_GDT])
>  fi
>  
> -dnl Swiped from hurd/aclocal.m4
> -AC_DEFUN([hurd_MIG_RETCODE], [dnl
> -# See if mig groks `retcode'.
> -AC_CACHE_CHECK(whether $MIG supports the retcode keyword, hurd_cv_mig_retcode,
> -[cat > conftest.defs <<\EOF
> -#include <mach/std_types.defs>
> -#include <mach/mach_types.defs>
> -subsystem foobar 1000;
> -type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
> -	ctype: mach_port_t;
> -simpleroutine foobar_reply (
> -	reply_port: reply_port_t;
> -	err: kern_return_t, RetCode);
> -EOF
> -if AC_TRY_COMMAND([CC="${CC}" ${MIG-false} -n conftest.defs 1>&AS_MESSAGE_LOG_FD]); then
> -  hurd_cv_mig_retcode=yes
> -else
> -  hurd_cv_mig_retcode=no
> -fi
> -rm -f conftest*])
> -if test $hurd_cv_mig_retcode = yes; then
> -  AC_DEFINE(HAVE_MIG_RETCODE)
> -fi])
> -
> -hurd_MIG_RETCODE
> -
>  CPPFLAGS=$OLD_CPPFLAGS
> -- 
> 2.39.2
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.

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

* Re: [PATCH glibc] Stop checking if MiG supports retcode.
  2023-05-10  5:36 ` Sergey Bugaev
@ 2023-05-15  4:09   ` Flávio Cruz
  0 siblings, 0 replies; 4+ messages in thread
From: Flávio Cruz @ 2023-05-15  4:09 UTC (permalink / raw)
  To: Sergey Bugaev; +Cc: bug-hurd, libc-alpha, Samuel Thibault

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

Hi Sergey

On Wed, May 10, 2023 at 1:36 AM Sergey Bugaev <bugaevc@gmail.com> wrote:

> Hello,
>
> On Wed, May 10, 2023, 08:21 Flavio Cruz <flaviocruz@gmail.com> wrote:
> > HAVE_MIG_RETCODE is removed completely since this will be a no-op either
> > way (compiling against old Hurd headers will work the same, new Hurd
> > headers will result in the same stubs since retcode is a no-op).
>
> It is a no-op currently, but please note that I was planning to make
> it not a no-op some time (I wanted my epoll server to return error
> replies properly). Will that cause any issues?
>

No, it should be fine. For that functionality, maybe we should enforce that
the return code
parameter is always the second parameter (after the reply port - which is
already the
case) by adding the appropriate checks in MiG when retcode is used. If we
want
./configure to check if MiG generates code to call the server reply routine
in case of errors (it doesn't :() then we will need to build a different
check.


> Sergey
>

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

end of thread, other threads:[~2023-05-15  4:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10  5:20 [PATCH glibc] Stop checking if MiG supports retcode Flavio Cruz
2023-05-10  5:36 ` Sergey Bugaev
2023-05-15  4:09   ` Flávio Cruz
2023-05-10 23:28 ` Samuel Thibault

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).