Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Apr 2018 11:51:06 +0200
From:      Andre Albsmeier <Andre.Albsmeier@siemens.com>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        Andre Albsmeier <Andre.Albsmeier@siemens.com>, FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: gptboot broken when compiled with clang 6 and WITHOUT_LOADER_GELI -- clang 5 is OK
Message-ID:  <20180430095106.GA16041@bali>
In-Reply-To: <1FDCF15C-E9FD-4746-9C89-F669EF4BA7C5@FreeBSD.org>
References:  <20180425165840.GA1330@bali> <1FDCF15C-E9FD-4746-9C89-F669EF4BA7C5@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 26-Apr-2018 at 11:55:19 +0200, Dimitry Andric wrote:
> On 25 Apr 2018, at 18:58, Andre Albsmeier <Andre.Albsmeier@siemens.com> w=
rote:
> >=20
> > I have set up a new system disk for an i386 11.2-PRERELEASE box. I did =
the
> > usual
> >=20
> > gpart create -s gpt $disk
> > gpart add -t freebsd-boot -s 984 $disk
> > gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 $disk
> > ...
> >=20
> > 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).
> >=20
> > 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.
> >=20
> > 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 causi=
ng
> > the problems. When using a gptboot.o from a clang 5 system it is OK, wh=
en
> > using a gptboot.o from a clang 6 system it fails.
> >=20
> > To add more confusion: I usually have WITHOUT_LOADER_GELI in my make.co=
nf.
> > When removing this, the resulting gptboot works even when compiled with
> > clang 6...
> >=20
> > I can reproduce this in case s.o. wants me to do some tests...
>=20
> 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.

It is clearly reproducible here with r333082 and with /etc/make.conf having
only WITHOUT_LOADER_GELI. The resulting gptboot is:

-rw-rw----  1 andre  wheel  20859 30 Apr 11:46 /usr/obj/src/src-11/stand/i3=
86/gptboot/gptboot

Here are the logs, maybe something is hidden here:

machine -> /src/src-11/sys/i386/include
x86 -> /src/src-11/sys/x86/include
gzip -cn /src/src-11/stand/i386/gptboot/gptboot.8 > gptboot.8.gz
cc -O2 -pipe   -I/src/src-11/stand/i386/btx/lib -nostdinc -I/usr/obj/src/sr=
c-11/stand/libsa -I/src/src-11/stand/libsa -D_STANDALONE -I/src/src-11/sys =
-Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatface -DLOADER_DISK_SU=
PPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=3Di386 =
-I. -DBOOTPROG=3D\"gptboot\"  -O1  -DGPT  -DUFS1_AND_UFS2  -DSIOPRT=3D0x3f8=
  -DSIOFMT=3D0x3  -DSIOSPD=3D9600  -I/src/src-11/stand/common  -I/src/src-1=
1/stand/i386/common  -I/src/src-11/stand/i386/boot2  -Wall -Waggregate-retu=
rn -Wbad-function-cast -Wno-cast-align  -Wmissing-declarations -Wmissing-pr=
ototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Ww=
rite-strings  -Winline -Wno-pointer-sign -g -std=3Dgnu99 -Wsystem-headers -=
Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-c=
onst-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-=
equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede=
f -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promo=
ted-parameter -Wno-parentheses  -Qunused-arguments -no-integrated-as   -c /=
src/src-11/stand/i386/gptboot/gptldr.S -o gptldr.o
ld -static -N --gc-sections -e start -Ttext 0x7c00 -o gptldr.out gptldr.o
objcopy -S -O binary gptldr.out gptldr.bin
cc -O2 -pipe   -I/src/src-11/stand/i386/btx/lib -nostdinc -I/usr/obj/src/sr=
c-11/stand/libsa -I/src/src-11/stand/libsa -D_STANDALONE -I/src/src-11/sys =
-Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatface -DLOADER_DISK_SU=
PPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=3Di386 =
-I. -DBOOTPROG=3D\"gptboot\"  -O1  -DGPT  -DUFS1_AND_UFS2  -DSIOPRT=3D0x3f8=
  -DSIOFMT=3D0x3  -DSIOSPD=3D9600  -I/src/src-11/stand/common  -I/src/src-1=
1/stand/i386/common  -I/src/src-11/stand/i386/boot2  -Wall -Waggregate-retu=
rn -Wbad-function-cast -Wno-cast-align  -Wmissing-declarations -Wmissing-pr=
ototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Ww=
rite-strings  -Winline -Wno-pointer-sign -g -std=3Dgnu99 -Wsystem-headers -=
Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-c=
onst-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-=
equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede=
f -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promo=
ted-parameter -Wno-parentheses  -Qunused-arguments  -c /src/src-11/stand/i3=
86/gptboot/gptboot.c -o gptboot.o
cc -O2 -pipe   -I/src/src-11/stand/i386/btx/lib -nostdinc -I/usr/obj/src/sr=
c-11/stand/libsa -I/src/src-11/stand/libsa -D_STANDALONE -I/src/src-11/sys =
-Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatface -DLOADER_DISK_SU=
PPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=3Di386 =
-I. -DBOOTPROG=3D\"gptboot\"  -O1  -DGPT  -DUFS1_AND_UFS2  -DSIOPRT=3D0x3f8=
  -DSIOFMT=3D0x3  -DSIOSPD=3D9600  -I/src/src-11/stand/common  -I/src/src-1=
