Opened 12 years ago

Closed 10 years ago

#20938 closed defect (fixed)

ffmpeg/ffmpeg-devel fails to build on 10.6

Reported by: gonhidi@… Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: snow-leopard Cc: dave@…, mnick@…, gseanmcg@…, motya@…, macports@…, fran6co@…, daitakahashi, ryandesign (Ryan Schmidt)
Port: ffmpeg ffmpeg-devel

Description

--->  Fetching ffmpeg
--->  Attempting to fetch ffmpeg-0.5.tar.bz2 from http://arn.se.distfiles.macports.org/ffmpeg
--->  Verifying checksum(s) for ffmpeg
--->  Extracting ffmpeg
--->  Applying patches to ffmpeg
--->  Configuring ffmpeg
--->  Building ffmpeg
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" && gmake -j2 all " returned error 2
Command output: /usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno         -MM libavfilter/avfilter.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*avfilter\.o,libavfilter/avfilter.o," > libavfilter/avfilter.d
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno         -MM libavfilter/allfilters.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*allfilters\.o,libavfilter/allfilters.o," > libavfilter/allfilters.d
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5/version.sh "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" version.h 
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno         -MM ffserver.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*ffserver\.o,./ffserver.o," > ffserver.d
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno         -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -MM ffplay.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*ffplay\.o,./ffplay.o," > ffplay.d
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno         -MM ffmpeg.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*ffmpeg\.o,./ffmpeg.o," > ffmpeg.d
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno         -MM cmdutils.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*cmdutils\.o,./cmdutils.o," > cmdutils.d
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno          -c -o libavfilter/allfilters.o libavfilter/allfilters.c
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno          -c -o libavfilter/avfilter.o libavfilter/avfilter.c
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno          -c -o libavfilter/defaults.o libavfilter/defaults.c
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno          -c -o libavfilter/formats.o libavfilter/formats.c
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno          -c -o libswscale/rgb2rgb.o libswscale/rgb2rgb.c
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno          -c -o libswscale/swscale.o libswscale/swscale.c
In file included from libswscale/swscale.c:1041:
libswscale/swscale_template.c: In function 'yuv2yuv1_MMX2':
libswscale/swscale_template.c:962: warning: initialization from incompatible pointer type
libswscale/swscale_template.c:962: warning: initialization from incompatible pointer type
libswscale/swscale_template.c:962: warning: initialization from incompatible pointer type
libswscale/swscale_template.c: In function 'swScale_MMX2':
libswscale/swscale_template.c:2897: warning: cast from pointer to integer of different size
libswscale/swscale_template.c:2905: warning: cast from pointer to integer of different size
libswscale/swscale.c: In function 'sws_getCachedContext':
libswscale/swscale.c:3178: warning: assignment discards qualifiers from pointer target type
libswscale/rgb2rgb_template.c: In function 'rgb32tobgr24_MMX':
libswscale/rgb2rgb_template.c:148: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
libswscale/rgb2rgb_template.c:148: error: 'asm' operand has impossible constraints
{standard input}:2321:non-relocatable subtraction expression, "_mask32a" minus "L00000000001$pb"
{standard input}:2321:symbol: "_mask32a" can't be undefined in a subtraction expression
gmake: *** [libswscale/rgb2rgb.o] Error 1
gmake: *** Waiting for unfinished jobs....

Attachments (15)

