Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#48938 closed defect (fixed)

ffmpeg build failure on 10.6

Reported by: chillin- Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: snowleopard haspatch Cc: ryandesign (Ryan Carsten Schmidt), jeremyhu (Jeremy Huddleston Sequoia), someuser12, ksee.zelgadis@…, Ionic (Mihai Moldovan)
Port: ffmpeg

Description

Last update, something isn't working. Snow still supported? There are over 500 lines of error messages, please see attached, thank you.

Attachments (6)

19.txt (8.9 MB) - added by chillin- 9 years ago.
ffmpeg build console log
main.log (3.5 MB) - added by chillin- 9 years ago.
port ffmpeg log file
ffmpeg2.8log.txt (3.4 MB) - added by fieldlab 9 years ago.
ffmpeg 2.8 build log on 10.6.8-fieldlab4
ffmpeg-2.8-yosemite-main.log (2.9 MB) - added by dbevans (David B. Evans) 9 years ago.
Successful Yosemite (10.10) build log
ffmpeg_error_main.log (72.1 KB) - added by alandir2@… 9 years ago.
New Snow Leopard log for failed build
ffmpeg.diff (1.2 KB) - added by Ionic (Mihai Moldovan) 9 years ago.
Fix compile error with Apple GCC on 10.6 and below. Disables -Werror=missing-prototypes compiler flag.

Change History (23)

Changed 9 years ago by chillin-

Attachment: 19.txt added

ffmpeg build console log

Changed 9 years ago by chillin-

Attachment: main.log added

port ffmpeg log file

comment:1 Changed 9 years ago by chillin-

_huge log files, this is the tail_

/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/emmintrin.h:1965: error: no previous prototype for ?_mm_set1_epi8?
common.mak:57: recipe for target 'ffmpeg_videotoolbox.o' failed
gmake: * [ffmpeg_videotoolbox.o] Error 1

gmake: * Waiting for unfinished jobs....
gmake: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/ffmpeg-2.8'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/ffmpeg-2.8" && /opt/local/bin/gmake -j2 -w all
Exit code: 2
Error: org.macports.build for port ffmpeg returned: command execution failed
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… jeremyhu@… added
Keywords: ffmpeg buildfailure 10.6 removed
Owner: changed from macports-tickets@… to devans@…

Snow Leopard is still supported to the extent that if something isn't working we will try to take a look at it if we can. But if the developers have made changes that make a software package require a newer version of OS X, then there's not much we can do about that. I don't know yet if that's the case here though or not.


The log shows that the first error is:

:info:build libavfilter/avf_showcqt.c:38:10: error: #include expects "FILENAME" or <FILENAME>

This type of error is repeated a few times.

Lines 36-39 of libavfilter/avf_showcqt.c are:

#if CONFIG_LIBFREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
#endif

This means that CONFIG_LIBFREETYPE is defined (as it should be), but that FT_FREETYPE_H (which should be defined in a file included by ft2build.h) is not defined. I think this happens because the compiler was invoked without specifying the directory where ft2build.h can be found (the argument -I/opt/local/include/freetype2 is missing) though I don't understand why we didn't get a "file not found" error. It might be because this is not a normal compiler invocation, but rather an invocation of the preprocessor.

