From owner-freebsd-stable@freebsd.org Mon Apr 30 09:56:27 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47C39FC9FCB for ; Mon, 30 Apr 2018 09:56:27 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "david.siemens.de", Issuer "Siemens Issuing CA Internet Server 2017" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA30D6F5D3; Mon, 30 Apr 2018 09:56:26 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w3U9uOcE028077 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Apr 2018 11:56:25 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w3U9uOCV005391; Mon, 30 Apr 2018 11:56:24 +0200 Received: (from user@localhost) by curry.mchp.siemens.de (8.15.2/8.15.2) id w3U9uO07051625; Date: Mon, 30 Apr 2018 11:56:24 +0200 From: Andre Albsmeier To: Dimitry Andric Cc: Andre Albsmeier , FreeBSD Stable Subject: Re: gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK Message-ID: <20180430095624.GA16255@bali> References: <20180425165840.GA1330@bali> <1FDCF15C-E9FD-4746-9C89-F669EF4BA7C5@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1FDCF15C-E9FD-4746-9C89-F669EF4BA7C5@FreeBSD.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 09:56:27 -0000 On Thu, 26-Apr-2018 at 11:55:19 +0200, Dimitry Andric wrote: > On 25 Apr 2018, at 18:58, Andre Albsmeier wrote: > > > > I have set up a new system disk for an i386 11.2-PRERELEASE box. I did the > > usual > > > > gpart create -s gpt $disk > > gpart add -t freebsd-boot -s 984 $disk > > gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 $disk > > ... > > > > thing, just to notice that the box wouldn't boot. It seems to hang where > > stage 2 should be run -- when the '\' should start spinning the screen > > turns white and the box hangs (tested on two machines, an Asus P5W and a > > Supermicro A2SAV). > > > > So I replaced gptboot on the new disk by the one from an older machine > > and everything was fine. I wanted to find out what is actually causing > > the issue and recompiled /usr/src/stand after updating the old sources > > in several steps. > > > > Eventually it turned out that it depends on the compiler. When compiling > > the latest /usr/src/stand with clang 5.0.1 the resulting gptboot works. > > When using 6.0.0 it doesn't. To be exact, it's gptboot.o which is causing > > the problems. When using a gptboot.o from a clang 5 system it is OK, when > > using a gptboot.o from a clang 6 system it fails. > > > > To add more confusion: I usually have WITHOUT_LOADER_GELI in my make.conf. > > When removing this, the resulting gptboot works even when compiled with > > clang 6... > > > > I can reproduce this in case s.o. wants me to do some tests... > > I can't reproduce it on my end, unfortunately. I downloaded the latest > FreeBSD-11.2-PRERELEASE-i386-20180420-r332802 snapshot, installed it to > a GPT partitioned disk, and it boots just fine. Out of curiosity I removed -O1 from stand/i386/gptboot/Makefile so the standard -O2 is used. Now the resulting gptboot is: -rw-rw---- 1 andre wheel 22023 30 Apr 11:51 /usr/obj/src/src-11/stand/i386/gptboot/gptboot and it works! So something is screwed up when compiling gptboot with -O1 (and WITHOUT_LOADER_GELI and with clang 6.0.0).