errlog.txt.gz (22.7 KB) - added by gonhidi@… 12 years ago.
Complete (debug-enabled) build output gzipped
ffmpeg-0.5_3-build-err.txt (591.4 KB) - added by gonhidi@… 12 years ago.
sudo port clean ffmpeg && sudo port -d build ffmpeg
patch-ffmpeg.diff (566 bytes) - added by dbevans (David B. Evans) 12 years ago.
proposed patch for Portfile
patch-ffmpeg.2.diff (665 bytes) - added by dbevans (David B. Evans) 12 years ago.
Revised patch for Portfile
ffmpeg-0.5_3+nogpl-errlog.txt.gz (31.2 KB) - added by gonhidi@… 12 years ago.
sudo port clean ffmpeg && sudo port -d build ffmpeg +no_gpl
ffmpeg-devel-19723-errlog.txt.gz (31.7 KB) - added by gonhidi@… 12 years ago.
sudo port clean ffmpeg-devel && sudo port -d build ffmpeg-devel (devel version 19723)
ffmpeg-devel-enable-mmx-snow-leopard.diff (1.7 KB) - added by dave@… 12 years ago.
Patch to enable MMX on Snow Leopard.
patch-ffmpeg-devel.diff (1.1 KB) - added by dbevans (David B. Evans) 12 years ago.
Proposed SL 64 bit patch for ffmpeg-devel
ffmpeg-mmx-sl-portfile.diff (1.5 KB) - added by dave@… 12 years ago.
Patch to enable MMX on Snow Leopard on the ffmpeg 0.5 port.
patch-ffmpeg-configure.diff (782 bytes) - added by dave@… 12 years ago.
Patch to ffmpeg 0.5’s configure script to enable detection of newer versions of libx264.
ffmpeg-portfile-i386-no-mmx.diff (1.0 KB) - added by dave@… 12 years ago.
ffmpeg portfile that disables mmx only on i386
ffmpeg-devel-portfile-i386-no-mmx.diff (1.2 KB) - added by dave@… 12 years ago.
ffmpeg-devel portfile that disables mmx only on i386
patch-ffmpeg-i386-gcc-4.0.diff (857 bytes) - added by dbevans (David B. Evans) 12 years ago.
Patch to use gcc-4.0 on snow leopard i386 (32 bit)
patch-ffmpeg-i386-gpl.diff (467 bytes) - added by bmishkin@… 12 years ago.
proposed patch for i386 + gpl_libs
h264dsp_mmx.c (94.7 KB) - added by macports@… 10 years ago.
h264dsp_mmx.c with hacks to make compile under 32 bit Apple gcc

Download all attachments as: .zip

Change History (54)

Changed 12 years ago by gonhidi@…

Attachment: errlog.txt.gz added

Complete (debug-enabled) build output gzipped

comment:1 Changed 12 years ago by dbevans (David B. Evans)

Owner: changed from macports-tickets@… to devans@…
Status: newassigned

Need more details -- please post the output of the following commands

sudo port clean ffmpeg
sudo port -d build ffmpeg

Were you installing or upgrading?

Several others have reported success on 10.6 so need as many specific details as possible to understand the situation.

Thanks

comment:2 Changed 12 years ago by gonhidi@…

The problem showed up when installing ffmpeg as a dependency for gimp2 (IIRC). The system is a MacBook1,1, the first model (Mid-2006 I think) which came with an Intel Core Duo processor (non-64 bit unlike the Core 2).

The errlog.txt.gz attachment was the result of a clean debug-enabled install, but I add another uncompressed attachment with the output you demand.

Changed 12 years ago by gonhidi@…

Attachment: ffmpeg-0.5_3-build-err.txt added

sudo port clean ffmpeg && sudo port -d build ffmpeg

comment:3 Changed 12 years ago by dbevans (David B. Evans)

Sorry I didn't see the previous attachment. Looks like a problem with the MMX optimization code.

Will it install if you use the +no_mmx variant?

That may be your best work around for now

sudo port install ffmpeg +no_mmx

comment:4 Changed 12 years ago by gonhidi@…

The +no_mmx variant alone isn't enough to overcome the error, but combining it with the +no_gpl does the trick. The workaroud for my case is thus

sudo port install ffmpeg +no_mmx +no_gpl

with +speex as a valid option if desired.

comment:5 Changed 12 years ago by dbevans (David B. Evans)

I wonder if the +no_gpl by itself wouldn't work for you since it turns off swscale entirely which is where the problem occurs. This would test whether mmx is working in other parts of the code.

In addition, I wonder if you wouldn't mind trying trying to build ffmpeg-devel (which builds from recent ffmpeg svn trunk) to see if the problem remains or if a fix has already been applied there.

Sorry for asking so much but so far you're the only one who has seen this error. I appreciate your cooperation is tracking the scope of the problem.

