From owner-freebsd-stable@FreeBSD.ORG Fri Sep 5 13:12:17 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F7461065670 for ; Fri, 5 Sep 2008 13:12:17 +0000 (UTC) (envelope-from admin@kkip.pl) Received: from mainframe.kkip.pl (kkip.pl [87.105.164.78]) by mx1.freebsd.org (Postfix) with ESMTP id C39A48FC2B for ; Fri, 5 Sep 2008 13:12:16 +0000 (UTC) (envelope-from admin@kkip.pl) Received: from [192.168.0.10] by mainframe.kkip.pl with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Kbb6h-0000XS-GE for freebsd-stable@freebsd.org; Fri, 05 Sep 2008 15:12:14 +0200 Message-ID: <48C1302C.2040109@kkip.pl> Date: Fri, 05 Sep 2008 15:12:12 +0200 From: Bartosz Stec User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated-User: admin@kkip.pl X-Authenticator: plain X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) X-Spam-Score: -8.6 X-Spam-Score-Int: -85 X-Exim-Version: 4.69 (build at 26-Jun-2008 18:19:28) X-Date: 2008-09-05 15:12:14 X-Connected-IP: 192.168.0.10:4483 X-Message-Linecount: 147 X-Body-Linecount: 136 X-Message-Size: 5092 X-Body-Size: 4668 X-Received-Count: 1 X-Recipient-Count: 1 X-Local-Recipient-Count: 1 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 Subject: Funny things with cflags and world/kernel building X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 13:12:17 -0000 As well as i know variables works this way: # set foo=bar # set | grep foo _ set foo=bar foo bar # echo $foo bar # echo ${foo} bar So maybe someone could explain me why following things happens with variables in make.conf? My make.conf: CPUTYPE=athlon64 MAKEOPTS=-j3 # USE CCACHE .if !defined(NOCCACHE) CC=/usr/local/libexec/ccache/world-cc CXX=/usr/local/libexec/ccache/world-c++ .endif # default build settings for ports collection .if ${.CURDIR:M*/ports/*} CFLAGS= -O2 -fno-strict-aliasing -pipe -funroll-loops -fomit-frame-pointer CXXFLAGS= -O2 -fno-strict-aliasing -pipe -funroll-loops .endif # default build settings for base system .if ${.CURDIR:M*/usr/src/*} || ${.CURDIR:M*/usr/obj/*} CFLAGS=-O2 -fno-strict-aliasing -pipe #CXXFLAGS=-O2 -fno-strict-aliasing -pipe COPTFLAGS=-O2 -fno-strict-aliasing -pipe CXXFLAGS=${CFLAGS} #COPTFLAGS=${CFLAGS} .endif # added by use.perl 2008-04-14 10:39:38 PERL_VER=5.8.8 PERL_VERSION=5.8.8 As you see I use ccache and different flags for world and port building, but what's interesting: 1. when I use these flags: CFLAGS=-O2 -fno-strict-aliasing -pipe CXXFLAGS=${CFLAGS} COPTFLAGS=${CFLAGS} world building finish without problem, but making kernel give an error: -------------------------------------------------------------- >>> stage 3.1: making dependencies -------------------------------------------------------------- cd /usr/obj/usr/src/sys/AMD64SMP7; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE=athlon64 GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp VERSION="FreeBSD 7.1-PRERELEASE amd64 700112" INSTALL="sh /usr/src/tools/install.sh" PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin NO_CTF=1 make KERNEL=kernel depend -DNO_MODULES_OBJ machine -> /usr/src/sys/amd64/include Variable CFLAGS is recursive. *** Error code 2 Stop in /usr/src. *** Error code 1 Stop in /usr/src. 2. When I use these flags: CFLAGS=-O2 -fno-strict-aliasing -pipe CXXFLAGS=-O2 -fno-strict-aliasing -pipe COPTFLAGS=-O2 -fno-strict-aliasing -pipe kernel build finish without problem, but... building world give an error!: ===> gnu/lib/libstdc++ (depend) ln -sf /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/config/cpu/generic/ atomicity_builtins/atomicity.h atomicity.cc ln -sf /usr/src/gnu/lib/libstdc++/../../../contrib/gcc/unwind-generic.h unwind.h rm -f .depend (...) /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/unwind-cxx.h:41: 20: error: unwind.h: No such file or directory In file included from /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libs upc++/vec.cc:37: /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/libsupc++/unwind-cxx.h:41: 20: error: unwind.h: No such file or directory mkdep: compile failed *** Error code 1 Stop in /usr/src/gnu/lib/libstdc++. *** Error code 1 Stop in /usr/src/gnu/lib. *** Error code 1 3. What's even more funny? When I use flags: CFLAGS=-O2 -fno-strict-aliasing -pipe COPTFLAGS=-O2 -fno-strict-aliasing -pipe CXXFLAGS=${CFLAGS} I have no errors at all! But shouldn't all those flags be treated by make command exactly the same way?? It isn't new issue - it's couple of months as I face this problem - on AMD 64 machine with CPUTYPE=athlon64 and MAKEOPTS=-j3 and olso on i386 machine with CPUTYPE=pentium2 and MAKEOPTS=-j2. Other flags are the same as in the beginning of this message. Another machine - exactly the same flags but CPUTYPE=athlon-tbird and MAKEOPTS=-j2 and no problems compiling world and kernel regardless of flags combination. Could anyone explain to me sthis trange behaviour ? p.s. Sorry for my poor english ;) -- Bartosz Stec - specjalista ds. IT AUXILIA Spółka z o.o.