VLC 2.0.0rc1 fails to build with GCC 4.2.1 on i386
Attempting to build VLC 2.0.0rc1 with GCC 4.2.1 on i386 results in the following error in misc/cpu.c...
cc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -DMODULE_STRING="main" -DLOCALEDIR="/usr/local/share/locale" -DSYSCONFDIR="/etc" -DDATA_PATH="/usr/local/share/vlc" -DPKGLIBDIR="/usr/local/lib/vlc" -I../include -I../include -I/usr/X11R6/include -I/usr/local/include -I/usr/local/include/libpng -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -O2 -pipe -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -ffast-math -funroll-loops -fomit-frame-pointer -MT misc/cpu.lo -MD -MP -MF misc/.deps/cpu.Tpo -c misc/cpu.c -fPIC -DPIC -o misc/.libs/cpu.o
misc/cpu.c:87: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
misc/cpu.c:93: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
misc/cpu.c:99: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
misc/cpu.c:123: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
misc/cpu.c: In function 'vlc_CPU_init':
misc/cpu.c:224: error: 'SSE_test' undeclared (first use in this function)
misc/cpu.c:224: error: (Each undeclared identifier is reported only once
misc/cpu.c:224: error: for each function it appears in.)
misc/cpu.c:233: error: 'SSE2_test' undeclared (first use in this function)
misc/cpu.c:240: error: 'SSE3_test' undeclared (first use in this function)
misc/cpu.c:277: error: 'ThreeD_Now_test' undeclared (first use in this function)
The first 4 errors above are caused by the header include/vlc_cpu.h..
# if defined (__MMX__)
# define VLC_MMX
# elif VLC_GCC_VERSION(4, 4)
# define VLC_MMX __attribute__ ((__target__ ("mmx")))
# else
# define VLC_MMX VLC_MMX_is_not_implemented_on_this_compiler
# endif
# if defined (__SSE__)
# define VLC_SSE
# elif VLC_GCC_VERSION(4, 4)
# define VLC_SSE __attribute__ ((__target__ ("sse")))
# else
# define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
# endif
For GCC 4.2.1 the macros will be defined to VLC_FOO_is_not_implemented_on_this_compiler since -mmmx and -msse are not used and thus __MMX__
or __SSE__
are not defined.