comment:6 Changed 12 years ago by goodb0fh@…

I can confirm this bug on a 1st gen macbook pro/snowleopard. +no_gpl by itself doesn't work. Must include +no_mmx. ffmpeg-devel has the same issue when building without any options.

In fact, even the downloaded MPlayer OSX Extended.app breaks when playing avis or mp4s on this box.

comment:7 Changed 12 years ago by dbevans (David B. Evans)

I assume that when it breaks using just +no_gpl, it is somewhere else than swscale. Can you attach a debug listing for this variant of the error?

Also to more precisely understand which hardware is in use please report the information from

Apple Menu -> About This Mac -> More Info -> Hardware Overview

Thanks

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

Attachment: patch-ffmpeg.diff added

proposed patch for Portfile

comment:8 Changed 12 years ago by dbevans (David B. Evans)

attached is a patch for the ffmpeg Portfile. Let me know if this allows you guys to build without variants. This disables just swscale and the mmx stuff but keeps the other features that would otherwise be disabled by no_gpl (postproc, libfaad, libx264, libxvid).

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

Attachment: patch-ffmpeg.2.diff added

Revised patch for Portfile

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

Revised patch attached -- use this instead.

comment:10 Changed 12 years ago by gonhidi@…

I am afraid that using only the +no_glp variant gives a different set of errors:

$ sudo port clean ffmpeg && sudo port build ffmpeg +no_gpl
Password:
--->  Cleaning ffmpeg
--->  Computing dependencies for ffmpeg
--->  Fetching ffmpeg
--->  Verifying checksum(s) for ffmpeg
--->  Extracting ffmpeg
--->  Applying patches to ffmpeg
--->  Configuring ffmpeg
--->  Building ffmpeg
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" && gmake -j2 all " returned error 2
Command output: {standard input}:6626:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:6604:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000010$pb"
{standard input}:6604:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:6583:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000010$pb"
{standard input}:6583:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:6561:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000010$pb"
{standard input}:6561:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:6540:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000010$pb"
{standard input}:6540:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:6256:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000009$pb"
{standard input}:6256:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:5830:non-relocatable subtraction expression, "_ff_pw_15" minus "L00000000008$pb"
{standard input}:5830:symbol: "_ff_pw_15" can't be undefined in a subtraction expression
{standard input}:5416:non-relocatable subtraction expression, "_ff_pw_15" minus "L00000000007$pb"
{standard input}:5416:symbol: "_ff_pw_15" can't be undefined in a subtraction expression
{standard input}:5178:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000006$pb"
{standard input}:5178:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:4763:non-relocatable subtraction expression, "_ff_pw_16" minus "L00000000005$pb"
{standard input}:4763:symbol: "_ff_pw_16" can't be undefined in a subtraction expression
{standard input}:4712:non-relocatable subtraction expression, "_ff_pw_255" minus "L00000000004$pb"
{standard input}:4712:symbol: "_ff_pw_255" can't be undefined in a subtraction expression
{standard input}:4633:non-relocatable subtraction expression, "_ff_pw_255" minus "L00000000003$pb"
{standard input}:4633:symbol: "_ff_pw_255" can't be undefined in a subtraction expression
{standard input}:4361:non-relocatable subtraction expression, "_ff_pb_FC" minus "L00000000002$pb"
{standard input}:4361:symbol: "_ff_pb_FC" can't be undefined in a subtraction expression
{standard input}:3753:non-relocatable subtraction expression, "_vector128" minus "L00000000001$pb"
{standard input}:3753:symbol: "_vector128" can't be undefined in a subtraction expression
/usr/bin/gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" -O2 -DHAVE_LRINTF -I/opt/local/include -arch i386 -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -I/opt/local/include/dirac -I/opt/local/include/schroedinger-1.0 -I/opt/local/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno        -c -o libavcodec/x86/cavsdsp_mmx.o libavcodec/x86/cavsdsp_mmx.c
gmake: *** [libavcodec/x86/dsputil_mmx.o] Error 1
gmake: *** Waiting for unfinished jobs....

