From owner-freebsd-stable@FreeBSD.ORG Sun Sep 7 20:41:05 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 A00FA1065675 for ; Sun, 7 Sep 2008 20:41:05 +0000 (UTC) (envelope-from takeda@takeda.tk) Received: from chinatsu.takeda.tk (h-74-0-89-210.lsanca54.covad.net [74.0.89.210]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA178FC18 for ; Sun, 7 Sep 2008 20:41:04 +0000 (UTC) (envelope-from takeda@takeda.tk) Received: from takeda.lan (takeda.lan [10.0.0.3]) (authenticated bits=0) by chinatsu.takeda.tk (8.14.2/8.14.2) with ESMTP id m87Kf34e055288 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Sun, 7 Sep 2008 13:41:04 -0700 (PDT) (envelope-from takeda@takeda.tk) Date: Sun, 7 Sep 2008 13:40:19 -0700 From: =?utf-8?Q?Derek_Kuli=C5=84ski?= X-Mailer: The Bat! (v3.99.3) Professional X-Priority: 3 (Normal) Message-ID: <334439428.20080907134019@takeda.tk> To: Bartosz Stec In-Reply-To: <48C1302C.2040109@kkip.pl> References: <48C1302C.2040109@kkip.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.93.3/8183/Sun Sep 7 12:23:50 2008 on chinatsu.takeda.tk X-Virus-Status: Clean Cc: freebsd-stable@freebsd.org Subject: Re: 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: Sun, 07 Sep 2008 20:41:05 -0000 Hello Bartosz, Friday, September 5, 2008, 6:12:12 AM, you wrote: > My make.conf: > CPUTYPE=athlon64 > MAKEOPTS=-j3 I would recommend to take that -j3 out from make.conf, it might screw up make install, not to mention many ports might not build with it. > # USE CCACHE > .if !defined(NOCCACHE) > CC=/usr/local/libexec/ccache/world-cc > CXX=/usr/local/libexec/ccache/world-c++ > .endif AFAIK this is setting for building world, the way you set it up seems to be using it for everything else (i.e. ports) I belive this is the recommended way of using it: .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) && !defined(NOCCACHE) CC=/usr/local/libexec/ccache/world-cc CXX=/usr/local/libexec/ccache/world-c++ .endif > 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: > 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!: > 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?? I think the strange behavior probably is because make.conf is called each time a make is executed. Building world, kernel etc. Will call multiple makes inside of another make. I suspect some of the Makefiles might append additional flags, so the ${CFLAGS} might change its value in different parts of the compiling, so that's why you might get the weird errors. I guess perhaps you could use the last option since it works, or instead of using = you would use ?= i.e. CFLAGS ?= -O2 -fno-strict-aliasing -pipe This will assign cflags only if CFLAGS is empty. -- Best regards, Derek mailto:takeda@takeda.tk -- Be nice to your kids. They'll choose your nursing home.