Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#17527 closed defect (fixed)

ffmpeg @15261_0 fails to build on PPC (10.4 & 10.5)

Reported by: takanori@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: compat(5) Cc: simon@…, acho@…, dbevans (David B. Evans), garribald@…, bK4gYuRo
Port: ffmpeg

Description

Seems that ffmpeg @15261 fails to build on Leopard/PPC.

takanori@pc192168024032$ uname -v
Darwin Kernel Version 9.5.0: Wed Sep  3 11:31:44 PDT 2008; root:xnu-1228.7.58~1/RELEASE_PPC

takanori@pc192168024032$ sudo port install gimp2
...
--->  Fetching ffmpeg
--->  Verifying checksum(s) for ffmpeg
--->  Extracting 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/trunk" && gmake all " returned error 2
Command output: libavcodec/ppc/snow_altivec.c:727: warning: pointer type mismatch in conditional expression
gcc-4.0 -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/trunk" -O2 -DHAVE_LRINTF -I/opt/local/include -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -fasm -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -maltivec -mabi=altivec -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno      -maltivec -mabi=altivec -maltivec -mabi=altivec -fPIC -DPIC -c -o libavcodec/ppc/vc1dsp_altivec.o libavcodec/ppc/vc1dsp_altivec.c
gcc-4.0 -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/trunk" -O2 -DHAVE_LRINTF -I/opt/local/include -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -fasm -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -maltivec -mabi=altivec -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno      -fPIC -DPIC -c -o libavcodec/ppc/check_altivec.o libavcodec/ppc/check_altivec.c
In file included from /usr/include/sys/ucred.h:76,
                 from /usr/include/sys/sysctl.h:83,
                 from libavcodec/ppc/check_altivec.c:26:
/usr/include/bsm/audit.h:224: error: syntax error before 'u_char'
/usr/include/bsm/audit.h:227: error: syntax error before '}' token
/usr/include/bsm/audit.h:234: error: syntax error before 'u_char'
/usr/include/bsm/audit.h:237: error: syntax error before '}' token
In file included from /usr/include/sys/sysctl.h:83,
                 from libavcodec/ppc/check_altivec.c:26:
/usr/include/sys/ucred.h:90: error: syntax error before 'u_long'
/usr/include/sys/ucred.h:113: error: syntax error before '}' token
/usr/include/sys/ucred.h:130: error: syntax error before 'u_int'
/usr/include/sys/ucred.h:134: error: syntax error before '}' token
In file included from /usr/include/sys/sysctl.h:84,
                 from libavcodec/ppc/check_altivec.c:26:
/usr/include/sys/proc.h:114: error: syntax error before 'u_int'
/usr/include/sys/proc.h:119: error: syntax error before 'p_swtime'
/usr/include/sys/proc.h:120: error: syntax error before 'p_slptime'
/usr/include/sys/proc.h:134: error: syntax error before 'p_priority'
/usr/include/sys/proc.h:135: error: syntax error before 'p_usrpri'
/usr/include/sys/proc.h:140: error: syntax error before 'p_xstat'
/usr/include/sys/proc.h:141: error: syntax error before 'p_acflag'
/usr/include/sys/proc.h:143: error: syntax error before '}' token
In file included from libavcodec/ppc/check_altivec.c:26:
/usr/include/sys/sysctl.h:440: error: field 'kp_proc' has incomplete type
/usr/include/sys/sysctl.h:750: error: syntax error before 'u_int'
gmake: *** [libavcodec/ppc/check_altivec.o] Error 1

Attachments (2)

ffmpeg.diff (2.5 KB) - added by takanori@… 16 years ago.
Here is a patch to avoid this problem.
ffmpeg.2.diff (1.4 KB) - added by takanori@… 16 years ago.

Download all attachments as: .zip

Change History (12)

Changed 16 years ago by takanori@…

Attachment: ffmpeg.diff added

Here is a patch to avoid this problem.

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

Problem persists on Mac OS X 10.4/PPC after applying this patch.

