From owner-freebsd-stable@FreeBSD.ORG Tue Apr 9 19:38:12 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E8176B for ; Tue, 9 Apr 2013 19:38:12 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta05.emeryville.ca.mail.comcast.net (qmta05.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:48]) by mx1.freebsd.org (Postfix) with ESMTP id 452C2808 for ; Tue, 9 Apr 2013 19:38:12 +0000 (UTC) Received: from omta02.emeryville.ca.mail.comcast.net ([76.96.30.19]) by qmta05.emeryville.ca.mail.comcast.net with comcast id MvRT1l0020QkzPwA5veBHC; Tue, 09 Apr 2013 19:38:11 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta02.emeryville.ca.mail.comcast.net with comcast id MveA1l00W1t3BNj8NveA2d; Tue, 09 Apr 2013 19:38:11 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 79E5B73A39; Tue, 9 Apr 2013 12:38:10 -0700 (PDT) Date: Tue, 9 Apr 2013 12:38:10 -0700 From: Jeremy Chadwick To: Christian Baer Subject: Re: -Os breaks buildworld Message-ID: <20130409193810.GA10964@icarus.home.lan> References: <3845278.lKnuOXNTV5@lianli4> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3845278.lKnuOXNTV5@lianli4> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1365536291; bh=ksN16ycHBnAf/WLIeVCwAc+lBcOJDpT/F1Z2tpBTBqk=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=CEzKMtAP616WJWZG7WIKK4lNhZVxmx6UdPOgWlgP7nj6tcEhzC7JHGzzHE6JHjAUV LXnQq30h/ZNW54Mk9j/FOWzgzxZgBWCGDauycf1cUZ4Qv84Bw+xFD1td7s7VMPsEZ5 Ft6BK0BgcpH5blbA5L3d39ZfkcGGL0gWQK77WRO9IaHxc34Y3TK8BNVbPw38Sn7Puy KsT3CRCNxccvSutIcXdEUocd84TT8XzTBo029UabTQwKvVsmoS8nuu8Z6TbnAphT6H KMPOBTYFEz9adlN/iFt/XThlC3ug1+le8SeXIuZwEQoIdRJM5p9DIxZ2yqY6n5m4EA h6fMgZQKjy1cQ== Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 19:38:12 -0000 On Tue, Apr 09, 2013 at 02:50:29PM +0200, Christian Baer wrote: > Hey everyone! > > This is not really an important issue, I just wanted to find out if anyone had > it on his or her radar. > > I have a machine that isn't too powerful and hasn't got a lot of RAM either. > So as an experiment I wanted to compile the world with the option for > conserving space. Unfortunately, that didn't work out too well as it broke the > compile (see last lines appended after my signature). > > I updated with svn to version 249301 before compiling. > > The same code compiled with O2 works fine. I know you are going to ask about > my CFLAGS, so here they are: > > CPUTYPE= athlon-xp > CFLAGS= -O2 -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp > > And yes, the CPU is really an Athlon XP. ;-) > The only change I need to make to break the compile is -O2 to -Os. > > Has anyone noticed this too? A few things: 1. You didn't state which compiler you're using. 2. Your CFLAGS line above shows -O2, yet your output below shows -Os, and your Subject line is talking about -Os. 3. You should use CPUTYPE?= not CPUTYPE. 4. You need to use CFLAGS+= not CFLAGS=, otherwise you're effectively overriding flags that may be needed/set elsewhere within Makefiles. Furthermore, are you aware of the other internals which -Os disables? -Os disables the following optimization flags: -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays -ftree-vect-loop-version I would suggest not messing with the optimisation level in CFLAGS. This has come up/been discussed on the mailing lists repeatedly for almost two decades. I believe I read somewhere that adjusting that is basically "not supported" nor will it ever be. > famous last lines... :-) > > cc -Os -fno-strict-aliasing -pipe -mtune=athlon-xp -march=athlon-xp > -march=athlon-xp -DPTHREAD_KERNEL -I/usr/src/lib/libthr/../libc/include > -I/usr/src/lib/libthr/thread -I/usr/src/lib/libthr/../../include > -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys > -I/usr/src/lib/libthr/../../libexec/rtld-elf > -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 > -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS > -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -c /usr/src/lib/libthr/sys/thr_error.c cc -Os -fno-strict-aliasing -pipe > -mtune=athlon-xp -march=athlon-xp -march=athlon-xp -DPTHREAD_KERNEL > -I/usr/src/lib/libthr/../libc/include -I/usr/src/lib/libthr/thread > -I/usr/src/lib/libthr/../../include > -I/usr/src/lib/libthr/arch/i386/include -I/usr/src/lib/libthr/sys > -I/usr/src/lib/libthr/../../libexec/rtld-elf > -I/usr/src/lib/libthr/../../libexec/rtld-elf/i386 > -I/usr/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS > -DSYSCALL_COMPAT -std=gnu99 -Wsystem-headers -Werror -Wall > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign > -c /usr/src/lib/libthr/thread/thr_affinity.c > cc1: warnings being treated as errors > /usr/src/lib/libthr/thread/thr_affinity.c: In function > '_pthread_setaffinity_np': /usr/src/lib/libthr/thread/thr_umtx.h:103: > warning: inlining failed in call to '_thr_umutex_unlock': --param > max-inline-insns-single limit reached > /usr/src/lib/libthr/thread/thr_affinity.c:56: warning: called from here > /usr/src/lib/libthr/thread/thr_umtx.h:103: warning: inlining failed in > call to '_thr_umutex_unlock': --param max-inline-insns-single limit > reached /usr/src/lib/libthr/thread/thr_affinity.c:64: warning: called > from here *** Error code 1 > > Stop in /usr/src/lib/libthr. > *** Error code 1 > > Stop in /usr/src. > *** Error code 1 -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |