FFmpeg build error on Mac?

120 views
Skip to first unread message

Sungguk Lim(limasdf)

unread,
Mar 22, 2017, 7:42:00 AM3/22/17
to Chromium-dev
Hi guys.

After git pull & gclient sync, I met below error. 
The warning message says that I need macOS Version >= 10.12, But interestingly I already use 10.12.3.

And it seems like FFmpeg branch merge is done very recently. Presumably something goes wrong with it?

> ninja -C out/Debug chrome
ninja: Entering directory `out/Debug'
[3385/17888] CC obj/third_party/ffmpeg/ffmpeg_internal/time.o
FAILED: obj/third_party/ffmpeg/ffmpeg_internal/time.o
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/ffmpeg/ffmpeg_internal/time.o.d -DHAVE_AV_CONFIG_H -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DFF_API_CONVERGENCE_DURATION=0 -D_DARWIN_C_SOURCE -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=\"296321-1\" -DCR_XCODE_VERSION=0821 -DCOMPONENT_BUILD -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -I../../third_party/ffmpeg/chromium/config/Chromium/mac/x64 -I../../third_party/ffmpeg -I../.. -Igen -I../../third_party/opus/src/include -fPIC -fomit-frame-pointer -Wno-deprecated-declarations -fno-strict-aliasing -fstack-protector-strong -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -fcolor-diagnostics -arch x86_64 -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.9 -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-auto-raw-pointer -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wpartial-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-incompatible-pointer-types -Wno-absolute-value -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-logical-op-parentheses -Wno-parentheses -Wno-pointer-sign -Wno-switch -Wno-unused-label -Wno-unused-variable -Wno-string-conversion -Wno-sometimes-uninitialized -Wno-unused-function -Wno-constant-conversion -O2 -fvisibility=default -std=c99 -c ../../third_party/ffmpeg/libavutil/time.c -o obj/third_party/ffmpeg/ffmpeg_internal/time.o
../../third_party/ffmpeg/libavutil/time.c:60:9: error: 'clock_gettime' is only available on macOS 10.12 or newer [-Werror,-Wunguarded-availability]
    if (clock_gettime)
        ^~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note: 'clock_gettime' has been explicitly marked partial here
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
    ^
../../third_party/ffmpeg/libavutil/time.c:60:9: note: enclose 'clock_gettime' in an @available check to silence this warning
    if (clock_gettime)
        ^~~~~~~~~~~~~
../../third_party/ffmpeg/libavutil/time.c:64:9: error: 'clock_gettime' is only available on macOS 10.12 or newer [-Werror,-Wunguarded-availability]
        clock_gettime(CLOCK_MONOTONIC, &ts);
        ^~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note: 'clock_gettime' has been explicitly marked partial here
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
    ^
../../third_party/ffmpeg/libavutil/time.c:64:9: note: enclose 'clock_gettime' in an @available check to silence this warning
        clock_gettime(CLOCK_MONOTONIC, &ts);
        ^~~~~~~~~~~~~
../../third_party/ffmpeg/libavutil/time.c:75:10: error: 'clock_gettime' is only available on macOS 10.12 or newer [-Werror,-Wunguarded-availability]
    if (!clock_gettime)
         ^~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note: 'clock_gettime' has been explicitly marked partial here
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
    ^
../../third_party/ffmpeg/libavutil/time.c:75:10: note: enclose 'clock_gettime' in an @available check to silence this warning
    if (!clock_gettime)
         ^~~~~~~~~~~~~
3 errors generated.
[3394/17888] CXX obj/gpu/ipc/common/interfaces_blink/mailbox.mojom-blink.o
ninja: build stopped: subcommand failed.
# LIMSUNGs-MacBook-Pro ~/program_store/chromium/src (master)
> sw_vers -productVersion
10.12.3
# LIMSUNGs-MacBook-Pro ~/program_store/chromium/src (master)
> git rev-parse HEAD
4e2b55c5fa7a354b3ae2f14e2f6d8201190a36a0
# LIMSUNGs-MacBook-Pro ~/program_store/chromium/src (master)
> cd third_party/ffmpeg/
# LIMSUNGs-MacBook-Pro ~/program_store/chromium/src/third_party/ffmpeg ((b9acb5c...))
> git rev-parse HEAD
b9acb5c51eea352657323b33737fee503e42604a

Thomas Guilbert

unread,
Mar 22, 2017, 1:16:16 PM3/22/17
to lim...@gmail.com, Chromium-dev
I am in charge of the M59 FFmpeg roll, and I updates the DEPS yesterday. I am looking into this and will report back.

Is anyone else also experiencing these issues?

Thanks,
Thomas

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/36de3bac-0851-489c-a787-6ba04f18a7a4%40chromium.org.

Nico Weber

unread,
Mar 22, 2017, 2:55:45 PM3/22/17
to tgui...@chromium.org, Sungguk Lim, Chromium-dev
I'm guessing this happens with the 10.12 SDK. (Bots and some devs are pinned to a different SDK.)

The simplest fix is to add -Wno-unguarded-availability to ffmpeg's BUILD.gn here: https://cs.chromium.org/chromium/src/third_party/ffmpeg/BUILD.gn?q=ffmpeg/build.gn+package:%5Echromium$&dr&l=95 Can you give that a shot?

Sungguk Lim

unread,
Mar 22, 2017, 3:02:49 PM3/22/17
to Nico Weber, Thomas Guilbert, Chromium-dev
Hi Nico,

Your suggestion works.

> ninja -C out/Debug media_unittests
ninja: Entering directory `out/Debug'
[1/1] Regenerating ninja files
[179/179] LINK ./media_unittests
# LIMSUNGs-MacBook-Pro ~/program_store/chromium/src/third_party/ffmpeg ((b9acb5c...))
> gd
diff --git a/BUILD.gn b/BUILD.gn
index a143fb5..871c634 100755
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -95,6 +95,8 @@ if (is_win) {
 config("ffmpegsumo_warnings") {
   if (is_clang) {
     cflags = [
+      "-Wno-unguarded-availability",
+
       "-Wno-absolute-value",

       # ffmpeg uses its own deprecated functions.
# LIMSUNGs-MacBook-Pro ~/program_store/chromium/src/third_party/ffmpeg ((b9acb5c...))
> git rev-parse HEAD
b9acb5c51eea352657323b33737fee503e42604a

Nico Weber

unread,
Mar 22, 2017, 3:03:23 PM3/22/17
to Sungguk Lim, Thomas Guilbert, Chromium-dev
Thomas, can you get this change checked in?
Reply all
Reply to author
Forward
0 new messages