Error: Status 1 encountered during processing.
$

(This and other complete error logs attached).

When building ffmpeg-devel @19723 with no flags the error is the same type (can't find a register in class 'GENERAL_REGS' while reloading 'asm') though on a different file (libavcodec/x86/h264dsp_mmx.c:2058). It is the same with +no_gpl.

Installed XCode and gcc is the one packaged with the 10.6 DVD (i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)). In case it might matter, the journaled HFS+ is case sensitive.

Changed 12 years ago by gonhidi@…

sudo port clean ffmpeg && sudo port -d build ffmpeg +no_gpl

Changed 12 years ago by gonhidi@…

sudo port clean ffmpeg-devel && sudo port -d build ffmpeg-devel (devel version 19723)

comment:11 Changed 12 years ago by gonhidi@…

patch-ffmpeg.2.diff definitely allows building without variants. :-) I hope that the reason why the work-around is necessary will be found and solved though!

Cheers.

comment:12 Changed 12 years ago by dbevans (David B. Evans)

The patch is just an expedient to make ffmpeg usable while the root causes are identified. I hope I can count on you for further testings as we proceed since I don't have a system available that will reproduce the problem.

In the meantime, work around patch is committed for ffmpeg in r56642 and ffmpeg-devel in r56643.

Will leave ticket open for any addition information/comments until the issue is formally resolved.

comment:13 Changed 12 years ago by d_odijk@…

I was able to compile the no_sl_20938 variant, including swscale, on my MacBook Air using Snow Leopard.

From what I read above I was counting on compile errors.

comment:14 Changed 12 years ago by d_odijk@…

Cc: d_odijk@… added

Cc Me!

comment:15 Changed 12 years ago by gonhidi@…

The two of us who have reported having had problems had first generation MacBook(Pro) laptops, so I wonder if the problem might only show on Intel Core (Duo) processor machines (maybe a 64 vs 32 bit issue, or some glitch in the compiler with the specific processor).

Changed 12 years ago by dave@…

Patch to enable MMX on Snow Leopard.

comment:16 Changed 12 years ago by dave@…

The latest SVN revision builds fine for me with MMX enabled on 64-bit Snow Leopard. I’ve attached a patch to reenable mmx for that scenario.

Clearly building with MMX is desirable because it’s much, much faster.

comment:17 Changed 12 years ago by dave@…

Cc: dave@… added

Cc Me!

comment:18 Changed 12 years ago by dbevans (David B. Evans)

Thanks for the update. Will commit the upgrade after short testing here.

This is a fix for ffmpeg-devel but to fix ffmpeg, it would be nice to identify the specific changes that enable MMX on 64 bit Snow Leopard and then back port that as a patch to ffmpeg. If you can do that please let me know.

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

Attachment: patch-ffmpeg-devel.diff added

Proposed SL 64 bit patch for ffmpeg-devel

comment:19 Changed 12 years ago by dbevans (David B. Evans)

Keywords: snow-leopard added
Port: ffmpeg-devel added
Summary: ffmpeg @0.5_3 fails to build on 10.6ffmpeg/ffmpeg-devel fails to build on 10.6

Have attached a slightly revised patch for the ffmpeg-devel Portfile that I would like you to test before committing.

This updates svn to the latest versions and re-enables swscale and mmx for ffmpeg-devel. Would like your confirmation that this works or if only the mmx part works.

I have not disabled support for libxvid since, although it is redundant in a functional sense, it provides encoding support that some users prefer and ffmpeg allows it to be specifically selected if desired. It provides no decoding support.

In addition, since ffmpeg is a dependency of many other multimedia programs this may remove functionality that some other port is depending on. In general, since dependencies can't pass variants in MacPorts, I prefer to keep variants to a minimum and use them to remove functionality at the users discretion rather than eliminate functionality by default and use them to add something.

comment:20 Changed 12 years ago by dave@…

The revised patch works great on ffmpeg-devel — it builds and runs with mmx just fine on 64-bit Snow Leopard.

