From owner-freebsd-current@FreeBSD.ORG Wed Oct 31 14:03:14 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A3416A468 for ; Wed, 31 Oct 2007 14:03:14 +0000 (UTC) (envelope-from josh.carroll@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by mx1.freebsd.org (Postfix) with ESMTP id 9054413C49D for ; Wed, 31 Oct 2007 14:03:13 +0000 (UTC) (envelope-from josh.carroll@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so308519pyb for ; Wed, 31 Oct 2007 07:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=+8W8Bma+VkkbFwqYu/jdxzRZebPwlv2ho1CvdWzPn74=; b=KU1PRK7FU29mgZTmA9WvjK7YtrV1KNDt2T6nE8sGQ/qfbF4n44K1SHm3rMzW3GmkOjb5S7CjQ4eSV7TpycpE0exFh/psKhvBOgvaDb5HKXAmAzIR8LaUj3s3loU4eainD81A3KCxlf1aDxkBbGScH4OUjeLG38u0cUYz5cB/Mmg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Z/XVTZCU3XlHob2skETBBWtIMZCq9V/W7h3Z6Kn1FTKRDmmGXq7VIjymTtox5W9/TWaSJ4gWgwRfTFk4BFaSoFLvRKbEmUAfON7V3OI8YtEAI5Rb6e7/VNCiRDDUuNIYEoEVi0BkeP2H3hkqleEkXedsnIrbNPva3V0CPsRfI74= Received: by 10.35.91.1 with SMTP id t1mr10236043pyl.1193839376258; Wed, 31 Oct 2007 07:02:56 -0700 (PDT) Received: by 10.35.110.17 with HTTP; Wed, 31 Oct 2007 07:02:56 -0700 (PDT) Message-ID: <8cb6106e0710310702w774c3c39sdcc9bf4fcf87d043@mail.gmail.com> Date: Wed, 31 Oct 2007 10:02:56 -0400 From: "Josh Carroll" To: "Kris Kennaway" In-Reply-To: <47284E4F.5030008@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <25f52a3d0710300732x425f0c45vde1a29361096c018@mail.gmail.com> <47284E4F.5030008@FreeBSD.org> Cc: freebsd-current@freebsd.org, "Stephan F. Yaraghchi" Subject: Re: loader breaks with -O2 optimizations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: josh.carroll@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2007 14:03:15 -0000 > Maybe, what happens if you use just -O2 -pipe? -funroll-loops is not an > appropriate thing to be using globally anyway, unless your intention is > to randomly make some code slower. I encountered the same thing in 7.0-BETA1 and resolved it with an edit to make.conf, specifically: .if ! ${.CURDIR:M*/boot/i386/boot2*} CFLAGS+=-O2 -pipe CXXFLAGS+=-O2 -pipe .endif That way, everything else in world is built with -O2 (which I have never had a problem with, by the way), but loader's CFLAGS are retained. The crux of the problem is that gcc takes the LAST -O option as the effective one. That is: gcc -Os ... -O2 is the equivalent of: gcc -O2 ... Which is exactly what's happening in this case (the loader Makefile sets CFLAGS to include -Os to optimize for size). Short of finding a way to prepend to CFLAGS so that a Makefile's CFLAGS are appended to what is defined in make.conf, I don't see another way around this. The make.conf hack seems to work, though. Regards, Josh