NetBSD Problem Report #51494

From www@NetBSD.org  Wed Sep 21 16:53:52 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 04B757A1B1
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 21 Sep 2016 16:53:52 +0000 (UTC)
Message-Id: <20160921165350.D6E227A2B6@mollari.NetBSD.org>
Date: Wed, 21 Sep 2016 16:53:50 +0000 (UTC)
From: scole_mail@gmx.com
Reply-To: scole_mail@gmx.com
To: gnats-bugs@NetBSD.org
Subject: X fails to build with MKINET6=no
X-Send-Pr-Version: www-1.0

>Number:         51494
>Category:       xsrc
>Synopsis:       X fails to build with MKINET6=no
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    xsrc-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 21 16:55:00 +0000 2016
>Closed-Date:    Tue Jun 19 23:47:24 +0000 2018
>Last-Modified:  Tue Jun 19 23:47:24 +0000 2018
>Originator:     scole_mail
>Release:        7.0.1
>Organization:
none
>Environment:
NetBSD dstar 7.0.1_PATCH NetBSD 7.0.1_PATCH (GENERIC) #0: Mon Sep  5 13:24:11 PDT 2016  scole@dstar:/home/scole/nbsd/cvs/7_0/obj/sys/arch/i386/compile/GENERIC i386
>Description:
I was trying to build a distribution with x11 and MKINET6=no for stable 7.0.1