gcc-4.0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_ffmpeg/work/trunk" -O2 -DHAVE_LRINTF -I/opt/local/include -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_DARWIN_C_SOURCE -fasm -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -maltivec -mabi=altivec -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno      -fPIC -DPIC -c -o libavcodec/ppc/check_altivec.o libavcodec/ppc/check_altivec.c
In file included from /usr/include/sys/ucred.h:64,
                 from /usr/include/sys/sysctl.h:71,
                 from libavcodec/ppc/check_altivec.c:27:
/usr/include/bsm/audit.h:219: error: parse error before 'u_char'
/usr/include/bsm/audit.h:222: error: parse error before '}' token
/usr/include/bsm/audit.h:229: error: parse error before 'u_char'
/usr/include/bsm/audit.h:232: error: parse error before '}' token
In file included from /usr/include/sys/sysctl.h:71,
                 from libavcodec/ppc/check_altivec.c:27:
/usr/include/sys/ucred.h:76: error: parse error before 'u_long'
/usr/include/sys/ucred.h:88: error: parse error before '}' token
/usr/include/sys/ucred.h:95: error: parse error before 'u_int'
/usr/include/sys/ucred.h:99: error: parse error before '}' token
In file included from /usr/include/sys/sysctl.h:72,
                 from libavcodec/ppc/check_altivec.c:27:
/usr/include/sys/proc.h:108: error: parse error before 'u_int'
/usr/include/sys/proc.h:113: error: parse error before 'p_swtime'
/usr/include/sys/proc.h:114: error: parse error before 'p_slptime'
/usr/include/sys/proc.h:128: error: parse error before 'p_priority'
/usr/include/sys/proc.h:129: error: parse error before 'p_usrpri'
/usr/include/sys/proc.h:134: error: parse error before 'p_xstat'
/usr/include/sys/proc.h:135: error: parse error before 'p_acflag'
/usr/include/sys/proc.h:137: error: parse error before '}' token
In file included from libavcodec/ppc/check_altivec.c:27:
/usr/include/sys/sysctl.h:400: error: field 'kp_proc' has incomplete type
/usr/include/sys/sysctl.h:690: error: parse error before 'u_int'
gmake: *** [libavcodec/ppc/check_altivec.o] Error 1
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_ffmpeg/work/trunk" && gmake all " returned error 2
Command output: libavcodec/ppc/snow_altivec.c:727: warning: pointer type mismatch in conditional expression
gcc-4.0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_ffmpeg/work/trunk" -O2 -DHAVE_LRINTF -I/opt/local/include -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_DARWIN_C_SOURCE -fasm -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -maltivec -mabi=altivec -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno      -maltivec -mabi=altivec -maltivec -mabi=altivec -fPIC -DPIC -c -o libavcodec/ppc/vc1dsp_altivec.o libavcodec/ppc/vc1dsp_altivec.c
gcc-4.0 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_ffmpeg/work/trunk" -O2 -DHAVE_LRINTF -I/opt/local/include -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_DARWIN_C_SOURCE -fasm -std=c99 -pipe -force_cpusubtype_ALL -Wno-sign-compare -fomit-frame-pointer -maltivec -mabi=altivec -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno      -fPIC -DPIC -c -o libavcodec/ppc/check_altivec.o libavcodec/ppc/check_altivec.c
In file included from /usr/include/sys/ucred.h:64,
                 from /usr/include/sys/sysctl.h:71,
                 from libavcodec/ppc/check_altivec.c:27:
/usr/include/bsm/audit.h:219: error: parse error before 'u_char'
/usr/include/bsm/audit.h:222: error: parse error before '}' token
/usr/include/bsm/audit.h:229: error: parse error before 'u_char'
/usr/include/bsm/audit.h:232: error: parse error before '}' token
In file included from /usr/include/sys/sysctl.h:71,
                 from libavcodec/ppc/check_altivec.c:27:
/usr/include/sys/ucred.h:76: error: parse error before 'u_long'
/usr/include/sys/ucred.h:88: error: parse error before '}' token
/usr/include/sys/ucred.h:95: error: parse error before 'u_int'
/usr/include/sys/ucred.h:99: error: parse error before '}' token
In file included from /usr/include/sys/sysctl.h:72,
                 from libavcodec/ppc/check_altivec.c:27:
/usr/include/sys/proc.h:108: error: parse error before 'u_int'
/usr/include/sys/proc.h:113: error: parse error before 'p_swtime'
/usr/include/sys/proc.h:114: error: parse error before 'p_slptime'
/usr/include/sys/proc.h:128: error: parse error before 'p_priority'
/usr/include/sys/proc.h:129: error: parse error before 'p_usrpri'
/usr/include/sys/proc.h:134: error: parse error before 'p_xstat'
/usr/include/sys/proc.h:135: error: parse error before 'p_acflag'
/usr/include/sys/proc.h:137: error: parse error before '}' token
In file included from libavcodec/ppc/check_altivec.c:27:
/usr/include/sys/sysctl.h:400: error: field 'kp_proc' has incomplete type
/usr/include/sys/sysctl.h:690: error: parse error before 'u_int'
gmake: *** [libavcodec/ppc/check_altivec.o] Error 1

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

Cc: devans@… added

comment:3 Changed 16 years ago by garribald@…

Cc: garribald@… added

Cc Me!

comment:4 Changed 16 years ago by bK4gYuRo

Cc: macports@… added

Cc Me!

comment:5 Changed 16 years ago by simon@…

I'm sorry but I also don't have a really solution.

But disabling altivec at least fixes the problem but will cause a slowdown I assume.

The following patch works for me on Tiger 10.4 PPC, please check if it also works on Leopard PCC.

diff --git a/dports/multimedia/ffmpeg/Portfile b/dports/multimedia/ffmpeg/Portfile
index f09ad68..22326b0 100644
--- a/dports/multimedia/ffmpeg/Portfile
+++ b/dports/multimedia/ffmpeg/Portfile
@@ -89,6 +89,10 @@ platform darwin i386 {
 	}
 }
 
+platform darwin powerpc {
+	configure.args-append	--disable-altivec
+}
+
 variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
 # make no-mmx default and allow mmx enabling for the brave.
 	configure.args-delete --disable-mmx

Thanks,

Simon

comment:6 Changed 16 years ago by takanori@…

Problem persists on Mac OS X 10.4/PPC after applying this patch. I'm sorry but I also don't have a really solution.

Okay then, how about the following patch? (ffmpeg.2.diff) I think this new one should work on Tiger/PPC.

disabling altivec at least fixes the problem but will cause a slowdown I assume.

Yes. but It's the last resort, you know. ;-)

Changed 16 years ago by takanori@…

Attachment: ffmpeg.2.diff added

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

OK, patch two does the trick for me. I assume this works for Leopard as well (without the compat stuff)? If so, I vote to commit it.

Will do so if no one complains.

For the record, the compat implementation on Tiger is quite different from Leopard. Instead of _DARWIN_C_SOURCE there is _APPLE_C_SOURCE and (from man page)

     Defining any of _POSIX_C_SOURCE, _APPLE_C_SOURE, or __LP64__ causes
     library and kernel calls to conform to Version 3 of the Single UNIX
     Specification (``SUSv3'') standards even if doing so would alter the
     behavior of functions used in 10.3.  Defining _POSIX_C_SOURCE also
     removes functions, types, and other interfaces that are not part of
     Version 3 of the Single UNIX Specification (``SUSv3'') from the normal C
     namespace, while _APPLE_C_SOURE does not.

so _APPLE_C_SOURCE would have to replace _POSIX_C_SOURCE and the results of that might be more wide spread. This fix is a bit brute force but it addresses the problem where it is located without messing with the rest of the code too much.

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

Keywords: ffmpeg removed
Resolution: fixed
Status: newclosed
Summary: ffmpeg @15261_0 fails to build on Mac OS X 10.5/PPCffmpeg @15261_0 fails to build on PPC (10.4 & 10.5)

Committed in r43268.

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

And in r43269.

comment:10 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.