unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#36342: accept4 detection on illumos needs -lsocket -lnsl
@ 2019-06-23 12:18 Michal Nowak
  2019-06-28 22:35 ` Mark H Weaver
       [not found] ` <87sgrtfied.fsf@netris.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Nowak @ 2019-06-23 12:18 UTC (permalink / raw)
  To: 36342

Hello,

GNU Guile 2.2.5 build fails because accept4 detection on OpenIndiana 
2019.04 (illumos distribution) [1] fails due to "-lsocket -lnsl" not 
being part of the linking process and the build system then tries to 
build it's vendored accept4:

    CC       accept4.lo
In file included from /usr/include/sys/time.h:462:0,
                   from ./sys/time.h:39,
                   from /usr/include/sys/select.h:53,
                   from ./sys/select.h:36,
                   from /usr/include/sys/types.h:640,
                   from ./sys/types.h:28,
                   from ./sys/socket.h:51,
                   from accept4.c:20:
./sys/socket.h:1034:1: error: conflicting types for 'accept4'
   _GL_FUNCDECL_SYS (accept4, int,
   ^
In file included from ./sys/socket.h:58:0,
                   from accept4.c:20:
/usr/include/sys/socket.h:540:12: note: previous declaration of
'accept4' was here
   extern int accept4(int, struct sockaddr *_RESTRICT_KYWD, Psocklen_t, 
int);
              ^~~~~~~
accept4.c:32:1: error: conflicting types for 'accept4'
   accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int 
flags)
   ^~~~~~~
In file included from ./sys/socket.h:58:0,
                   from accept4.c:20:
/usr/include/sys/socket.h:540:12: note: previous declaration of
'accept4' was here
   extern int accept4(int, struct sockaddr *_RESTRICT_KYWD, Psocklen_t, 
int);
              ^~~~~~~

This is fixed by LIBS="-lsocket -lnsl" in the build environment.

This was in the past reported both on the guile-user [2] and 
openindiana-discuss [3] mailing lists, where you also can see the build 
error in full.

Thanks,
Michal

[1] https://illumos.org/man/3socket/accept4
[2] https://lists.gnu.org/archive/html/guile-user/2018-03/msg00006.html
[3] 
https://openindiana.org/pipermail/openindiana-discuss/2018-March/021931.html





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

* bug#36342: accept4 detection on illumos needs -lsocket -lnsl
  2019-06-23 12:18 bug#36342: accept4 detection on illumos needs -lsocket -lnsl Michal Nowak
@ 2019-06-28 22:35 ` Mark H Weaver
       [not found] ` <87sgrtfied.fsf@netris.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2019-06-28 22:35 UTC (permalink / raw)
  To: Michal Nowak; +Cc: bug-gnulib, 36342

Hi Michal,

Michal Nowak <mnowak@startmail.com> writes:

> GNU Guile 2.2.5 build fails because accept4 detection on OpenIndiana
> 2019.04 (illumos distribution) [1] fails due to "-lsocket -lnsl" not
> being part of the linking process and the build system then tries to
> build it's vendored accept4:

I believe this is an issue in gnulib, because the relevant autoconf
detection code, as well as the replacement implementation that fails to
compile on OpenIndiana, are imported from gnulib.

I've CC'd the bug-gnulib@gnu.org mailing list, for input from the gnulib
developers.

Thanks for this report,

      Mark


>    CC       accept4.lo
> In file included from /usr/include/sys/time.h:462:0,
>                   from ./sys/time.h:39,
>                   from /usr/include/sys/select.h:53,
>                   from ./sys/select.h:36,
>                   from /usr/include/sys/types.h:640,
>                   from ./sys/types.h:28,
>                   from ./sys/socket.h:51,
>                   from accept4.c:20:
> ./sys/socket.h:1034:1: error: conflicting types for 'accept4'
>   _GL_FUNCDECL_SYS (accept4, int,
>   ^
> In file included from ./sys/socket.h:58:0,
>                   from accept4.c:20:
> /usr/include/sys/socket.h:540:12: note: previous declaration of
> 'accept4' was here
>   extern int accept4(int, struct sockaddr *_RESTRICT_KYWD, Psocklen_t,
> int);
>              ^~~~~~~
> accept4.c:32:1: error: conflicting types for 'accept4'
>   accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int
> flags)
>   ^~~~~~~
> In file included from ./sys/socket.h:58:0,
>                   from accept4.c:20:
> /usr/include/sys/socket.h:540:12: note: previous declaration of
> 'accept4' was here
>   extern int accept4(int, struct sockaddr *_RESTRICT_KYWD, Psocklen_t,
> int);
>              ^~~~~~~
>
> This is fixed by LIBS="-lsocket -lnsl" in the build environment.
>
> This was in the past reported both on the guile-user [2] and
> openindiana-discuss [3] mailing lists, where you also can see the
> build error in full.
>
> Thanks,
> Michal
>
> [1] https://illumos.org/man/3socket/accept4
> [2] https://lists.gnu.org/archive/html/guile-user/2018-03/msg00006.html
> [3]
> https://openindiana.org/pipermail/openindiana-discuss/2018-March/021931.html





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

