Opened 3 years ago

Closed 3 years ago

#5979 closed defect (notvlc)

VLC 2.0.0rc1 fails to build with GCC 4.2.1 on i386

Reported by: brad0 Owned by:
Priority: normal Milestone: 2.0.x maintenance bugs
Component: Core Version: Other
Severity: major Keywords:
Cc: Difficulty: unknown
Platform(s): all Work status: Not started


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.

Change History (3)

comment:1 Changed 3 years ago by courmisch

  • Owner courmisch deleted

I do not see any solutions to this problem other than upgrading the compiler or using another one that supports per function target.

As far as the core is concerned, feature detection could be redone in more platform-specific ways to avoid running code. But that would be too disruptive for the 2.0 branch in my opinion. In any case, the problem would still affect the plugins which use VLC_SSE and/or VLC_MMX.

comment:2 Changed 3 years ago by jb

  • Milestone changed from 2.0.0 bugs to 2.0.x maintenance bugs

I'm sorry, but this is not a 2.0.0 blocker. Especially with no patches...

comment:3 Changed 3 years ago by courmisch

  • Resolution set to notvlc
  • Status changed from new to closed

Support for target attribute is mandatory for x86 optimizations. That means GCC 4.4 minimum.

If you really want to use an older compiler, disable optimizations and get your slow VLC.

Note: See TracTickets for help on using tickets.