dependall ===> external/mit/xorg/bin/xfontsel
dependall ===> external/mit/xorg/bin/xfs
#    create  xfs/fsconfig
rm -f fsconfig
/home/scole/nbsd/cvs/7_0/src/../tools/bin/i486--netbsdelf-gcc -E -undef -traditional -  -DDEFAULTFONTPATH=/usr/X11R7/lib/X11/fonts/misc/,/usr/X11R7/lib/X11/fonts/Type1/,/usr/X11R7/lib/X11/fonts/75dpi/,/usr/X11R7/lib/X11/fonts/100dpi/  -DFSERRORS=/var/log/xfs.log -D__appmansuffix__=1  < fsconfig.cpp | /home/scole/nbsd/cvs/7_0/src/../tools/bin/nbsed   -e '/^#  *[0-9][0-9]*  *.*$/d'  -e '/^#line  *[0-9][0-9]*  *.*$/d'  -e '/^[     ]*XCOMM$/s/XCOMM/#/'  -e '/^[   ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/#/'  -e '/^[       ]*XHASH/s/XHASH/#/'  -e '/\@\@$/s/\@\@$/\\/' > fsconfig
<stdin>:1:0: error: invalid preprocessing directive #X
<stdin>:2:0: error: invalid preprocessing directive #See
<stdin>:8:0: error: invalid preprocessing directive #in
#      link  xfs/xfs
/home/scole/nbsd/cvs/7_0/src/../tools/bin/i486--netbsdelf-gcc    --sysroot=/home/scole/nbsd/cvs/7_0/src/../obj/destdir.i386 -Wl,-rpath,/usr/X11R7/lib -L=/usr/X11R7/lib     -o xfs  atom.o charinfo.o difsutils.o dispatch.o events.o extensions.o fontinfo.o fonts.o globals.o initfonts.o main.o resource.o swaprep.o swapreq.o tables.o access.o config.o connection.o daemon.o error.o io.o osglue.o osinit.o utils.o waitfor.o xfstrans.o  -Wl,-rpath-link,/home/scole/nbsd/cvs/7_0/src/../obj/destdir.i386/lib  -L=/lib -lXfont -lfontenc -lXfontcache -lXext -lX11 -lfreetype -lm -lz    
xfstrans.o: In function `_FontTransSocketINETCreateListener':
xfstrans.c:(.text+0xa34): undefined reference to `in6addr_any'
xfstrans.c:(.text+0xa3d): undefined reference to `in6addr_any'
xfstrans.c:(.text+0xa46): undefined reference to `in6addr_any'
xfstrans.c:(.text+0xa4f): undefined reference to `in6addr_any'
collect2: error: ld returned 1 exit status

*** Failed target:  xfs
*** Failed command: /home/scole/nbsd/cvs/7_0/src/../tools/bin/i486--netbsdelf-gcc --sysroot=/home/scole/nbsd/cvs/7_0/src/../obj/destdir.i386 -Wl,-rpath,/usr/X11R7/lib -L=/usr/X11R7/lib -o xfs atom.o charinfo.o difsutils.o dispatch.o events.o extensions.o fontinfo.o fonts.o globals.o initfonts.o main.o resource.o swaprep.o swapreq.o tables.o access.o config.o connection.o daemon.o error.o io.o osglue.o osinit.o utils.o waitfor.o xfstrans.o -Wl,-rpath-link,/home/scole/nbsd/cvs/7_0/src/../obj/destdir.i386/lib -L=/lib -lXfont -lfontenc -lXfontcache -lXext -lX11 -lfreetype -lm -lz 
*** Error code 1

Stop.
nbmake[9]: stopped in /home/scole/nbsd/cvs/7_0/src/external/mit/xorg/bin/xfs



Seems to be caused by xsrc/external/mit/xtrans/dist/Xtranssock.c around line 1044

	((struct sockaddr_in6 *)&sockname)->sin6_addr = in6addr_any;

with IPv6 or AF_INET6 not getting #undefine'd correctly.
>How-To-Repeat:
./build.sh -x 
 with mk.conf having 
MKINET6=no
>Fix:

>Release-Note:

>Audit-Trail:
From: Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>
To: gnats-bugs@NetBSD.org, xsrc-manager@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/51494: X fails to build with MKINET6=no
Date: Thu, 22 Sep 2016 04:41:17 +0900

 The attached patch is for -current, but may also be applicable to 7.x
 (except last 3 files for xorg-server.old). With this patch, I'm using
 X without IPv6 support more than one year without any troubles.

 Note that build with MKINET6=no fails also due to some 3rd party
 software. Please refer to bin/49991. The patch for dhcpcd, attached
 to that PR, is outdated. It builds and works without patch, at least
 for -current. I will update that PR if you would like.

 --- src/external/mit/xorg/bin/xfs/Makefile.orig	2015-07-19 01:13:54.000000000 +0900
 +++ src/external/mit/xorg/bin/xfs/Makefile	2015-07-19 01:14:43.000000000 +0900
 @@ -24,6 +24,10 @@
   			-I${XFSDIR}/../include \
   			-DHAVE_DAEMON

 +.if ${USE_INET6} != "no"
 +CPPFLAGS+=		-DIPv6=1
 +.endif
 +
   CONN_DEFINES=		${X11FLAGS.CONNECTION} -DFONT_t -DTRANS_SERVER \
   			-DTRANS_REOPEN -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT

 --- src/external/mit/xorg/server/xorg-server/os/Makefile.orig	2015-07-19 01:15:07.000000000 +0900
 +++ src/external/mit/xorg/server/xorg-server/os/Makefile	2015-07-19 01:16:37.000000000 +0900
 @@ -30,6 +30,10 @@
   		-DHAVE_SHA1_IN_LIBC \
   		-DMONOTONIC_CLOCK

 +.if ${USE_INET6} != "no"
 +CPPFLAGS+=	-DIPv6=1
 +.endif
 +
   .include "../Makefile.common"

   .if 0
 --- xsrc/external/mit/xfs/dist/os/xfstrans.c.orig	2015-07-19 01:17:45.000000000 +0900
 +++ xsrc/external/mit/xfs/dist/os/xfstrans.c	2015-07-19 01:18:29.000000000 +0900
 @@ -45,7 +45,7 @@

       /* Fill in correct address/portnum */
       TRANS(SocketINETGetAddr)(inetdCI);
 -#ifdef AF_INET6
 +#if defined(IPv6) && defined(AF_INET6)
       if ( ((struct sockaddr *)(inetdCI->addr))->sa_family == AF_INET6 )
   	portnum = ntohs(((struct sockaddr_in6 *)(inetdCI->addr))->sin6_port);
       else
 --- xsrc/external/mit/xfs/include/config.h.orig	2015-07-19 01:19:10.000000000 +0900
 +++ xsrc/external/mit/xfs/include/config.h	2015-07-19 01:19:32.000000000 +0900
 @@ -44,7 +44,7 @@
   #define HAVE_UNISTD_H 1

   /* Support IPv6 for TCP connections */
 -#define IPv6 1
 +/* #define IPv6 1 */

   /* Support os-specific local connections */
   /* #undef LOCALCONN */
 --- xsrc/external/mit/xorg-server/include/dix-config.h.orig	2015-07-19 01:19:57.000000000 +0900
 +++ xsrc/external/mit/xorg-server/include/dix-config.h	2015-07-19 01:20:38.000000000 +0900
 @@ -248,7 +248,7 @@
   #define HAVE_VASPRINTF 1

   /* Support IPv6 for TCP connections */
 -#define IPv6 1
 +/* #define IPv6 1 */

   /* Support os-specific local connections */
   /* #undef LOCALCONN */
 --- xsrc/external/mit/xorg-server/include/xorg-server.h.orig	2015-07-19 01:20:12.000000000 +0900
 +++ xsrc/external/mit/xorg-server/include/xorg-server.h	2015-07-19 01:20:48.000000000 +0900
 @@ -39,7 +39,7 @@
   #define HAS_SHM 1

   /* Support IPv6 for TCP connections */
 -#define IPv6 1
 +/* #define IPv6 1 */

   /* Support MIT-SHM Extension */
   #define MITSHM 1
 --- src/external/mit/xorg/server/xorg-server.old/os/Makefile.orig	2016-06-28 00:38:59.098033398 +0900
 +++ src/external/mit/xorg/server/xorg-server.old/os/Makefile	2016-06-28 00:39:56.670450701 +0900
 @@ -30,6 +30,10 @@
   		-DHAVE_SHA1_IN_LIBC \
   		-DMONOTONIC_CLOCK

 +.if ${USE_INET6} != "no"
 +CPPFLAGS+=	-DIPv6=1
 +.endif
 +
   .include "../Makefile.common"

   .if 0
 --- ./xsrc/external/mit/xorg-server.old/include/dix-config.h.orig	2016-06-28 00:35:44.889054402 +0900
 +++ ./xsrc/external/mit/xorg-server.old/include/dix-config.h	2016-06-28 00:36:14.271689332 +0900
 @@ -248,7 +248,7 @@
   #define HAVE_VASPRINTF 1

   /* Support IPv6 for TCP connections */
 -#define IPv6 1
 +/* #define IPv6 1 */

   /* Support os-specific local connections */
   /* #undef LOCALCONN */
 --- ./xsrc/external/mit/xorg-server.old/include/xorg-server.h.orig	2016-06-28 00:35:37.037473298 +0900
 +++ ./xsrc/external/mit/xorg-server.old/include/xorg-server.h	2016-06-28 00:35:54.468732213 +0900
 @@ -39,7 +39,7 @@
   #define HAS_SHM 1

   /* Support IPv6 for TCP connections */
 -#define IPv6 1
 +/* #define IPv6 1 */

   /* Support MIT-SHM Extension */
   #define MITSHM 1

From: scole_mail <scole_mail@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: xsrc/51494: X fails to build with MKINET6=no
Date: Wed, 21 Sep 2016 13:37:07 -0700

 Rin Okuyama <rokuyama@rk.phys.keio.ac.jp> writes:
 >
 >  The attached patch is for -current, but may also be applicable to 7.x
 >  (except last 3 files for xorg-server.old). With this patch, I'm using
 >  X without IPv6 support more than one year without any troubles.

 The patches didn't work for me with 7.0.1, but I can probably manually
 wrestle them in

 >  
 >  Note that build with MKINET6=no fails also due to some 3rd party
 >  software. Please refer to bin/49991. The patch for dhcpcd, attached
 >  to that PR, is outdated. It builds and works without patch, at least
 >  for -current. I will update that PR if you would like.
 >  

 Might as well update the PR to reflect reality if you have time.  I
 think my build got past the dhcpcd stuff.

 Thanks

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51494 CVS commit: xsrc/external/mit
Date: Wed, 21 Sep 2016 18:11:16 -0400

 Module Name:	xsrc
 Committed By:	christos
 Date:		Wed Sep 21 22:11:16 UTC 2016

 Modified Files:
 	xsrc/external/mit/xfs/dist/os: xfstrans.c
 	xsrc/external/mit/xorg-server.old/include: dix-config.h xorg-server.h
 	xsrc/external/mit/xorg-server/include: dix-config.h xorg-server.h

 Log Message:
 PR/51494: Rin Okuyama: Fix MKINET6=no build.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.4 -r1.2 xsrc/external/mit/xfs/dist/os/xfstrans.c
 cvs rdiff -u -r1.1.1.1 -r1.2 \
     xsrc/external/mit/xorg-server.old/include/dix-config.h \
     xsrc/external/mit/xorg-server.old/include/xorg-server.h
 cvs rdiff -u -r1.23 -r1.24 xsrc/external/mit/xorg-server/include/dix-config.h
 cvs rdiff -u -r1.13 -r1.14 \
     xsrc/external/mit/xorg-server/include/xorg-server.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: christos@zoulas.com (Christos Zoulas)
To: Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>, gnats-bugs@NetBSD.org, 
	xsrc-manager@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: xsrc/51494: X fails to build with MKINET6=no
Date: Wed, 21 Sep 2016 18:11:58 -0400

 On Sep 22,  4:41am, rokuyama@rk.phys.keio.ac.jp (Rin Okuyama) wrote:
 -- Subject: Re: xsrc/51494: X fails to build with MKINET6=no

 | The attached patch is for -current, but may also be applicable to 7.x
 | (except last 3 files for xorg-server.old). With this patch, I'm using
 | X without IPv6 support more than one year without any troubles.
 | 
 | Note that build with MKINET6=no fails also due to some 3rd party
 | software. Please refer to bin/49991. The patch for dhcpcd, attached
 | to that PR, is outdated. It builds and works without patch, at least
 | for -current. I will update that PR if you would like.

 The Makefile flags are not needed, the X11FLAGS.CONNECTION variable
 handles it.

 christos

From: Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>
To: Christos Zoulas <christos@zoulas.com>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: xsrc/51494: X fails to build with MKINET6=no
Date: Fri, 23 Sep 2016 00:31:19 +0900

 config.h for xfs is missing in your commit. Please add this one:

 --- xsrc/external/mit/xfs/include/config.h.orig	2016-09-22 23:28:26.976901446 +0900
 +++ xsrc/external/mit/xfs/include/config.h	2016-09-22 23:30:09.964697947 +0900
 @@ -44,7 +44,9 @@
   #define HAVE_UNISTD_H 1

   /* Support IPv6 for TCP connections */
 -#define IPv6 1
 +#ifndef __NetBSD__	/* Defined by the build */
 +# define IPv6 1
 +#endif

   /* Support os-specific local connections */
   /* #undef LOCALCONN */

From: christos@zoulas.com (Christos Zoulas)
To: Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: xsrc/51494: X fails to build with MKINET6=no
Date: Thu, 22 Sep 2016 11:50:26 -0400

 On Sep 23, 12:31am, rokuyama@rk.phys.keio.ac.jp (Rin Okuyama) wrote:
 -- Subject: Re: xsrc/51494: X fails to build with MKINET6=no

 Got it,

 christos

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 23:47:24 +0000
State-Changed-Why:
patches applied, thanks rin. a pullup is complicated (there's another pr for completing a full build, still open) and so just closing.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.