vlc fails to build on pre-SSE2 processor

Volodymyr Kostyrko c.kworr at gmail.com
Sat Sep 15 06:36:57 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
>> 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 misdetected by gcc:

# 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


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


# : | 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 

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 -

So only clang correctly detects this processor as athlon-xp. The major 
difference from athlon-4 is SSE2 absence.

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

lang/gcc47 fails compilation 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 
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 
ibstdc++-v3/libsupc++ -O2 -g -std=gnu++0x 
-o i386-portbld-freebsd9.1/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from 
In function '_RealType std::generate_ca
   in constexpr expansion of 'st
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 
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory 
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory 
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

I'll try rebuilding lang/gcc without CPUTYPE set and see if this helps.

Sphinx of black quartz judge my vow.

More information about the freebsd-multimedia mailing list