vlc fails to build on pre-SSE2 processor

Volodymyr Kostyrko c.kworr at gmail.com
Wed Oct 3 13:19:50 UTC 2012


13.09.2012 21:40, Juergen Lock wrote:
>>>    And if that's not it try a newer gcc version and if you're on
>>> 9-stable or head try clang too.  (amd64 atm defaults to the base
>>> gcc 4.2, i386 to gcc 4.6 so try 4.6 or 4.7 respectively.)
>>
>> This one is:
>> CPU: AMD Athlon(tm) XP 2500+ (1833.95-MHz 686-class CPU)
>> Origin = "AuthenticAMD" Id = 0x6a0 Family = 6 Model = a Stepping = 0
>> Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
>> AMD Features=0xc0400800<SYSCALL,MMX+,3DNow!+,3DNow!>
>>
>>>    Good luck! :)
>>
>> Yes, as you suggest switching to clang works like a charm.
>
> Ok.  Now as 8.x doesn't have clang in base and 9.0 clang has been
> reported to miscompile at least one file on amd64 it would be
> interesting to know if gcc 4.7 works as well, so can you test that
> too?  And also which FreeBSD version is this on and was this base
> clang that worked?

As far as I see this is some local gcc glitch. My processor was always 
unloved and misinterpreted by gcc creators:

# uname -a
FreeBSD limbo.xim.bz 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240453M: 
Thu Sep 13 14:05:28 EEST 2012 
arcade at limbo.xim.bz:/usr/obj/usr/src/sys/MINIMALx32  i386

Built-in:

# : | gcc -E -v -march=native -
...
gcc version 4.2.1 20070831 patched [FreeBSD]
  /usr/libexec/cc1 -E -quiet -v -D_LONGLONG - -march=athlon-4 
-mtune=athlon-4
...

lang/gcc

# : | gcc46 -E -v -march=native -
...
gcc version 4.6.3 (FreeBSD Ports Collection)
COLLECT_GCC_OPTIONS='-E' '-v' '-march=native'
  /usr/local/libexec/gcc46/gcc/i386-portbld-freebsd9.0/4.6.3/cc1 -E 
-quiet -v - -march=athlon-4 -mno-cx16 -mno-sahf -mno-movbe -mno-aes 
-mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop 
-mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 --param 
l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 
-mtune=athlon
...

Built-in clang:

# : | clang -E -v -march=native -FreeBSD clang version 3.1 
(branches/release_31 156863) 20120523
...
  "/usr/bin/clang" -cc1 -triple i386-unknown-freebsd9.0 -E -disable-free 
-main-file-name - -mrelocation-model static -mdisable-fp-elim -masm-verb
ose -mconstructor-aliases -target-cpu athlon-xp 
-momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/3.1 
-fmodule-cache-path /var/tmp/clang-module-cache -fdebug-compilation-dir 
/usr/ports/lang/gcc47 -ferror-limit 19 -fmessage-length 144 
-mstackrealign -fgnu-runtime -fobjc-runtime-has-arc 
-fobjc-runtime-has-weak -fobjc-dispatch-method=non-legacy 
-fdiagnostics-show-option -fcolor-diagnostics -o - -x c -
...

I'm locally using CPUTYPE?=athlon-xp. However this doesn't helps just 
for each time.

lang/gcc47 fails copmilation with:

/tmp/ports/usr/ports/lang/gcc47/work/build/./gcc/xgcc -shared-libgcc 
-B/tmp/ports/usr/ports/lang/gcc47/work/build/./gcc -nostdinc++ -L/tmp/ports
/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/src -L/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/l
ibstdc++-v3/src/.libs -B/usr/local/i386-portbld-freebsd9.1/bin/ 
-B/usr/local/i386-portbld-freebsd9.1/lib/ -isystem 
/usr/local/i386-portbld-freeb
sd9.1/include -isystem /usr/local/i386-portbld-freebsd9.1/sys-include -x 
c++-header -nostdinc++ -g -O2 -pipe -march=athlon-xp -I/usr/local/in
clude -fno-strict-aliasing 
-I/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/i386-portbld-freebsd9.1 
-I/
tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include 
-I/tmp/ports/usr/ports/lang/gcc47/work/gcc-4.7-20120908/l
ibstdc++-v3/libsupc++ -O2 -g -std=gnu++0x 
/tmp/ports/usr/ports/lang/gcc47/work/gcc-4.7-20120908/libstdc++-v3/include/precompiled/stdc++.h 
\
-o i386-portbld-freebsd9.1/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from 
/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/random:51:0,
                  from 
/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/bits/stl_algo.h:67,
                  from 
/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/algorithm:63,
                  from 
/tmp/ports/usr/ports/lang/gcc47/work/gcc-4.7-20120908/libstdc++-v3/include/precompiled/stdc++.h:65:
/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/bits/random.tcc: 
In function '_RealType std::generate_ca
nonical(_UniformRandomNumberGenerator&)':
/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/bits/random.tcc:2843:59: 
   in constexpr expansion of 'st
d::log(2.0e+0l)'
/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include/bits/random.tcc:2843:59: 
internal compiler error: Illega
l instruction: 4
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
gmake[5]: *** [i386-portbld-freebsd9.1/bits/stdc++.h.gch/O2ggnu++0x.gch] 
Error 1
gmake[5]: Leaving directory 
`/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3/include'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory 
`/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory 
`/tmp/ports/usr/ports/lang/gcc47/work/build/i386-portbld-freebsd9.1/libstdc++-v3'
gmake[2]: *** [all-stage1-target-libstdc++-v3] Error 2
gmake[2]: Leaving directory `/tmp/ports/usr/ports/lang/gcc47/work/build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/tmp/ports/usr/ports/lang/gcc47/work/build'
gmake: *** [bootstrap-lean] Error 2
*** [do-build] Error code 1

It seems that only code generated by stock gcc 4.2.1 works. I can build 
other gcc only with this one. Anyway building vlc with any other gcc 
flavor results in coredump.

I'll assume this is my local glitch mostly related to gcc and nothing 
should be done to port globally as this cpu are quite rare nowadays.

-- 
Sphinx of black quartz judge my vow.


More information about the freebsd-multimedia mailing list