Opened 4 years ago

Last modified 3 years ago

#2168 open defect

Doesn't build for sparc arch

Reported by: marillat@… Owned by: reimar
Priority: normal Component: build system
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description (last modified by reimar)

The latest svn (36541) doesn't build for sparc - Debian unstable gcc/g++ 4.6.4 and also with gcc/g++ 4.8.2

I'm able to build ffmpeg 2.1.1 in the same environment. I don't understand what is wrong.

ffmpeg/libavcodec/libavcodec.a(utils.o): In function `default_lockmgr_cb':
utils.c:(.text+0x7bc): undefined reference to `sync_val_compare_and_swap_4'
utils.c:(.text+0x84c): undefined reference to `
ffmpeg/libavcodec/libavcodec.a(utils.o): In function `av_register_hwaccel':
utils.c:(.text+0x7024): undefined reference to `sync_val_compare_and_swap_4'
ffmpeg/libavcodec/libavcodec.a(utils.o): In function `avcodec_register':
utils.c:(.text.unlikely+0xc0): undefined reference to `
ffmpeg/libavformat/libavformat.a(format.o): In function `av_register_input_format':
format.c:(.text+0x74): undefined reference to `sync_val_compare_and_swap_4'
ffmpeg/libavformat/libavformat.a(format.o):format.c:(.text+0xd8): more undefined references to `
sync_val_compare_and_swap_4' follow
ffmpeg/libavutil/libavutil.a(buffer.o): In function `pool_release_buffer':
buffer.c:(.text+0x1bc): undefined reference to `sync_add_and_fetch_4'
ffmpeg/libavutil/libavutil.a(buffer.o): In function `av_buffer_ref':
buffer.c:(.text+0x370): undefined reference to `
ffmpeg/libavutil/libavutil.a(buffer.o): In function `av_buffer_unref':
buffer.c:(.text+0x3b4): undefined reference to `sync_add_and_fetch_4'
ffmpeg/libavutil/libavutil.a(buffer.o): In function `av_buffer_make_writable':
buffer.c:(.text+0x4c8): undefined reference to `
ffmpeg/libavutil/libavutil.a(buffer.o): In function `av_buffer_realloc':
buffer.c:(.text+0x5d8): undefined reference to `sync_add_and_fetch_4'
ffmpeg/libavutil/libavutil.a(buffer.o):buffer.c:(.text+0x76c): more undefined references to `
sync_add_and_fetch_4' follow
ffmpeg/libavutil/libavutil.a(buffer.o): In function `av_buffer_pool_get':
buffer.c:(.text+0x814): undefined reference to `sync_val_compare_and_swap_4'
buffer.c:(.text+0x8a0): undefined reference to `
buffer.c:(.text+0x8ac): undefined reference to `sync_add_and_fetch_4'
buffer.c:(.text+0x908): undefined reference to `
buffer.c:(.text+0x968): undefined reference to `sync_val_compare_and_swap_4'
buffer.c:(.text+0x9a8): undefined reference to `
buffer.c:(.text+0x9e8): undefined reference to `sync_val_compare_and_swap_4'
buffer.c:(.text+0xa24): undefined reference to `
buffer.c:(.text+0xa64): undefined reference to `sync_val_compare_and_swap_4'
buffer.c:(.text+0xaa4): undefined reference to `
buffer.c:(.text+0xb04): undefined reference to `sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[1]: * [mplayer] Error 1

Change History (5)

comment:1 Changed 3 years ago by reimar

  • Analyzed by developer unset
  • Description modified (diff)
  • Reproduced by developer unset

This is related to threading support.
MPlayer currently assumes that atomic instructions are available:


If there are architectures where they do not exist, we need to implement a proper check.
As a temporary workaround you can set these to 0 in config.h. But you might then have to completely disable threading support, too.

comment:2 Changed 3 years ago by reimar

However, one thing is strange, these atomics should be available.
Could you try "./configure --extra-ldflags=-lgcc_s" ?

comment:3 Changed 3 years ago by marillat@…

Still the same with "./configure --extra-ldflags=-lgcc_s"

comment:4 Changed 3 years ago by reimar

"./configure --disable-pthreads" is another possible workaround.
However none of that changes that as far as I can tell SPARC gcc should support these functions, so I am a bit unclear on what causes it.
I suspect FFmpeg will just disable atomics, but I am not sure that is the right thing to do...

comment:5 Changed 3 years ago by reimar

  • Owner changed from diego@… to reimar
  • Status changed from new to open
Note: See TracTickets for help on using tickets.