Opened 12 years ago

Closed 11 years ago

#1736 closed defect (fixed)

ffmpeg fails to build on Snow Leopard due to please_use_av_malloc macro polluting system headers

Reported by: Jeremy Huddleston Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: osx regression vda
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

This issue is occuring on Snow Leopard with Apple's gcc-4.2 and possibly llvm-gcc-4.2 compilers. The build fails with:

132	:info:build In file included from /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/xmmintrin.h:45,
133	:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:29,
134	:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32,
135	:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125,
136	:info:build                  from /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20,
137	:info:build                  from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
138	:info:build                  from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:20,
139	:info:build                  from /System/Library/Frameworks/CoreVideo.framework/Headers/CVDisplayLink.h:24,
140	:info:build                  from /System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:24,
141	:info:build                  from /System/Library/Frameworks/VideoDecodeAcceleration.framework/Headers/VDADecoder.h:12,
142	:info:build                  from libavcodec/vda.h:45,
143	:info:build                  from libavcodec/vda_h264.c:29:
144	:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mm_malloc.h: In function '_mm_malloc':
145	:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mm_malloc.h:56: error: implicit declaration of function 'please_use_av_malloc'
146	:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mm_malloc.h: In function '_mm_free':
147	:info:build /usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mm_malloc.h:74: error: implicit declaration of function 'please_use_av_free'

mm_malloc.h provides static inline functions like:

static __inline__ void
_mm_free (void * aligned_ptr)
{
  if (aligned_ptr)
    free (((void **) aligned_ptr) [-1]);
}

which get tripped up over free being defined to please_use_av_free.

This has been reported to MacPorts as https://trac.macports.org/ticket/36142 ... the issue was introduced some time between July 18's git master (56ae5926f739bd26a5aa4add98604b7cd3c2d6ca) and September 12 (2de88776892093b10522152f1f72b7dfc0320502).

Attachments (1)

patchvda.diff (387 bytes ) - added by Carl Eugen Hoyos 12 years ago.

Download all attachments as: .zip

Change History (9)

by Carl Eugen Hoyos, 12 years ago

Attachment: patchvda.diff added

comment:1 by Carl Eugen Hoyos, 12 years ago

Component: undeterminedavcodec
Keywords: osx regression added
Priority: normalimportant
Status: newopen
Version: unspecifiedgit-master

Could you test attached patch?

comment:2 by Pablo Santamarina, 12 years ago

In my case, the package mplayer-devel from MacPorts was not compiling due to this bug.
I applied the patch to the file in the directory created by MacPorts during compilation and was able to compile mplayer and it works.
Tested the patch on Snow Leopard (10.6.8) with gcc version 4.2.1 (XCode 3.2.6).

comment:3 by Carl Eugen Hoyos, 12 years ago

Keywords: vda added
Resolution: fixed
Status: openclosed

Should be fixed, thank you for testing!

comment:4 by Jeremy Huddleston, 12 years ago

This still has not landed on master (currently e80cbdbc57292a4687339f6a7d30e0dcff42f9e8)

in reply to:  4 comment:5 by Carl Eugen Hoyos, 12 years ago

Replying to jeremyhu:

This still has not landed on master (currently e80cbdbc57292a4687339f6a7d30e0dcff42f9e8)

This version is from yesterday afternoon, there have been ~eleven commits since, one of them changes the include order for vda_h264.c and should fix this issue.

comment:6 by perime33, 11 years ago

Resolution: fixed
Status: closedreopened

The issue is not fixed.

mplayer still fails to build on Snow Leopard, with error messages:

/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mm_malloc.h:56: error: implicit declaration of function 'please_use_av_malloc'
(...)
/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/mm_malloc.h:74: error: implicit declaration of function 'please_use_av_free'
(...)
make[1]: * [libavcodec/vda_h264.o] Error 1

Problem when trying to compile the latest mplayer package downloaded October 14th 2012 from svn://svn.mplayerhq.hu/mplayer/trunk, on Mac OS X Version 10.6.8.

Compiler version:
/usr/bin/gcc-4.2 --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)

comment:7 by Carl Eugen Hoyos, 11 years ago

Do you see only a problem when compiling MPlayer? If yes, please report to mplayer-users.
Or is the problem also reproducible when compiling FFmpeg? If yes, please run make, run make again (you should see the same compilation error twice), then run 'make V=1' and post the complete, uncut console output of this last run. (Please do not post the complete, uncut console output of the first make run.)

comment:8 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: reopenedclosed

A patch was committed to git head that is supposed to fix this problem, please reopen if you can provide the missing information and the build problem is still reproducible.

Note: See TracTickets for help on using tickets.