Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2001 10:45:42 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Peter Wemm <peter@wemm.org>, Warner Losh <imp@FreeBSD.org>
Cc:        Steve Kargl <sgk@troutmask.apl.washington.edu>, freebsd-current@FreeBSD.org
Subject:   Re: stdin/out/err changes kill world
Message-ID:  <20010921104542.I27714@sunbay.com>
In-Reply-To: <20010921102207.H27714@sunbay.com>; from ru@FreeBSD.org on Fri, Sep 21, 2001 at 10:22:07AM %2B0300
References:  <20010920123124.A6236@troutmask.apl.washington.edu> <20010921051423.3FB6438FF@overcee.netplex.com.au> <20010921102207.H27714@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Also, this error may only be caused if:

1.  The previous ``buildworld'' installed new headers in
    ${WORLDTMP}/usr/include.

2.  The next ``buildworld'' was run with -DNOCLEAN.
    (Only in this case ${WORLDTMP}/usr/include will be
    non-empty.)

On Fri, Sep 21, 2001 at 10:22:07AM +0300, Ruslan Ermilov wrote:
> This is because BMAKEENV has DESTDIR=${WORLDTMP}, and
> bsd.{prog,lib}.mk have the magic of adding the
> -I${DESTDIR}/usr/include to CFLAGS if DESTDIR is set.
> 
> I'm currently testing the following patch with the
> -CURRENT build on a -STABLE box.
> 
> Index: bsd.prog.mk
> ===================================================================
> RCS file: /home/ncvs/src/share/mk/bsd.prog.mk,v
> retrieving revision 1.100
> diff -u -r1.100 bsd.prog.mk
> --- bsd.prog.mk	2001/06/14 06:08:02	1.100
> +++ bsd.prog.mk	2001/09/21 07:23:14
> @@ -11,7 +11,7 @@
>  .SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .s .S
>  
>  CFLAGS+=${COPTS} ${DEBUG_FLAGS}
> -.if defined(DESTDIR)
> +.if defined(DESTDIR) && !defined(BOOTSTRAPPING)
>  CFLAGS+= -I${DESTDIR}/usr/include
>  CXXINCLUDES+= -I${DESTDIR}/usr/include/g++
>  .endif
> Index: bsd.lib.mk
> ===================================================================
> RCS file: /home/ncvs/src/share/mk/bsd.lib.mk,v
> retrieving revision 1.97
> diff -u -r1.97 bsd.lib.mk
> --- bsd.lib.mk	2001/05/19 23:24:17	1.97
> +++ bsd.lib.mk	2001/09/21 07:23:15
> @@ -37,7 +37,7 @@
>  .endif
>  .endif
>  
> -.if defined(DESTDIR)
> +.if defined(DESTDIR) && !defined(BOOTSTRAPPING)
>  CFLAGS+= -I${DESTDIR}/usr/include
>  CXXINCLUDES+= -I${DESTDIR}/usr/include/g++
>  .endif
> 
> On Thu, Sep 20, 2001 at 10:14:22PM -0700, Peter Wemm wrote:
> > Steve Kargl wrote:
> > > Note, I'm updating a 3 week old current to today's sources.
> > > I've fallen way behind in the mailing lists (due to living
> > > out of a suitcase for week longer then intended), so if
> > > this is a known problem please ignore.
> > > 
> > > 
> > > cc -O -pipe -march=k6 -D_GNU_SOURCE -I- -I. -I/usr/src/gnu/usr.bin/binutils/l
> >     d -I/usr/src/gnu/usr.bin/binutils/ld/../libbfd/i386 -I/usr/src/gnu/usr.bin/
> >     binutils/ld/../../../../contrib/binutils/include -DDEFAULT_EMULATION=\"elf_
> >     i386\" -DTARGET=\"i386-unknown-freebsd\" -DSCRIPTDIR=\"/usr/obj/usr/src/i38
> >     6/usr/libdata\" -I/usr/src/gnu/usr.bin/binutils/ld/../../../../contrib/binu
> >     tils/ld -I/usr/src/gnu/usr.bin/binutils/ld/../../../../contrib/binutils/bfd
> >      -I/usr/src/gnu/usr.bin/binutils/ld/../../../../include -DVERSION=\""2.11.2
> >      20010719 [FreeBSD]"\" -DBFD_VERSION=\""2.11.2 20010719 [FreeBSD]"\"   -I/u
> >     sr/obj/usr/src/i386/usr/include   -static -o ld eelf_i386.o ldcref.o ldctor
> >     .o ldemul.o ldexp.o ldfile.o ldgram.o ldlang.o ldlex.o ldmain.o ldmisc.o ld
> >     ver.o ldwrite.o lexsup.o mri.o  ../libbfd/libbfd.a ../libiberty/libiberty.a
> > > ldemul.o: In function `ldemul_choose_mode':
> > > ldemul.o(.text+0x318): undefined reference to `__stderrp'
> > > ldlang.o: In function `dprint_statement':
> > > ldlang.o(.text+0x26a6): undefined reference to `__stderrp'
> > > ldlex.o: In function `yylex':
> > > ldlex.o(.text+0xc0): undefined reference to `__stdinp'
> > > ldlex.o(.text+0xd3): undefined reference to `__stdoutp'
> > 
> > 
> > This is actually a bug in the buildworld process.  For some reason, it
> > is using a -current stdio.h with an old unknown libc.a.  It should be using
> > the host stdio.h with the host libc.a, not mixing them up.  If there is any
> > binary incompatability, then there will be breakage.
> > 
> > However, for now, you can get over the hurdle with this hack..
> > Simply add -D_OLD_STDIO to CFLAGS in /etc/make.conf, eg:
> > 
> > CFLAGS= -O -pipe -D_OLD_STDIO
> > 
> > Only do this for one buildworld.  After that, you wont need it again.
> > 
> > You should never have needed it at all though. :-(

-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

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




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