Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2006 22:48:43 +0300
From:      "Alexander I. Mogilny" <amogilny@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   Re: buildworld failure on i386
Message-ID:  <20061019194843.GA72274@sg.intra>
In-Reply-To: <20061018104103.GA34707@sg.intra>
References:  <20061018104103.GA34707@sg.intra>

next in thread | previous in thread | raw e-mail | index | archive | help

--VS++wcV0S1rZb1Fb
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline

Alexander I. Mogilny wrote me on Wed, Oct 18, 2006 at 01:41:03PM +0300

>
> Here is the error I get.
> Sources updated today (half an hour ago from cvsup5.freebsd.org)
> 
> In file included from
> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/eh_unex_handler.cc:30:
> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/unwind-cxx.h:41:20: unwind.h: No such file or directory
> In file included from
> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/pure.cc:31:
> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/unwind-cxx.h:41:20: unwind.h: No such file or directory
> In file included from
> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/vec.cc:37:
> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/unwind-cxx.h:41:20: unwind.h: No such file or directory
> mkdep: compile failed
> *** Error code 1
> 
> Stop in /usr/src/gnu/lib/libstdc++.
> *** Error code 1
> 

Hi all, sorry for foolish error report. I have deeply explored into the
problem and found the root of issue.

While build of libstdc++ library depend target is executed first. This
target is executed in two stages due to list of sources contains .c
files and .cc files:

According to bsd.dep.mk:

1. first stage:
	${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \
		${MKDEP_CFLAGS} ${.ALLSRC:M*.[cS]}
2. second stage:
    ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \
        ${MKDEP_CXXFLAGS} \
        ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx}

I would like to pay attention to MKDEP_CXXFLAGS and MKDEP_CFLAGS
variables. Here is the way they are initialized:

MKDEP_CFLAGS=   ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*}
MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*}

According to Makefiles in gnu/lib/libstdc++ and gnu/lib/libsupc++ we
have that only CFLAGS variable contains include directories. As a result
MKDEP_CXXFLAGS variable is empty and mkdep utility fails with error
desribed above.

The most proper solution here is to define variable containing include
directories and add it to CFLAGS and CXXFLAGS (I chosed this solution
because when simply define MKDEP options as a list of include
directories I also had an error on libstdc++ build stage as CXXFLAGS did not
contain inlude directories). It is very stange why nobody had this error
occured while buildworld procedure. Here are patches which fix the issue.
Please correct me if anything is wrong.

--- libstdc++/Makefile.orig	Thu Oct 19 21:41:44 2006
+++ libstdc++/Makefile	Thu Oct 19 22:25:12 2006
@@ -15,8 +15,10 @@
 .if ${MACHINE_ARCH} == "arm"
 CFLAGS+=	-D_GLIBCXX_SJLJ_EXCEPTIONS=1
 .endif
-CFLAGS+=	-I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
+INCDIRS=	-I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
+CFLAGS+=	${INCDIRS}
 CFLAGS+=	-frandom-seed=RepeatabilityConsideredGood
+CXXFLAGS+=	${INCDIRS}
 CXXFLAGS+=	-fno-implicit-templates -ffunction-sections -fdata-sections \
 		-Wno-deprecated
 
--- libsupc++//Makefile.orig	Thu Oct 19 22:04:18 2006
+++ libsupc++//Makefile	Thu Oct 19 22:34:52 2006
@@ -17,9 +17,11 @@
 # from libiberty:
 SRCS+=	cp-demangle.c
 
+INCDIRS=	-I${SRCDIR} -I${GCCDIR} -I${.CURDIR}/../libstdc++
 CFLAGS+=	-DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
-CFLAGS+=	-I${SRCDIR} -I${GCCDIR} -I${.CURDIR}/../libstdc++
+CFLAGS+=	${INCDIRS}
 CFLAGS+=	-frandom-seed=RepeatabilityConsideredGood
+CXXFLAGS+=	${INCDIRS}
 CXXFLAGS+=	-fno-implicit-templates -ffunction-sections -fdata-sections
 
 HDRS=	exception new typeinfo cxxabi.h exception_defines.h

-- 
AIM-UANIC             +-----[ FreeBSD ]-----+
Alexander Mogilny     | The Power to Serve! |
<> amogilny@gmail.com +---------------------+

--VS++wcV0S1rZb1Fb
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="Makefile.patch.bz2"
Content-Transfer-Encoding: base64

QlpoOTFBWSZTWS06CjgAAF1fgAAwXA//8n/338S/797qQAInAAAlRJkxDTQ0ANGQAADI0BkA
OaYmTJowmCYmmATAIYIwIwHNMTJk0YTBMTTAJgEMEYEYAqppATJhJiZE1P0U9J5T1NqBtQbK
aPE1B+qKVRAokISAUNkcELtNLbX4GrloWaZErRJiyLjgUUqvPtlxsQOAueQeYeGQXqPMIR6B
MyRx2Ou+lMntWwawdZOaVh1IYJkyl8pJUpd33RGkoVIRoIShBH950FBN6ZIxe53u9xOy7d7T
odDZK2ImtdHA7uB2U/gp0boiekt99nPSKqpec64X9lqiukoXxEHGm62alPSlwiISjGMO93E3
S8vIl7fj2vI+aXyeaEPbNpe5Dxqv8p8CxWp5lq5J6IWkMqZ3YdMUMUEIdhUyJauVR887F6Ut
j+ta8yt9YJOeywluelvaZyl6oxjI+ij6c2BtiosZQdSEpYktHPLm3ZmMKTDwMFpZjvz5yqSL
6GzDVlXh8fycYdZxeHr9b4vHi/X94hCXwreKFmCpi6OsmqN8eKD1azzdPBe0S1MUSybf4LtK
hQ4llcVtfvUcqHGppbdmTMykhVCnWqU6X3lzkkamFXI0Fa98FGGQzXuY1s3+w5LkFKhY34wv
lSmQ3qLlFsT44rEo2ym0a1g7XW2scWLw6icsGqbBnTRlKERypTbkrzJYbyK0LqkQclbZ7G9g
uYdUNHOcZSO86UnhB/4u5IpwoSBadBRw

--VS++wcV0S1rZb1Fb--



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