* bug#36342: accept4 detection on illumos needs -lsocket -lnsl
       [not found] ` <87sgrtfied.fsf@netris.org>
@ 2019-06-29  0:06   ` Bruno Haible
  0 siblings, 0 replies; 3+ messages in thread
From: Bruno Haible @ 2019-06-29  0:06 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Michal Nowak, 36342

Hi Michal and Mark,

> > GNU Guile 2.2.5 build fails because accept4 detection on OpenIndiana
> > 2019.04 (illumos distribution) [1] fails due to "-lsocket -lnsl" not
> > being part of the linking process and the build system then tries to
> > build it's vendored accept4:
> 
> I believe this is an issue in gnulib, because the relevant autoconf
> detection code, as well as the replacement implementation that fails to
> compile on OpenIndiana, are imported from gnulib.
> 
> I've CC'd the bug-gnulib@gnu.org mailing list, for input from the gnulib
> developers.
> 
> Thanks for this report,
> 
>       Mark
> 
> 
> >    CC       accept4.lo
> > In file included from /usr/include/sys/time.h:462:0,
> >                   from ./sys/time.h:39,
> >                   from /usr/include/sys/select.h:53,
> >                   from ./sys/select.h:36,
> >                   from /usr/include/sys/types.h:640,
> >                   from ./sys/types.h:28,
> >                   from ./sys/socket.h:51,
> >                   from accept4.c:20:
> > ./sys/socket.h:1034:1: error: conflicting types for 'accept4'
> >   _GL_FUNCDECL_SYS (accept4, int,
> >   ^
> > In file included from ./sys/socket.h:58:0,
> >                   from accept4.c:20:
> > /usr/include/sys/socket.h:540:12: note: previous declaration of
> > 'accept4' was here
> >   extern int accept4(int, struct sockaddr *_RESTRICT_KYWD, Psocklen_t,
> > int);
> >              ^~~~~~~
> > accept4.c:32:1: error: conflicting types for 'accept4'
> >   accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int
> > flags)
> >   ^~~~~~~
> > In file included from ./sys/socket.h:58:0,
> >                   from accept4.c:20:
> > /usr/include/sys/socket.h:540:12: note: previous declaration of
> > 'accept4' was here
> >   extern int accept4(int, struct sockaddr *_RESTRICT_KYWD, Psocklen_t,
> > int);
> >              ^~~~~~~
> >
> > This is fixed by LIBS="-lsocket -lnsl" in the build environment.
> >
> > This was in the past reported both on the guile-user [2] and
> > openindiana-discuss [3] mailing lists, where you also can see the
> > build error in full.
> >
> > Thanks,
> > Michal
> >
> > [1] https://illumos.org/man/3socket/accept4
> > [2] https://lists.gnu.org/archive/html/guile-user/2018-03/msg00006.html
> > [3]
> > https://openindiana.org/pipermail/openindiana-discuss/2018-March/021931.html

Thanks for the report. This patch fixes it. Pushed. Now, guile needs to pick it
up.


2019-06-28  Bruno Haible  <bruno@clisp.org>

	accept4: Fix compilation error on OpenIndiana.
	Reported by Michal Nowak <mnowak@startmail.com>
	via Mark H Weaver <mhw@netris.org>.
	* m4/accept.m4 (gl_FUNC_ACCEPT4): Test whether accept4 is declared, not
	whether it exists as a function.

diff --git a/m4/accept4.m4 b/m4/accept4.m4
index b38ce30..9b976fb 100644
--- a/m4/accept4.m4
+++ b/m4/accept4.m4
@@ -1,4 +1,4 @@
-# accept4.m4 serial 2
+# accept4.m4 serial 3
 dnl Copyright (C) 2009-2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,8 +11,11 @@ AC_DEFUN([gl_FUNC_ACCEPT4],
   dnl Persuade glibc <sys/socket.h> to declare accept4().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([accept4])
-  if test $ac_cv_func_accept4 != yes; then
+  AC_CHECK_DECLS([accept4], , , [[
+#include <sys/types.h>
+#include <sys/socket.h>
+]])
+  if test $ac_cv_have_decl_accept4 != yes; then
     HAVE_ACCEPT4=0
   fi
 ])






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

end of thread, other threads:[~2019-06-29  0:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 12:18 bug#36342: accept4 detection on illumos needs -lsocket -lnsl Michal Nowak
2019-06-28 22:35 ` Mark H Weaver
     [not found] ` <87sgrtfied.fsf@netris.org>
2019-06-29  0:06   ` Bruno Haible

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