1/stand/i386/common  -I/src/src-11/stand/i386/boot2  -Wall -Waggregate-retu=
rn -Wbad-function-cast -Wno-cast-align  -Wmissing-declarations -Wmissing-pr=
ototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Ww=
rite-strings  -Winline -Wno-pointer-sign -g -std=3Dgnu99 -Wsystem-headers -=
Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-c=
onst-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-=
equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede=
f -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promo=
ted-parameter -Wno-parentheses  -Qunused-arguments    -c /src/src-11/stand/=
i386/boot2/sio.S -o sio.o
cc -O2 -pipe   -I/src/src-11/stand/i386/btx/lib -nostdinc -I/usr/obj/src/sr=
c-11/stand/libsa -I/src/src-11/stand/libsa -D_STANDALONE -I/src/src-11/sys =
-Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatface -DLOADER_DISK_SU=
PPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=3Di386 =
-I. -DBOOTPROG=3D\"gptboot\"  -O1  -DGPT  -DUFS1_AND_UFS2  -DSIOPRT=3D0x3f8=
  -DSIOFMT=3D0x3  -DSIOSPD=3D9600  -I/src/src-11/stand/common  -I/src/src-1=
1/stand/i386/common  -I/src/src-11/stand/i386/boot2  -Wall -Waggregate-retu=
rn -Wbad-function-cast -Wno-cast-align  -Wmissing-declarations -Wmissing-pr=
ototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Ww=
rite-strings  -Winline -Wno-pointer-sign -g -std=3Dgnu99 -Wsystem-headers -=
Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-c=
onst-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-=
equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede=
f -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promo=
ted-parameter -Wno-parentheses  -Qunused-arguments  -c /src/src-11/stand/li=
bsa/crc32.c -o crc32.o
cc -O2 -pipe   -I/src/src-11/stand/i386/btx/lib -nostdinc -I/usr/obj/src/sr=
c-11/stand/libsa -I/src/src-11/stand/libsa -D_STANDALONE -I/src/src-11/sys =
-Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatface -DLOADER_DISK_SU=
PPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=3Di386 =
-I. -DBOOTPROG=3D\"gptboot\"  -O1  -DGPT  -DUFS1_AND_UFS2  -DSIOPRT=3D0x3f8=
  -DSIOFMT=3D0x3  -DSIOSPD=3D9600  -I/src/src-11/stand/common  -I/src/src-1=
1/stand/i386/common  -I/src/src-11/stand/i386/boot2  -Wall -Waggregate-retu=
rn -Wbad-function-cast -Wno-cast-align  -Wmissing-declarations -Wmissing-pr=
ototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Ww=
rite-strings  -Winline -Wno-pointer-sign -g -std=3Dgnu99 -Wsystem-headers -=
Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-c=
onst-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-=
equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede=
f -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promo=
ted-parameter -Wno-parentheses  -Qunused-arguments  -c /src/src-11/stand/i3=
86/common/drv.c -o drv.o
cc -O2 -pipe   -I/src/src-11/stand/i386/btx/lib -nostdinc -I/usr/obj/src/sr=
c-11/stand/libsa -I/src/src-11/stand/libsa -D_STANDALONE -I/src/src-11/sys =
-Ddouble=3Djagged-little-pill -Dfloat=3Dfloaty-mcfloatface -DLOADER_DISK_SU=
PPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=3Di386 =
-I. -DBOOTPROG=3D\"gptboot\"  -O1  -DGPT  -DUFS1_AND_UFS2  -DSIOPRT=3D0x3f8=
  -DSIOFMT=3D0x3  -DSIOSPD=3D9600  -I/src/src-11/stand/common  -I/src/src-1=
1/stand/i386/common  -I/src/src-11/stand/i386/boot2  -Wall -Waggregate-retu=
rn -Wbad-function-cast -Wno-cast-align  -Wmissing-declarations -Wmissing-pr=
ototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Ww=
rite-strings  -Winline -Wno-pointer-sign -g -std=3Dgnu99 -Wsystem-headers -=
Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-c=
onst-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-=
equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typede=
f -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promo=
ted-parameter -Wno-parentheses  -Qunused-arguments  -c /src/src-11/stand/i3=
86/common/cons.c -o cons.o
ld -static -N --gc-sections -Ttext 0x0 -o gptboot.out /usr/obj/src/src-11/s=
tand/i386/btx/lib/crt0.o gptboot.o sio.o crc32.o drv.o cons.o  /usr/obj/src=
/src-11/stand/libsa/libsa.a
objcopy -S -O binary gptboot.out gptboot.bin
btxld -v -E 0x0 -f bin -b /usr/obj/src/src-11/stand/i386/btx/btx/btx -l gpt=
ldr.bin  -o gptboot gptboot.bin
kernel: ver=3D1.02 size=3D690 load=3D9000 entry=3D9010 map=3D16M pgctl=3D0:0
client: fmt=3Dbin size=3D4a69 text=3D0 data=3D0 bss=3D0 entry=3D0
output: fmt=3Dbin size=3D517b text=3D82 data=3D50f9 org=3D0 entry=3D0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180430095106.GA16041>