Andre Albsmeier
2018-Apr-25 16:58 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
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...
Dewayne Geraghty
2018-Apr-25 23:04 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
[This email is either empty or too large to be displayed at this time]
Dewayne Geraghty
2018-Apr-26 04:17 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
Andre, You're not alone.? I think there's a problem with clang6 on i386 FreeBSD 11.1X, refer: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227552 https://forums.freebsd.org/threads/uptime-w-i386-breakage.65584/ and perhaps also on amd64, search for https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=clang&list_id=226390. Without time to investigate I've reverted userland FreeBSD 11.2-PRERELEASE? r332843M??? amd64 1101515 1101509 FreeBSD 11.2-PRERELEASE? r332843M??? i386 1101515 1101509 Apologies for my earlier email, I'd missed setting content-type: text/plain instead of text/html (the latter strips content to the mailing list), too many management memo's! ;)
Dimitry Andric
2018-Apr-26 09:55 UTC
gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
On 25 Apr 2018, at 18:58, Andre Albsmeier <Andre.Albsmeier at siemens.com> 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. This snapshot corresponds to r332802, which has clang 6.0.0, with the EFLAGS change still reverted, so I assume its copy of gptboot is also compiled with that. Which exact revision of the base system were you using? -Dimitry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 223 bytes Desc: Message signed with OpenPGP URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20180426/b393967f/attachment.sig>