On plain ffmpeg, it builds fine for me with mmx with just one small patch to ./configure (from a newer upstream version) so that it can detect newer versions of libx264. I’m not sure why ffmpeg was failing originally, but if anything it might still have problems building under 32-bit Snow Leopard.

Speaking of x264, can you check the patch I attached to 21070? That enables mmx/asm on that port as well.

Changed 12 years ago by dave@…

Attachment: ffmpeg-mmx-sl-portfile.diff added

Patch to enable MMX on Snow Leopard on the ffmpeg 0.5 port.

Changed 12 years ago by dave@…

Attachment: patch-ffmpeg-configure.diff added

Patch to ffmpeg 0.5’s configure script to enable detection of newer versions of libx264.

comment:21 Changed 12 years ago by mnick@…

Cc: mnick@… added

Cc Me!

comment:22 Changed 12 years ago by lessen42@…

Just a note about the original build failure: this is a known problem when using gcc >= 4.2 and PIC on 32-bit x86. The possible solutions are either to not use PIC on x86 32-bit (--extra-cflags=-mdynamic-no-pic, or --disable-shared if you're anal about following shared lib recommendations/Apple broke the linker again), or use gcc 4.0 for ffmpeg/x86_32.

Changed 12 years ago by dave@…

ffmpeg portfile that disables mmx only on i386

Changed 12 years ago by dave@…

ffmpeg-devel portfile that disables mmx only on i386

comment:23 Changed 12 years ago by dave@…

Cool. Attached new patches for ffmpeg and ffmpeg-devel that disable mmx only on 32-bit Snow Leopard. 64-bit Snow Leopard and Leopard should build with MMX.

comment:24 Changed 12 years ago by dbevans (David B. Evans)

Patch for ffmpeg-devel committed in r57505, ffmpeg in r57508.

Thanks for everyone's input and help to date.

comment:25 Changed 12 years ago by dbevans (David B. Evans)

Here's one more patch specifically for sl i386 that tests whether using gcc-4.0 will fix mmx for that arch as well. Apply to the updated Portfile after the previous patches are applied.

Please test and let me know if this works.

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

Patch to use gcc-4.0 on snow leopard i386 (32 bit)

comment:26 in reply to:  25 Changed 12 years ago by gonhidi@…

Replying to devans@…:

Here's one more patch specifically for sl i386 that tests whether using gcc-4.0 will fix mmx for that arch as well. Apply to the updated Portfile after the previous patches are applied.

Please test and let me know if this works.

I am afraid it doesn't. GCC 4.0 is apparently selected but is later overriden so it is 4.2 that is finally used. Here's what I believe to be the relevant debug output:

DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (ffmpeg)
DEBUG: Environment: CFLAGS='-O2 -DHAVE_LRINTF -I/opt/local/include -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -arch i386' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2 -m32' LDFLAGS='-L/opt/local/lib' OBJC='/usr/bin/gcc-4.0' FCFLAGS='-O2 -m32' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2 -arch i386' FFLAGS='-O2 -m32' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5" && ./configure --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=i386'
install prefix            /opt/local
source path               /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_ffmpeg/work/ffmpeg-0.5
C compiler                /usr/bin/gcc-4.2

Changed 12 years ago by bmishkin@…

Attachment: patch-ffmpeg-i386-gpl.diff added

proposed patch for i386 + gpl_libs

comment:27 Changed 12 years ago by bmishkin@…

Above patch adds cflag '-mdynamic-no-pic' for darwin/i386.

Without this patch, 'port install ffmpeg-devel' (no variants) on 10.6.1/i386 (32-bit) fails on swscale.

A workaround is to use '+no_gpl +no_mmx', but if you need gpl libs like x264 that is unsatisfactory.

comment:28 in reply to:  27 Changed 12 years ago by gonhidi@…

Replying to bmishkin@…:

Above patch adds cflag '-mdynamic-no-pic' for darwin/i386.

Given that the rest of the code inside the i386 condition is the workaround that your suggestion (thank you!) fixes (it now builds file), I think that the patch should look something like

     depends_lib-append path:lib/pkgconfig/sdl.pc:libsdl-devel
     # ticket #20938 -- disable mmx for 32 bit intel only
     if { $build_arch == "i386" } {
-        if { ![variant_isset no_gpl] } {
-            configure.args-delete --enable-swscale
-        }
-        if { ![variant_isset no_mmx] } {
-            configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
-        }
+        configure.cflags-append -mdynamic-no-pic
     }
 }

