Open
Bug 1511263
Opened 7 years ago
Updated 1 year ago
dav1d fails to build
Categories
(Core :: Audio/Video: Playback, defect, P3)
Core
Audio/Video: Playback
Tracking
()
NEW
People
(Reporter: pbone, Unassigned)
References
Details
Attachments
(1 file)
|
63.55 KB,
application/json
|
Details |
I am using clang 6 on Linux amd64 with icecc.
1:16.96 In file included from /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:36:
1:16.96 In file included from /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.h:34:
1:16.96 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/ref.h:39:5: error: unknown type name 'atomic_int'
1:16.96 atomic_int ref_cnt;
1:16.96 ^
1:16.96 In file included from /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:36:
1:16.96 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.h:131:5: error: unknown type name 'atomic_uint'
1:16.96 atomic_uint *progress;
1:16.96 ^
1:16.96 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:4218:54: error: use of undeclared identifier 'atomic_uint'
1:16.97 (t != NULL) * sizeof(atomic_uint));
1:16.97 ^
1:16.97 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:4221:39: error: expected expression
1:16.97 cdf->progress = (atomic_uint *) &cdf->cdf[1];
1:16.97 ^
1:16.97 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:4221:26: error: use of undeclared identifier 'atomic_uint'
1:16.97 cdf->progress = (atomic_uint *) &cdf->cdf[1];
1:16.97 ^
1:16.97 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:4222:9: warning: implicit declaration of function 'atomic_init' is invalid in C99 [-Wimplicit-function-declaration]
1:16.97 atomic_init(cdf->progress, 0);
1:16.98 ^
1:16.98 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:4242:9: warning: implicit declaration of function 'atomic_load' is invalid in C99 [-Wimplicit-function-declaration]
1:16.98 if (atomic_load(cdf->progress)) return;
1:16.99 ^
1:16.99 /home/paul/dev/moz/dont-poison/third_party/dav1d/src/cdf.c:4253:5: warning: implicit declaration of function 'atomic_store' is invalid in C99 [-Wimplicit-function-declaration]
1:16.99 atomic_store(cdf->progress, 1);
1:16.99 ^
1:16.99 3 warnings and 5 errors generated.
When I take my desktop out of icecc it works. I thought this was because icecc was calling "clang" and not "clang-6" but removing every other version of clang didn't help.
| Reporter | ||
Comment 1•7 years ago
|
||
NI for myself to check that I can build dav1d out-of-tree.
This could still be something to do with my configuration, I don't know what.
Component: JavaScript: GC → Audio/Video: Playback
Flags: needinfo?(pbone)
Comment 2•7 years ago
|
||
This happens to me with Clang 6.0.1 on macOS, and I believe :mrbkap asked about it as well.
Comment 3•7 years ago
|
||
I worked around this locally by adding `ac_add_options --disable-av1` to my mozconfig.
Comment 4•7 years ago
|
||
Can you please try building with the following patch on:
https://hg.mozilla.org/try/rev/dd127becb6b048d78f9e5c3927fd690998fcbf5f
Updated•7 years ago
|
Rank: 19
Priority: -- → P2
Comment 5•7 years ago
|
||
This looks like your headers are mixed up - e.g. you're using a new clang, but old (system) stdatomic.h.
Comment 6•7 years ago
|
||
Bug 1510786 landed in m-c and it might fix this issue as well. Can you please check if your build is restored. Please don't disable av1 build, help us to find the problem instead.
Comment 7•7 years ago
|
||
From mrbkap in IRC
config.h
---------
/*
* Autogenerated by the Meson build system.
* Do not edit, your changes will be lost.
*/
#pragma once
#define ARCH_AARCH64 0
#define ARCH_ARM 0
#define ARCH_X86 1
#define ARCH_X86_32 0
#define ARCH_X86_64 1
#define CONFIG_16BPC 1
#define CONFIG_8BPC 1
#define HAVE_ASM 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_UNISTD_H 1
#define STACK_ALIGNMENT 32
config.asm
----------
; Autogenerated by the Meson build system.
; Do not edit, your changes will be lost.
%define ARCH_X86_32 0
%define ARCH_X86_64 1
%define PIC 1
%define STACK_ALIGNMENT 32
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
A local build without icecc compiles fine, so this seems certainly related to icecc. Maybe it isn't properly packaging stdatomic.h?
Comment 10•7 years ago
|
||
From IRC mrbkap's system is Linux x64.
Thank you for looking further at this. I am comparing the config files and I cannot see something obvious so it' must be a icecc bug. I found this bug on RedHat [1]. It seems they haven't done much about it apparently. Also, [2] is a similar bug for osx. libdav1d has compat stdatomic.h only for gcc and msvc.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1222786
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1412240
Comment 11•7 years ago
|
||
I think we can use the gcc stdatomic.h for clang as well. But we would need to detect icecc somehow.
| Reporter | ||
Comment 12•7 years ago
|
||
I've been testing dav1d out of tree. I found that:
~/.local/bin/meson build --buildtype release
Is the same as:
CC="ccache cc" ~/.local/bin/meson build --buildtype release
For some reason that's what meson is deciding to use for the C compiler. Which should be fine, cc uses Debian's alternatvie system to point to clang 6.0, and I do have ccache set up. But it fails to find stdatomic.h. Because the compiler doesn't ounderstand its arguments as called by icecc.
CC="clang"
and
CC="ccache clang"
Both work, likewise CC="ccache cc" works if icecc is disabled. Therefore for dav1d out-of-tree I think the problem is that icecc is calling some other C compiler (or clang is failing when called as cc).
In the Firefox tree I'm not sure, but I wanted to report this so that someone here might know how we compile dav1d.
Flags: needinfo?(pbone)
Comment 13•7 years ago
|
||
I had this problem with icecc on Mac (local builds were fine). After building and packaging Clang 7.0.0 myself it seems to be solved.
Updated•3 years ago
|
Severity: normal → S3
Updated•1 year ago
|
Priority: P2 → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•