Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 2002 19:27:14 -0400
From:      Mike Barcroft <mike@freebsd.org>
To:        "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
Cc:        Oliver Braun <obraun@informatik.unibw-muenchen.de>, current@freebsd.org, ports@freebsd.org
Subject:   Re: machine/endian.h revision 1.33 breaks port x11-fm/gentoo
Message-ID:  <20020526192714.H26122@espresso.q9media.com>
In-Reply-To: <20020526233449.E6884@bank-pedersen.dk>; from ncbp@bank-pedersen.dk on Sun, May 26, 2002 at 11:34:49PM %2B0200
References:  <20020518223207.GA74796@nemesis.informatik.unibw-muenchen.de> <20020526233449.E6884@bank-pedersen.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
[Sorry I missed the beginning of this thread.]

Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk> writes:
> On Sun, May 19, 2002 at 12:32:07AM +0200, Oliver Braun wrote:
> > Hi,
> > 
> > I am the ports maintainer of x11-fm/gentoo. Building gentoo dies since
> > revision 1.33 of machine/endian.h with the following error:
> > 
> > In file included from cmdseq.c:18:
> > /usr/include/sys/wait.h:114: duplicate member `w_Filler'
> > /usr/include/sys/wait.h:115: duplicate member `w_Retcode'
> > /usr/include/sys/wait.h:116: duplicate member `w_Coredump'
> > /usr/include/sys/wait.h:117: duplicate member `w_Termsig'
> > /usr/include/sys/wait.h:132: duplicate member `w_Filler'
> > /usr/include/sys/wait.h:133: duplicate member `w_Stopsig'
> > /usr/include/sys/wait.h:134: duplicate member `w_Stopval'
> > *** Error code 1
> > 
> > With machine/endian.h revision 1.32 it works.
> > 
> > A workaround for x11-fm/gentoo is to declare the functions needed
> > explicit and avoid including whole sys/wait.h.

This is good.  I was hoping fixing the namespace pollution in endian.h
would expose more bugs.  The bug in this case is that wait.h is
depending on the old pollution of endian.h in the !__BSD_VISIBLE
case.  The solution is to use the underscored variants in wait.h.
I'll commit the fix soon.

I ran into another build problem later on.  This time the bug was in
the port itself.  It was missing a <string.h> include, for the
strdup() prototype.  I think the previous GCC didn't complain about
missing prototypes for built-ins, which is probably why this wasn't
exposed earlier.

Adding the include doesn't fix the problem because the program, via
gentoo.h, specifies that it wants a POSIX environment
(`#define _POSIX_C_SOURCE 3').  I think the value 3 is wrong here.
The correct format is YYYYMM, which specifies the ratified date of the
Standard.  Nevertheless, our headers try and accomodate and provide
a 1988 environment.  strdup() wasn't added to POSIX until 2001.

The solution would be to specify a Standard that provides the
interface the application needs, or to not specify a Standard at all.
The software does the latter in the NetBSD, et al cases.  This patch
below and the upcoming commit to <sys/wait.h> should fix this port.

%%%
--- gentoo.h.orig	Sun May 26 19:20:42 2002
+++ gentoo.h	Sun May 26 19:13:52 2002
@@ -13,7 +13,7 @@
 
 #include "config.h"
 
-#if !(defined __osf__ && defined __alpha__) && !defined __NetBSD__
+#if !(defined __osf__ && defined __alpha__) && !defined __NetBSD__ && !defined __FreeBSD__
 #define __EXTENSIONS__
 #define _POSIX_C_SOURCE	3     /* This is for Solaris. */
 #define	POSIX_C_SOURCE        3
%%%

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020526192714.H26122>