Clang now builds world and kernel, on i386 and amd64

Olivier Smedts olivier at gid0.org
Tue Sep 28 07:49:05 UTC 2010


2010/9/27 Olivier Smedts <olivier at gid0.org>:
> 2010/9/27 Olivier Smedts <olivier at gid0.org>:
>> 2010/9/27 Dimitry Andric <dim at freebsd.org>:
>>> On 2010-09-27 09:32, Olivier Smedts wrote:
>>>>
>>>> 2010/9/23 Bartosz Stec<admin at kkip.pl>:
>>>
>>> ...
>>>>>
>>>>> Assertion failed: (false&&  "Ran out of registers during register
>>>>> allocation!"), function assignRegOrStackSlotAtInterval, file
>>>>>
>>>>> /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
>>>>> line 1196.
>>>
>>> ...
>>>>
>>>> Same error here with yesterday's -CURRENT, but not at the same time
>>>> (the running system was compiled using gcc) :
>>>
>>> As with Bartosz, could you please remove the CPU-specific flags from
>>> make.conf, and try again?
>>
>> Ok, I'll post the results later (it was the same with -DNDEBUG).
>
> Was not OK with :
> CPUTYPE=athlon-xp
> CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
> NO_CPU_CFLAGS=yes
> COPTFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
> NO_CPU_COPTFLAGS=yes
>
> Is OK with :
> CPUTYPE=athlon-xp
> CFLAGS=-O2 -pipe -fomit-frame-pointer
> NO_CPU_CFLAGS=yes
> COPTFLAGS=-O2 -pipe -fomit-frame-pointer
> NO_CPU_COPTFLAGS=yes
>
> I'll try with other -march (i686 and athlon) and post results.

So, with "-march=athlon", buildworld is ok.

With "-march=athlon -msse" or "-march=athlon-xp" or "-march=native",
buildworld fails here :
clang -c -O2 -pipe -march=athlon -msse -fomit-frame-pointer -DIN_GCC
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
-I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
-I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
-fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
-DElfW=__ElfN -o unwind-dw2.o
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
Assertion failed: (!spillIs.empty() && "No spill intervals?"),
function assignRegOrStackSlotAtInterval, file
/usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
line 1287.
Stack dump:
0.      Program arguments: /usr/obj/usr/src/tmp/usr/bin/clang -cc1
-triple i386-undermydesk-freebsd9.0 -S -disable-free -main-file-name
unwind-dw2.c -pic-level 2 -mconstructor-aliases -target-cpu athlon
-target-feature +sse -resource-dir
/usr/obj/usr/src/tmp/usr/lib/clang/2.8 -D IN_GCC -D IN_LIBGCC2 -D
__GCC_FLOAT_NOT_NEEDED -D HAVE_GTHR_DEFAULT -D HIDE_EXPORTS -D
__GLIBC__=3 -D ElfW=__ElfN -I
/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include -I
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config -I
/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I . -I
/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -O2 -std=gnu99
-ferror-limit 19 -fmessage-length 118 -fvisibility hidden -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/cc-CfyzYr.s -x c
/usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Linear Scan Register Allocator' on function
'@_Unwind_GetGR'
clang: error: clang frontend command failed due to signal 6 (use -v to
see invocation)
*** Error code 250
Stop in /usr/src/gnu/lib/libgcc.

But if I
# cd /usr/src/gnu/lib/libgcc
# make
then unwind-dw2.c compiles fine.

So the problem seems to be with clang
(/usr/obj/usr/src/tmp/usr/bin/clang) when compiled with SSE on Athlon.
Can't try with AMD k8 or Intel CPUs, my core2 follows -STABLE.

>
>>> I guess there is something borked in LLVM's Athlon optimization, so it
>>> is probably better to not try to tickly those bugs for now.
>>>
>>>
>>>> # grep -vE '^#|^$' /etc/make.conf
>>>> KERNCONF=XPC
>>>> CPUTYPE=athlon-xp
>>>> CFLAGS=-O2 -pipe -march=native -fomit-frame-pointer
>>>
>>> Using CPUTYPE= and -march= seems a bit redundant. :)
>>
>> Not with NO_CPU_CFLAGS=yes and NO_CPU_COPTFLAGS=yes (if you want to
>> use -march=native, that's the best thing to do).
>>
>>>
>>>> clang -c -O2 -pipe -march=native -fomit-frame-pointer -DIN_GCC
>>>> -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -DHAVE_GTHR_DEFAULT
>>>> -I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include
>>>> -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config
>>>> -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I.
>>>> -I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=gnu99
>>>> -fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3
>>>> -DElfW=__ElfN -o unwind-dw2.o
>>>> /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c
>>>> Assertion failed: (!spillIs.empty()&&  "No spill intervals?"),
>>>> function assignRegOrStackSlotAtInterval, file
>>>>
>>>> /usr/src/lib/clang/libllvmcodegen/../../../contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp,
>>>> line 1287.
>>>
>>> I haven't yet seen this one before.  If I can reproduce it, I will
>>> report it upstream, and see if they can come up with a fix.
>
> Anything I can provide to help with that ?
>
>>
>> Thanks !
>>
>> --
>> Olivier Smedts
>
> --
> Olivier Smedts

-- 
Olivier Smedts                                                 _
                                        ASCII ribbon campaign ( )
e-mail: olivier at gid0.org        - against HTML email & vCards  X
www: http://www.gid0.org    - against proprietary attachments / \

  "Il y a seulement 10 sortes de gens dans le monde :
  ceux qui comprennent le binaire,
  et ceux qui ne le comprennent pas."


More information about the freebsd-current mailing list