[clang] boot2 fails to build with DEBUG_FLAGS?
Pan Tsu
inyaoo at gmail.com
Tue Jul 19 00:23:41 UTC 2011
Roman Divacky <rdivacky at freebsd.org> writes:
> I dont have the same environment (I am using trunk llvm/clang) but I cant
> reproduce it here...
>
> fwiw, with trunk llvm DEBUG_FLAGS dies in assembly stage because our as
> does not know .cfi_section
Why sys/boot even allows user CFLAGS influence if it's that fragile?
$ __MAKE_CONF=/dev/null make all CC=clang DEBUG_FLAGS='-g -fno-omit-frame-pointer'
===> i386/boot2 (all)
objcopy -S -O binary boot1.out boot1
dd if=/dev/zero of=boot2.ldr bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.000016 secs (32051995 bytes/sec)
[...]
ld -static -N --gc-sections -nostdlib -m elf_i386_fbsd -Ttext 0x2000 -o boot2.out /usr/obj/usr/src/sys/boot/i386/boot2/../btx/lib/crt0.o boot2.o sio.o
objcopy -S -O binary boot2.out boot2.bin
btxld -v -E 0x2000 -f bin -b /usr/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin
kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1
client: fmt=bin size=15bd text=0 data=0 bss=0 entry=0
output: fmt=bin size=1e4d text=200 data=1c4d org=0 entry=0
-77 bytes available
*** Error code 1
And those DEBUG_FLAGS are handy to globally make world and ports
trace-friendly (gdb/pmc/dtrace) without losing optimization. Luckily
.if ${.CURDIR:N*sys/boot*}
DEBUG_FLAGS ?= -g -fno-omit-frame-pointer
.endif
seems to work. OTOH, clang breaks gptzfsboot here, i.e.
ZFS: zfs_alloc()/zfs_free() mismatch
More information about the freebsd-toolchain
mailing list