From owner-freebsd-current@FreeBSD.ORG Sun Oct 23 15:27:56 2011 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 0FACF106564A; Sun, 23 Oct 2011 15:27:56 +0000 (UTC) (envelope-from dkmail@mail.neveragain.de) Received: from mail.neveragain.de (mail.neveragain.de [IPv6:2001:aa8:fffc::25]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA118FC13; Sun, 23 Oct 2011 15:27:55 +0000 (UTC) Received: by mail.neveragain.de (Postfix, from userid 1029) id 5941517025; Sun, 23 Oct 2011 17:27:54 +0200 (CEST) Date: Sun, 23 Oct 2011 17:27:54 +0200 From: Dennis Koegel To: John Baldwin Message-ID: <20111023152754.GA35505@neveragain.de> References: <20111021085851.GA51368@neveragain.de> <201110211633.38764.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201110211633.38764.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Pavel Timofeev , freebsd-current@freebsd.org, avg@freebsd.org Subject: Re: Fresh installed Freebsd 9 don't boot from hd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2011 15:27:56 -0000 On Fri, Oct 21, 2011 at 04:33:38PM -0400, John Baldwin wrote: > Working offline with Dennis, we found that changing the CFLAGS in > sys/boot/i386/gptboot/Makefile from "-O1" to "-Os -mrtd" (partially reverting > an earlier commit) fixed gptboot. The next test for someone to do would be to > try just adding "-mrtd" and leaving "-O1" as-is to see if that fixes it. More test results: gcc -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time \ -mno-align-long-strings -mrtd [from before r225530]: Boots OK gcc -Os -mrtd: Boots OK gcc -O1 -mrtd: Fails gcc -O1: Fails gcc -O0: Fails gcc -Os: Boots OK clang -O1: Fails clang -Os: Fails clang -Oz: Fails I've put some printf()s into gpt{,boot}.c to trace where the reboot is triggered. It appears to be in drvsize() (called from gptread()). OTOH the debug output may have changed where the problem occurs, I don't know about that. With 9.0R drawing near, CFLAGS should be s/-O1/-Os/, until we can figure out what happens. But as for why gcc's magic -Os is required and clang's output doesn't work at all, I'm clueless. - D.