[FFmpeg-trac] #9275(avformat:new): Missing -latomic for arches without GCC builtins atomic
FFmpeg
trac at avcodec.org
Thu Jun 3 09:53:27 EEST 2021
#9275: Missing -latomic for arches without GCC builtins atomic
----------------------------------+---------------------------------------
Reporter: marillat | Type: defect
Status: new | Priority: normal
Component: avformat | Version: unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+---------------------------------------
atomic support has been added in libavformat/fifo.c since 4.4 but GCC
doesn't support atomic builtin for all architecture and fallback to link
with libatomic.
The problem is that ffmpeg assume that all architectures are using GCC
builtins and the build fail with 'undefined reference to' errors.
The solution is to link libavformat with libatomic.
Here is the GCC documentation about atomic
https://gcc.gnu.org/wiki/Atomic
Under Debian unstable I see two architectures who uses libatomic armel and
powerpc. Here is the output for the powerpc build.
{{{
/usr/bin/ld: libavformat/fifo.o: in function `fifo_init':
./libavformat/fifo.c:519: undefined reference to `__atomic_store_8'
/usr/bin/ld: libavformat/fifo.o: in function `fifo_write_trailer':
./libavformat/fifo.c:624: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: ./libavformat/fifo.c:631: undefined reference to
`__atomic_store_8'
/usr/bin/ld: libavformat/fifo.o: in function `fifo_thread_write_packet':
./libavformat/fifo.c:188: undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: libavformat/fifo.o: in function `fifo_consumer_thread':
./libavformat/fifo.c:457: undefined reference to `__atomic_load_8'
/usr/bin/ld: libavformat/fifo.o: in function `fifo_write_packet':
./libavformat/fifo.c:597: undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9275>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list