[FFmpeg-trac] #6049(avutil:new): ICC 14: identifier "ATOMIC_VAR_INIT" is undefined

FFmpeg trac at avcodec.org
Wed Dec 28 02:30:26 EET 2016

#6049: ICC 14: identifier "ATOMIC_VAR_INIT" is undefined
             Reporter:  barsnick     |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avutil       |                  Version:  git-
             Keywords:  icc atomics  |  master
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
 Summary of the bug:
 ffmpeg fails to compile with ICC14, due to missing definition of

 How to reproduce:
 Configure ffmpeg with ICC-14.0.3. Compile

 barsnick at sunshine:/usr/new/tools/video/ffmpeg > (cd ffmpeg-
 build-2016-12-27/ && hilite make V=1)
 -DHAVE_AV_CONFIG_H -std=c99 -fomit-frame-pointer -pthread
 -I/usr/include/fribidi -I/usr/include/freetype2  -I/usr/include/freetype2
 -I/usr/kerberos/include  -I/usr/include/tesseract -I/usr/include/leptonica
 -I/usr/new/tools/video/install/x264/20160703/include  -D_REENTRANT
 -I/usr/include/SDL2  -g -Wdeclaration-after-statement -Wall -Wdisabled-
 optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-
 limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-
 prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-
 length -Wno-pointer-sign -Wno-unused-const-variable -O3 -fno-math-errno
 -fno-signed-zeros -w1
 -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203 -falign-
 stack=maintain-16-byte  -MMD -c -o libavutil/cpu.o libavutil/cpu.c
 libavutil/cpu.c(48): error: identifier "ATOMIC_VAR_INIT" is undefined
   static atomic_int cpu_flags = ATOMIC_VAR_INIT(-1);

 libavutil/cpu.c(48): error: function call is not allowed in a constant
   static atomic_int cpu_flags = ATOMIC_VAR_INIT(-1);

 compilation aborted for libavutil/cpu.c (code 2)
 make: *** [libavutil/cpu.o] Error 2
 barsnick at sunshine:/usr/new/tools/video/ffmpeg > icc --version
 icc (ICC) 14.0.3 20140422
 Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

 barsnick at sunshine:/usr/new/tools/video/ffmpeg >

 At quick glance, I believe this is because configuration with ICC passes
 the "stdatomic_h" test, but ICC fails to provide the said macro, which is
 assumed by ffmpeg to be present.

 check_builtin stdatomic_h stdatomic.h atomic_int foo; atomic_store(&foo,
 check_code ld stdatomic.h atomic_int foo; atomic_store(&foo, 0) cc
 check_ld cc
 BEGIN /tmp/ffconf.IcsNTRsq.c
     1   #include <stdatomic.h>
     2   int main(void) { atomic_int foo; atomic_store(&foo, 0); return 0;
 END /tmp/ffconf.IcsNTRsq.c
 -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c99 -fomit-frame-pointer
 -c -o /tmp/ffconf.R48HrWHU.o /tmp/ffconf.IcsNTRsq.c
 icc -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.9NysBQnz
 /tmp/ffconf.R48HrWHU.o -lrt

 The issue was probably exposed with the first actual use of
 ATOMIC_VAR_INIT with commit fed50c4304eecb352e29ce789cdb96ea84d6162f. I'm
 too lazy/sleepy to bisect, but it seems obvious to me.

 fate.ffmpeg.org seems to expose the same error, though I can only find one
 ICC build there, and don't know how to find older attempts.


Ticket URL: <https://trac.ffmpeg.org/ticket/6049>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list