Ticket #1736 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

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

Reported by: jeremyhu 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

patchvda.diff Download (387 bytes) - added by cehoyos 8 months ago.

Change History

Changed 8 months ago by cehoyos

comment:1 Changed 8 months ago by cehoyos

  • Keywords osx regression added
  • Priority changed from normal to important
  • Status changed from new to open
  • Component changed from undetermined to avcodec
  • Version changed from unspecified to git-master

Could you test attached patch?

comment:2 Changed 8 months ago by pablosanta

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 Changed 8 months ago by cehoyos

  • Keywords vda added
  • Status changed from open to closed
  • Resolution set to fixed

Should be fixed, thank you for testing!

comment:4 follow-up: ↓ 5 Changed 8 months ago by jeremyhu

This still has not landed on master (currently e80cbdbc57292a4687339f6a7d30e0dcff42f9e8)

comment:5 in reply to: ↑ 4 Changed 8 months ago by cehoyos

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 Changed 7 months ago by perime33

  • Status changed from closed to reopened
  • Resolution fixed deleted

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 Changed 7 months ago by cehoyos

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 Changed 7 months ago by cehoyos

  • Status changed from reopened to closed
  • Resolution set to fixed

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.