This is a bug in ffmpeg (or else a bug in the gcc compiler exposed by ffmpeg's code, which ffmpeg should work around), reported with a proposed fix here (where it says that the clang compiler is not affected). This might not be a relevant error, since the build proceeds past it, but we should probably apply this patch.


The next error in the log is:

:info:build ffplay.c:3217:46: error: missing binary operator before token "("

Line 3217 of ffplay.c is:

#if defined(__APPLE__) && SDL_VERSION_ATLEAST(1, 2, 14)

This implies that SDL_VERSION_ATLEAST is not defined. It should have been defined in SDL_version.h which is included by SDL.h which is included by ffplay.c. The reason is the same as above: this is another preprocessor invocation, and they haven't included the path where the SDL headers are found. (-I/opt/local/include/SDL is missing). The above fix should fix this as well.


The next error, and possibly the real problem, begins hundreds of lines of similar errors:

:info:build In file included from /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/xmmintrin.h:40,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:29,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
:info:build                  from ffmpeg_videotoolbox.c:19:
:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mmintrin.h:67: error: no previous prototype for ‘_mm_empty’

We've had a report of that type of error with ffmpeg years ago in #36961 but it was closed without a resolution, and since that was only seen by two users and was with a now years-old version of ffmpeg that might not be relevant anymore.

We also had a report of that error with mesa in #46827. In both tickets, Jeremy suggested removing "-Werror=missing-prototypes" from the build system. We should try this.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 in reply to:  2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

We also had a report of that error with mesa in #46827. In both tickets, Jeremy suggested removing "-Werror=missing-prototypes" from the build system.

I found a report of this type of problem on the ffmpeg mailing list from four years ago. There, the problem file was libavfilter/vf_libopencv.c , and the suggestion was to conditionally undefine __GNUC_STDC_INLINE__ on OS X. The thread ends at some point with no indication that the patch was applied.

There was also a reference to the openradar 8026390 report of this problem.

I see that a similar strategy is already being used (unconditionally) in libavcodec/vda.h:

// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
// http://openradar.appspot.com/8026390
#undef __GNUC_STDC_INLINE__

Maybe that is what we should do here instead.

comment:4 Changed 9 years ago by someuser12

Cc: macosx12345@… added

Cc Me!

comment:5 Changed 9 years ago by ksee.zelgadis@…

Cc: ksee.zelgadis@… added

Cc Me!

comment:6 Changed 9 years ago by fieldlab

Yes, same here on 10.6.8. ffmpeg @2.7.2_0+gpl2+x11 builds just fine. 2.8 is very broken.

Changed 9 years ago by fieldlab

Attachment: ffmpeg2.8log.txt added

ffmpeg 2.8 build log on 10.6.8-fieldlab4

comment:7 in reply to:  2 Changed 9 years ago by dbevans (David B. Evans)

Replying to ryandesign@…:

Snow Leopard is still supported to the extent that if something isn't working we will try to take a look at it if we can. But if the developers have made changes that make a software package require a newer version of OS X, then there's not much we can do about that. I don't know yet if that's the case here though or not.

Ryan ---

Thanks for your help in spotting these build errors. As you know, I don't have a 10.6 machine available to test ffmpeg on this platform so I rely on help from those who do to fix this type of error. This is particularly true since we no longer have a working 10.6 buildbot.

So for this port, I have to take the position that problems that are specific to older platforms will not be addressed unless someone with the required hardware/software to reproduce the problem can post a specific fix/patch that does not effect the build on more recent platforms.

Since ffmpeg 2.8 builds correctly on at least 10.8 and newer, I have to question what the difference is between those platforms and 10.6. The most obvious difference is, of course, the compiler so I wonder if using a newer version of clang on 10.6 might fix these problems without the need for the various patches that you propose below. Is this feasible and if so have you tried it?

See my comments below on the specific failures.


The log shows that the first error is:

:info:build libavfilter/avf_showcqt.c:38:10: error: #include expects "FILENAME" or <FILENAME>

This type of error is repeated a few times.

Lines 36-39 of libavfilter/avf_showcqt.c are:

#if CONFIG_LIBFREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
#endif

This means that CONFIG_LIBFREETYPE is defined (as it should be), but that FT_FREETYPE_H (which should be defined in a file included by ft2build.h) is not defined. I think this happens because the compiler was invoked without specifying the directory where ft2build.h can be found (the argument -I/opt/local/include/freetype2 is missing) though I don't understand why we didn't get a "file not found" error. It might be because this is not a normal compiler invocation, but rather an invocation of the preprocessor.

This is a bug in ffmpeg (or else a bug in the gcc compiler exposed by ffmpeg's code, which ffmpeg should work around), reported with a proposed fix here (where it says that the clang compiler is not affected). This might not be a relevant error, since the build proceeds past it, but we should probably apply this patch.

-----

Comparing the 10.6 build log with the successful one on 10.10 (attached) shows that the build command for this module does, in fact, include -I/opt/local/include/freetype2 as one would expect. The implication that the problem here is with the configuration system possibly compiler related.


The next error in the log is:

:info:build ffplay.c:3217:46: error: missing binary operator before token "("

Line 3217 of ffplay.c is:

#if defined(__APPLE__) && SDL_VERSION_ATLEAST(1, 2, 14)

This implies that SDL_VERSION_ATLEAST is not defined. It should have been defined in SDL_version.h which is included by SDL.h which is included by ffplay.c. The reason is the same as above: this is another preprocessor invocation, and they haven't included the path where the SDL headers are found. (-I/opt/local/include/SDL is missing). The above fix should fix this as well.

Again the 10.10 build log uses -I/opt/local/include/SDL in the build command so as you say this seems to be similar to the previous problem. Why isn't this term included on 10.6?


The next error, and possibly the real problem, begins hundreds of lines of similar errors:

:info:build In file included from /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/xmmintrin.h:40,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:29,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20,
:info:build                  from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
:info:build                  from /:19:
:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mmintrin.h:67: error: no previous prototype for ‘_mm_empty’

We've had a report of that type of error with ffmpeg years ago in #36961 but it was closed without a resolution, and since that was only seen by two users and was with a now years-old version of ffmpeg that might not be relevant anymore.

We also had a report of that error with mesa in #46827. In both tickets, Jeremy suggested removing "-Werror=missing-prototypes" from the build system. We should try this.

Possibly but it builds fine with clang on 10.8+. Looks to be due to a 10.6 gcc C library problem.

At any rate, would appreciate it if you could try building with MacPorts clang and see if that works. If not we need to explore this further and come up with a specific fix with a minimum of patches that works on 10.6 without breaking the build on more recent platforms. As usual any fixes that appear to address errors in ffmpeg itself should be forwarded upstrem to the ffmpeg developers.

Thanks again for your help on these older platforms.

Changed 9 years ago by dbevans (David B. Evans)

Successful Yosemite (10.10) build log

comment:8 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

I would strongly suspect that using some version of clang would work around these problems, but if we can fix the build with gcc, I'd prefer that. I'll look into it on my 10.6 system.

comment:9 Changed 9 years ago by alandir2@…

I've been experiencing a build problem on Snow Leopard starting at about the same time, but my build failure seems to be a bit different as what's been described so far. I'm attaching my log, but the key lines appear to be:

:info:build                  from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
:info:build                  from ffmpeg_videotoolbox.c:19:
:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mmintrin.h:67: error: no previous prototype for ‘_mm_empty’
:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mmintrin.h:75: error: no previous prototype for ‘_m_empty’
:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mmintrin.h:84: error: no previous prototype for ‘_mm_cvtsi32_si64’
:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mmintrin.h:92: error: no previous prototype for ‘_m_from_int’

... and so on ...

I haven't had a chance to follow up on this, so I don't know if my environment is picking up a wrong "mmintrin.h" or what, but at least this should provide another data point into what might be going on ...

Changed 9 years ago by alandir2@…

Attachment: ffmpeg_error_main.log added

New Snow Leopard log for failed build

comment:10 Changed 9 years ago by Ionic (Mihai Moldovan)

I can confirm that disabling -Werror=missing-prototypes fixes the compile issues on OS X 10.6. No other changes needed.

I will upload a patch either late today or during the upcoming days. It will only target ffmpeg, so you'll probably have to backport it to ffmpeg-devel, but I don't feel like test-building this port in a slow-as-hell VM on an overcommitted-as-is machine...

comment:11 Changed 9 years ago by Ionic (Mihai Moldovan)

Cc: ionic@… added

Changed 9 years ago by Ionic (Mihai Moldovan)

Attachment: ffmpeg.diff added

Fix compile error with Apple GCC on 10.6 and below. Disables -Werror=missing-prototypes compiler flag.

comment:12 Changed 9 years ago by Ionic (Mihai Moldovan)

Patch attached. Please make sure to backport it to ffmpeg-devel. The Portfile part should be applicable as-is, but the patch will probably need a refresh against the newer configure script to adapt to its line numbers.

comment:13 Changed 9 years ago by Ionic (Mihai Moldovan)

Keywords: haspatch added

comment:14 Changed 9 years ago by Ionic (Mihai Moldovan)

I'll apply this myself now...

comment:15 Changed 9 years ago by Ionic (Mihai Moldovan)

Resolution: fixed
Status: newclosed

Committed for ffmpeg in r140825, for ffmpeg-devel in r140826.

comment:16 Changed 9 years ago by fieldlab

Fixed! many thanks to all....

comment:17 Changed 9 years ago by chillin-

Thanks so very much for fixing the broken, my warmest gratitude. I can't believe you people; you're incredible, muchas gracias!

Note: See TracTickets for help on using tickets.