Re: clangBSD build error on r208621

From: Roman Divacky <rdivacky_at_FreeBSD.org>
Date: Sat, 29 May 2010 21:42:29 +0200
On Sat, May 29, 2010 at 11:31:52PM +0900, Norikatsu Shigemura wrote:
> Hi rdivacky.
> 
> On Sat, 29 May 2010 02:17:41 +0900
> Norikatsu Shigemura <nork_at_freebsd.org> wrote:
> > error: unknown argument: '-ferror-limit'
> > mkdep: compile failed
> > 	Do you have any idea?  Of cause I set following environment:
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > $ cat /etc/src.conf 
> > NO_WERROR=
> > WERROR=
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> 	OK, I got so that clang is too old.
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> $ /usr/bin/clang --version
> clang version 1.5 (trunk)
> Target: x86_64-undermydesk-freebsd9.0
> Thread model: posix
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 	So I did use latest clang by installing devel/llvm-devel.
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> $  /usr/local/bin/clang --version
> clang version 2.0 (trunk)
> Target: x86_64-portbld-freebsd9.0
> Thread model: posix
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> 	I can compile to well-known error point.
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> ===> sys/boot/i386/boot2 (all)
> dd if=/dev/zero of=boot2.ldr bs=512 count=1
> 1+0 records in
> 1+0 records out
> 512 bytes transferred in 0.000027 secs (18837576 bytes/sec)
> /usr/local/bin/clang -isysroot /usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/lib/ -L/usr/obj/usr/src/tmp/usr/lib/ -Os  -fno-guess-branch-probability  -fomit-frame-pointer  -fno-unit-at-a-time  -mno-align-long-strings  -mrtd  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3  -DUFS1_AND_UFS2  -DFLAGS=0x80  -DSIOPRT=0x3f8  -DSIOFMT=0x3  -DSIOSPD=9600  -I/usr/src/sys/boot/i386/boot2/../../common  -I/usr/src/sys/boot/i386/boot2/../btx/lib -I.  -Wall -Waggregate-return -Wbad-function-cast -Wcast-align  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings  -Winline --param max-inline-insns-single=100 -ffreestanding -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -m32 -march=i386 -std=gnu99   -c /usr/src/sys/boot/i386/boot2/sio.S
> clang: warning: the clang compiler does not support '-fno-unit-at-a-time'
> clang: warning: argument unused during compilation: '-L/usr/obj/usr/src/tmp/usr/lib/'
> clang: warning: argument unused during compilation: '-fno-guess-branch-probability'
> clang: warning: argument unused during compilation: '-mno-align-long-strings'
> clang: warning: argument unused during compilation: '-mrtd'
> clang: warning: argument unused during compilation: '--param max-inline-insns-single=100'
> clang: warning: argument unused during compilation: '-mpreferred-stack-boundary=2'
> objcopy -S -O binary boot1.out boot1
> /usr/local/bin/clang -isysroot /usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/lib/ -L/usr/obj/usr/src/tmp/usr/lib/ -Os  -fno-guess-branch-probability  -fomit-frame-pointer  -fno-unit-at-a-time  -mno-align-long-strings  -mrtd  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3  -DUFS1_AND_UFS2  -DFLAGS=0x80  -DSIOPRT=0x3f8  -DSIOFMT=0x3  -DSIOSPD=9600  -I/usr/src/sys/boot/i386/boot2/../../common  -I/usr/src/sys/boot/i386/boot2/../btx/lib -I.  -Wall -Waggregate-return -Wbad-function-cast -Wcast-align  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs  -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings  -Winline --param max-inline-insns-single=100 -ffreestanding -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -m32 -march=i386 -std=gnu99   -S -o boot2.s.tmp /usr/src/sys/boot/i386/boot2/boot2.c
> clang: warning: the clang compiler does not support '-fno-unit-at-a-time'
> clang: warning: argument unused during compilation: '-L/usr/obj/usr/src/tmp/usr/lib/'
> clang: warning: argument unused during compilation: '-fno-guess-branch-probability'
> clang: warning: argument unused during compilation: '-mno-align-long-strings'
> clang: warning: argument unused during compilation: '-mrtd'
> clang: warning: argument unused during compilation: '--param max-inline-insns-single=100'
> clang: warning: argument unused during compilation: '-mpreferred-stack-boundary=2'
> /usr/src/sys/boot/i386/boot2/boot2.c:234:1: warning: no previous prototype for function 'main' [-Wmissing-prototypes]
> main(void)
> ^
> 1 warning generated.
> sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
> rm -f boot2.s.tmp
> as  --32 -o boot2.o boot2.s
> 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=1705 text=0 data=0 bss=0 entry=0
> output: fmt=bin size=1f95 text=200 data=1d95 org=0 entry=0
> -405 bytes available
> *** Error code 1
> 1 error

clang as is cant compile boot2. there's a makefile goo that forces it to use gcc
but for some reason (unknown to me) you force it to use clang.

this issue is known and there's even a known fix, documented at 

	http://llvm.org/bugs/show_bug.cgi?id=6623
	http://llvm.org/bugs/show_bug.cgi?id=6627

I hope that those problems will be fixed in a few days...	
Received on Sat May 29 2010 - 17:45:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:03 UTC