comment:29 Changed 11 years ago by gseanmcg@…

Cc: gseanmcg@… added

Cc Me!

comment:30 Changed 11 years ago by motya@…

Cc: motya@… added

Cc Me!

Changed 10 years ago by macports@…

Attachment: h264dsp_mmx.c added

h264dsp_mmx.c with hacks to make compile under 32 bit Apple gcc

comment:31 Changed 10 years ago by macports@…

The solution provided above (just switch off mmx for 32-bit machines) is heavy-weight and less than ideal. We can do a little better.

ffmpeg, when compiled through macports for i386 (rather than 86x64) generates a compiler error when compiling the instructions in h264_h_loop_filter_luma_mmx2 h264_h_loop_filter_chroma_mmx2 h264_h_loop_filter_chroma_intra_mmx2 The same sort of error in each case which I interpret to mean that gcc believes it is being forced to allocate more MMX registers than are available.

This bug report implies that the problem is in swscale_template.c (specifically in code swizzling between RGB and RGBA formats), but I have no such problem using the most recent XCode (the one released about two weeks ago) and the most recent ffmpeg code. I do, however, as I said, get this error message at the three functions I listed above.

Since I need to have a (reasonably fast) ffmpeg on a Core Duo (NOT Core 2 Duo) machine, I stuck a quick hack into the source to get this to work. Basically the problem appears to be that gcc (or at least Apple's version of it, so this may be an issue with the LLVM backend) is being dumb about not reusing MMX registers from the inlined assembly, even though it is obvious that they can be reused. I don't know enough gcc to understand what it is thinking (or even how to generate assembly so I can see what it is doing along the way) so I did a quick hack with functionPtrs to force the damn code to be compiled into separate functions. It's obviously less than ideal --- better would be to tell gcc just not to inline the relevant functions --- but I could not figure out how to get that to work. The net says use __attribute(noinline))__ but every variant I tried of that gave a compiler error.

This involves some minor changes to the file h264dsp_mmx.c I'm sorry --- I don't know how to do patching or any of the other stuff that you guys use; so I just included the raw h264dsp_mmx.c file as an attachment. As you can see, what I have done is trivial --- forced some inlined code to be broken into separately compiled functions to prevent register overload.

IMHO the ideal path going forward is (a) install my patch ASAP to get an immediate speedboost (b) improve my patch by anyone who understands gcc to tell it to just not inline the functions I jump to via procPtr. What we want is separate compilation of the relevant function without paying the procPtr overhead (c) anyone who understands gcc assembly and the linkages between gcc and llvm should try to spend a little time figuring out WHY gcc/LLVM is complaining about register spillage. This really looks like a (serious) bug, and is probably worth bringing to the attention of someone inside Apple who handles the compilers.

comment:32 Changed 10 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:33 Changed 10 years ago by fran6co@…

Could someone test this patch #28935 and check if it fixes this ticket?

comment:34 Changed 10 years ago by fran6co@…

Cc: fran6co@… added

Cc Me!

comment:35 Changed 10 years ago by daitakahashi

Cc: dtakahashi42@… added

Cc Me!

comment:36 Changed 10 years ago by ryandesign (Ryan Schmidt)

This ticket is long and I haven't read everything in it. Are any patches in this ticket still needed for ffmpeg @0.7.1? What about ffmpeg-devel @20110628? If so, do the patches need to be refreshed for those versions, and if so, can someone do that?

comment:37 Changed 10 years ago by d_odijk@…

Cc: d_odijk@… removed

Cc Me!

comment:38 Changed 10 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added

The patch in #28935 worked for me so I committed it. Please test if that resolves the issue for you.

comment:39 Changed 10 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

Closing as fixed.

Note: See TracTickets for help on using tickets.