From owner-freebsd-current@FreeBSD.ORG Mon Nov 12 18:16:01 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 EEB8516A41A for ; Mon, 12 Nov 2007 18:16:01 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2001:1b20:1:3::1]) by mx1.freebsd.org (Postfix) with ESMTP id 1F7D913C49D for ; Mon, 12 Nov 2007 18:16:00 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id lACIFr0I019492; Mon, 12 Nov 2007 19:15:59 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id lACIFrrW019491; Mon, 12 Nov 2007 19:15:53 +0100 (CET) (envelope-from olli) Date: Mon, 12 Nov 2007 19:15:53 +0100 (CET) Message-Id: <200711121815.lACIFrrW019491@lurza.secnetix.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG, stephan@yaraghchi.org In-Reply-To: <25f52a3d0711010019v76aef126q6ccae27682f14568@mail.gmail.com> X-Newsgroups: list.freebsd-current User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 12 Nov 2007 19:15:59 +0100 (CET) X-Mailman-Approved-At: Mon, 12 Nov 2007 18:22:28 +0000 Cc: Subject: Re: loader breaks with -O2 optimizations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.ORG, stephan@yaraghchi.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2007 18:16:02 -0000 Stephan F. Yaraghchi wrote: > Oliver Fromme wrote: > > Stephan F. Yaraghchi wrote: > > > After making world on a freshly installed 7.0-BETA1 > > > the system does not boot anymore due to a broken loader: > > > [...] > > > I found out that the following line in my make.conf causes > > > the problem: > > > > > > CFLAGS= -O2 -funroll-loops -pipe > > > > > > After changing down to -O1 and making /usr/src/sys/boot again > > > the systems behaves properly at boot. > > > > Have you tried with the default flags? i.e. simply remove > > the CFLAGS line from your make.conf. Does the loader still > > break? > > > > Best regards > > Oliver > > > > PS: The default flags are: -O2 -fno-strict-aliasing -pipe > > (see /usr/share/mk/sys.mk) > > Hi Oliver, > > I added -O2 -fno-strict-aliasing -pipe to the make.conf and it worked too! Nice to hear that it works, but ... Actually my point was that you should _remove_ the "CFLAGS=" line entirely from your make.conf, instead of replacing a bogus set of flags with a different set of flags that happens to work in this particular case. Even if the flags you inserted are the normal default flags, some piece of software might want to use different flags for certain reasons. Your "CFLAGS=" line might break those, as others have already explained in this thread. A general rule of thumb is to never touch CFLAGS globally, but only for specific software, if you're sure that it actually benefits from your modified flags. For example, some ports offer options to enable optimized CFLAGS, for that particular port only. Regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "anyone new to programming should be kept as far from C++ as possible; actually showing the stuff should be considered a criminal offence" -- Jacek Generowicz