Clang now builds world and kernel, on i386 and amd64

Renato Botelho rbgarga at gmail.com
Wed Sep 29 15:48:47 UTC 2010


On Wed, Sep 29, 2010 at 11:06 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
>
> renato, can you check if libc compiled with clang -O0 still exhibits
> the bug?

I got the following error when i try to build libc with -O0

clang -O2 -pipe -O0  -I/usr/src/lib/libc/include
-I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS
-D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa
-DINET6 -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv
-D_ACL_PRIVATE -DPOSIX_MISTAKE
-I/usr/src/lib/libc/../../contrib/tzcode/stdtime
-I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES
-DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING
-DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wsystem-headers
-Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c
/usr/src/lib/libc/amd64/gen/ldexp.c
clang: warning: argument unused during compilation: '-O2'
Assertion failed: (RegMap[RegOnTop] < StackTop), function moveToTop,
file /usr/src/lib/clang/libllvmx86codegen/../../../contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp,
line 200.
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple
x86_64-undermydesk-freebsd9.0 -S -disable-free -main-file-name ldexp.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir /usr/lib/clang/2.8 -D
NLS -D __DBINTERFACE_PRIVATE -D INET6 -D _ACL_PRIVATE -D POSIX_MISTAKE
-D BROKEN_DES -D PORTMAP -D DES_BUILTIN -D YP -D NS_CACHING -D
SYMBOL_VERSIONING -I /usr/src/lib/libc/include -I
/usr/src/lib/libc/../../include -I /usr/src/lib/libc/amd64 -I
/usr/src/lib/libc/../../contrib/gdtoa -I /usr/obj/usr/src/lib/libc -I
/usr/src/lib/libc/resolv -I
/usr/src/lib/libc/../../contrib/tzcode/stdtime -I
/usr/src/lib/libc/stdtime -I /usr/src/lib/libc/locale -I
/usr/src/lib/libc/rpc -O0 -Wsystem-headers -Wall -Wno-format-y2k
-Wno-uninitialized -Wno-pointer-sign -std=gnu99 -ferror-limit 19
-fmessage-length 105 -stack-protector 1 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-8DfzyK.s -x c
/usr/src/lib/libc/amd64/gen/ldexp.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'X86 FP Stackifier' on function '@ldexp'
clang: error: clang frontend command failed due to signal 6 (use -v to
see invocation)
*** Error code 250

Removing -O0 from CFLAGS it builds fine. Am I doing something
wrong?

I added CFLAGS+=-O0 on /etc/make.conf, and

# cd /usr/src/lib/libc
# make clean && make clean && make cleandir
# make obj
# make depend
# make

Thanks
-- 
Renato Botelho


More information about the freebsd-current mailing list