Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64653 closed defect (invalid)

libvpx @1.4.0 fails to configure on 10.5.8: Configuring for target 'ppc32-darwin-gcc' enabling ppc32 enabling altivec Toolchain is unable to link executables

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: powerpc, Leopard, ppc64 Cc:
Port: libvpx

Description

--->  Configuring libvpx
--->  Configuring libvpx for architecture ppc
Executing:  cd "/opt/local/var/macports/build/_opt_PPCLeopardPorts_multimedia_libvpx/libvpx/work/libvpx-1.4.0-ppc" && ./configure --prefix=/opt/local --enable-vp8 --enable-vp9 --enable-internal-stats --enable-pic --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=ppc32-darwin-gcc 
  enabling vp8
  enabling vp9
  enabling internal_stats
  enabling pic
  enabling postproc
  enabling runtime_cpu_detect
  disabling install_docs
  disabling debug_libs
  disabling examples
  disabling unit_tests
Configuring selected codecs
Configuring for target 'ppc32-darwin-gcc'
  enabling ppc32
  enabling altivec
Toolchain is unable to link executables

Configuration failed. This could reflect a misconfiguration of your
toolchains, improper options selected, or another problem. If you
don't see any useful error messages above, the next step is to look
at the configure error log file (config.log) to determine what
configure was trying to do when it died.
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCLeopardPorts_multimedia_libvpx/libvpx/work/libvpx-1.4.0-ppc" && ./configure --prefix=/opt/local --enable-vp8 --enable-vp9 --enable-internal-stats --enable-pic --enable-postproc --enable-multithread --enable-runtime-cpu-detect --disable-install-docs --disable-debug-libs --disable-examples --disable-unit-tests --target=ppc32-darwin-gcc 
Exit code: 1

Attachments (3)

config.log (25.1 KB) - added by barracuda156 2 years ago.
main.log (11.0 KB) - added by barracuda156 2 years ago.
libvpx1.6.1ppc.zip (8.5 KB) - added by barracuda156 2 years ago.

Download all attachments as: .zip

Change History (24)

Changed 2 years ago by barracuda156

Attachment: config.log added

Changed 2 years ago by barracuda156

Attachment: main.log added

comment:1 Changed 2 years ago by kencu (Ken)

somehow, the compiler reference is being quoted during the link, and it appears that is making it fail:

227	./build/make/configure.sh: line 268: "/usr/bin/gcc-4.2": No such file or directory

comment:2 Changed 2 years ago by kencu (Ken)

Resolution: invalid
Status: newclosed

libvpx 1.4.0 is not a part of macports at present, so invalid ticket, but you can still try here to figure out why it’s not building for you, tho.

comment:3 in reply to:  2 Changed 2 years ago by barracuda156

Replying to kencu:

libvpx 1.4.0 is not a part of macports at present, so invalid ticket, but you can still try here to figure out why it’s not building for you, tho.

The source has this on the line in question:

# Toolchain Check Functions
#
check_cmd() {
  enabled external_build && return
  log "$@"
  "$@" >>${logfile} 2>&1
}
  1. S. I am using libvpx from your Leopard repo now, on 10.5.8.
Last edited 2 years ago by barracuda156 (previous) (diff)

comment:4 in reply to:  2 Changed 2 years ago by barracuda156

Replying to kencu:

libvpx 1.4.0 is not a part of macports at present, so invalid ticket, but you can still try here to figure out why it’s not building for you, tho.

And finally some success: I have built libvpx 1.5.0 and 1.6.1 for PowerPC.

36-47% port -v installed libvpx
The following ports are currently installed:
  libvpx @1.5.0_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T17:21:42+0800'
  libvpx @1.6.1_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T19:15:51+0800'
Last edited 2 years ago by barracuda156 (previous) (diff)

comment:5 Changed 2 years ago by kencu (Ken)

that is … unexpected.

you should check to see if the files really are ppc, and perhaps run a few tests to make sure they work.

ppc support was removed as of 1.5.0,

comment:6 Changed 2 years ago by kencu (Ken)

that may actually not turn out to true… gentoo had power versions later than 1.5.0

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=421b6f443ceceb7f50d1802845c0a169c7257d1e

perhaps libvpx might have ppc support still. Someone would have to dig in to be 100% certain of it.

comment:7 in reply to:  6 Changed 2 years ago by barracuda156

Replying to kencu:

that may actually not turn out to true… gentoo had power versions later than 1.5.0

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=421b6f443ceceb7f50d1802845c0a169c7257d1e

perhaps libvpx might have ppc support still. Someone would have to dig in to be 100% certain of it.

Yeah, it looks like alleged removal of PowerPC support amounted to editing away ppc mentions in two config files. Ironically, keeping more obscure archs like mips. Were the code really dramatically changed for Intel, SPARC and mips would have not stayed. What did not work for me is Macports part with archs in portfile. Even 1.4.0 did not build with it.

I removed that portion from the portfile, made patches to restore ppc and added one line to config args that made the whole thing compile. For 1.6.1 another patch was needed, but a trivial one (to remove two flags that compiler didn’t digest: flags that were supposed to get rid of unneeded warnings, LOL).

I didn’t try later versions, but perhaps you are right, recent one may also build.

comment:8 Changed 2 years ago by kencu (Ken)

Yeah, but:

is it really ppc code in the files?? You’re cross compiling on 10.6 to ppc… who knows what you got….

IF it is ppc code, does it really work??

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:9 Changed 2 years ago by kencu (Ken)

power support for linux was added back later, and then restricted to ppc64…

I can’t tell what works without looking at the actual code ATM.

comment:10 in reply to:  8 Changed 2 years ago by barracuda156

Replying to kencu:

Yeah, but: is it really ppc code in the files?? You’re cross compiling on 10.6 to ppc… who knows what you got….

IF it is ppc code, does it really work??

I am off the Quad, so will be able to post file into tomorrow.

I can also test it in some practical tasks, but will need to find some way of doing that. For me it was just a dependency for other ports, which was failing for me while apparently building for others. Such state was disturbing and I wanted to solve it rather than disable a dependency on libvpx.

Once I found someone’s comment re 1.5.0 that PowerPC support being removed (superficially) but that person preserved it via patching, I decided to work on 1.5.0 directly rather than trying to make 1.4.0 build, Then I adapted patches, but it still kept failing with tool chain error. That part was not obvious, but after few attempts I found a way that worked. After 1.5.0 built I changed patches for 1.6.1, and it failed with another error. The latter was easy to fix looking in the log.

Btw, these aren’t cross-compiling, it’s on 10.6 PPC. (Since I was not asking a question anymore but merely reporting on the fact, I didn’t repeat the process on 10.5.8 yet. But presumably it will build too.) From the verbose output compilation went with correct arch flags. I am sure binaries are ppc, as they should. Functionality remains to be tested though.

comment:11 in reply to:  8 Changed 2 years ago by barracuda156

Replying to kencu:

Yeah, but:

is it really ppc code in the files?? You’re cross compiling on 10.6 to ppc… who knows what you got….

IF it is ppc code, does it really work??

Okay I can confirm libvpx 1.6.1 builds on 10.5.8 for ppc32 with identical patches.

I used this command: sudo port -v install libvpx -universal.

36-47:~ svacchanda$ port -v installed libvpx
The following ports are currently installed:
  libvpx @1.6.1_0 (active) requested_variants='-universal' platform='darwin 9' archs='ppc' date='2022-02-16T21:07:00+0800'

I will attach a custom port file which works on 10.5.8 and 10A190.

Changed 2 years ago by barracuda156

Attachment: libvpx1.6.1ppc.zip added

comment:12 Changed 2 years ago by barracuda156

Moreover, it builds even on Tiger:

44-49:~ svacchanda$ port -v installed libvpx 
The following ports are currently installed:
  libvpx @1.6.1_0 (active) requested_variants='' platform='darwin 8' archs='ppc' date='2022-02-16T22:09:12+0800'

Of course, target line has to be changed to --target=ppc32-darwin8-gcc.

comment:13 Changed 2 years ago by kencu (Ken)

still waiting to see if it is powerpc code, and actually works, however!

comment:14 in reply to:  13 Changed 2 years ago by barracuda156

Replying to kencu:

still waiting to see if it is powerpc code, and actually works, however!

36-47:~ svacchanda$ lipo /opt/local/lib/libvpx.a -info
Non-fat file: /opt/local/lib/libvpx.a is architecture: ppc
36-47:~ svacchanda$ otool -hv -arch all /opt/local/lib/libvpx.a 
Archive : /opt/local/lib/libvpx.a
/opt/local/lib/libvpx.a(vpx_decoder.c.o):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
   MH_MAGIC     PPC        ALL  0x00      OBJECT     3        296 SUBSECTIONS_VIA_SYMBOLS

UPD. Sorry for an unnecessarily long output.

Last edited 2 years ago by barracuda156 (previous) (diff)

comment:15 Changed 2 years ago by kencu (Ken)

Well, thank goodness that SUBSECTIONS_VIA_SYMBOLS has been set in each code fragment.

I was getting pretty worried about that.

If we can show it works, then we might be in the running for an actual PR here eventually !

comment:16 Changed 2 years ago by kencu (Ken)

I think I woulld have been fine with the “file” line

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:17 in reply to:  16 Changed 2 years ago by barracuda156

Replying to kencu:

Seriously, 642 lines of crap is not overly helpful.

I am sorry, I spent past night on gcc.

Yes, libvpx works as it should.

36-47% ffmpeg -i /Users/svacchanda/Downloads/sample-mp4-file.mp4  -c:v libvpx-vp9 -b:v 1000K -threads 8 -speed 4 -f webm /Users/svacchanda/Desktop/tmp
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7.5.0 (MacPorts gcc7 7.5.0_3)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --disable-libzvbi --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --enable-zlib --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --disable-opencl --disable-outdev=xv --disable-audiotoolbox --disable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/opt/local/bin/gcc-mp-7 --disable-filter=coreimage --disable-filter=coreimagesrc --disable-indev=avfoundation --arch=ppc --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libsmbclient --enable-nonfree --enable-libfdk-aac
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/svacchanda/Downloads/sample-mp4-file.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf53.24.2
  Duration: 00:02:05.95, start: 0.000000, bitrate: 669 kb/s
  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 282 kb/s, 15 fps, 15 tbr, 15360 tbn, 30 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
File '/Users/svacchanda/Desktop/tmp' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
  Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0xc83da00] No bit rate set. Defaulting to 320000 bps.
[libvpx-vp9 @ 0xc83ca00] v1.6.1
Output #0, webm, to '/Users/svacchanda/Desktop/tmp':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.76.100
  Stream #0:0(und): Video: vp9, yuv420p(progressive), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 1000 kb/s, 15 fps, 1k tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libvpx-vp9
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: opus, 48000 Hz, 5.1, flt, 320 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libopus
frame=    1 fps=0.0 q=0.0 size=       1kB time=00:00:00.23 bitrate=  33.9kbits/sframe=   25 fps=0.0 q=0.0 size=       1kB time=00:00:01.85 bitrate=   4.3kbits/sframe=   29 fps= 21 q=0.0 size=       1kB time=00:00:02.13 bitrate=   3.7kbits/sframe=   31 fps= 15 q=0.0 size=       1kB time=00:00:02.27 bitrate=   3.5kbits/sframe=   33 fps= 12 q=0.0 size=       1kB time=00:00:02.39 bitrate=   3.3kbits/sframe=   35 fps= 11 q=0.0 size=       1kB time=00:00:02.55 bitrate=   3.1kbits/sframe=   37 fps=9.4 q=0.0 size=       1kB time=00:00:02.67 bitrate=   3.0kbits/sframe=   39 fps=8.2 q=0.0 size=       1kB time=00:00:02.79 bitrate=   2.8kbits/sframe=   41 fps=7.3 q=0.0 size=       1kB time=00:00:02.93 bitrate=   2.7kbits/sframe=   43 fps=6.8 q=0.0 size=       1kB time=00:00:03.07 bitrate=   2.6kbits/sframe=   45 fps=6.3 q=0.0 size=       1kB time=00:00:03.21 bitrate=   2.5kbits/sframe=   47 fps=5.9 q=0.0 size=       1kB time=00:00:03.33 bitrate=   2.4kbits/sframe= 1889 fps=0.0 q=0.0 Lsize=   18204kB time=00:02:05.93 bitrate=1184.2kbits/s speed=N/A    
video:14212kB audio:3934kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.318324%

I got a webm file in result which plays on my Intel Mac.

comment:18 Changed 2 years ago by barracuda156

As of now, however, 1.11.0 does not build correctly. I was able to force it build:

36-47% port -v installed libvpx
The following ports are currently installed:
  libvpx @1.5.0_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T17:21:42+0800'
  libvpx @1.6.1_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T19:15:51+0800'
  libvpx @1.11.0_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-17T19:29:33+0800'

And it did kinda build for ppc (notice however that it says ppc7400 instead of just ppc: no idea where this comes from, source does not have it):

36-47% lipo -info /opt/local/lib/libvpx.a 
input file /opt/local/lib/libvpx.a is not a fat file
Non-fat file: /opt/local/lib/libvpx.a is architecture: ppc7400

However unlike 1.6.1, it is broken. Attempt to rebuild ffmpeg with it fails:

--->  Configuring ffmpeg
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_ffmpeg/ffmpeg/work/ffmpeg-4.4.1" && ./configure --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --disable-libzvbi --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --enable-zlib --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --disable-opencl --disable-outdev=xv --disable-audiotoolbox --disable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/opt/local/bin/gcc-mp-10 --disable-filter=coreimage --disable-filter=coreimagesrc --disable-indev=avfoundation --arch=ppc --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libsmbclient --enable-nonfree --enable-libfdk-aac 
libvpx enabled but no supported decoders found

Here someone suggests forcing a generic target: https://bugs.gentoo.org/746173 Did not work for me.

  1. S. This is what I initially used to make patches: https://mail-index.netbsd.org/pkgsrc-bugs/2016/02/16/msg058822.html

comment:19 Changed 2 years ago by barracuda156

And provisionally some success:

36-47% ffmpeg -i /Users/svacchanda/Downloads/sample-mp4-file.mp4  -c:v libvpx-vp9 -b:v 1000K -threads 8 -speed 4 -f webm /Users/svacchanda/Desktop/tmp.webm
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.0 (MacPorts gcc10 10.3.0_2)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --disable-libzvbi --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --enable-zlib --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --disable-opencl --disable-outdev=xv --disable-audiotoolbox --disable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/opt/local/bin/gcc-mp-10 --disable-filter=coreimage --disable-filter=coreimagesrc --disable-indev=avfoundation --arch=ppc --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libsmbclient --enable-nonfree --enable-libfdk-aac
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/svacchanda/Downloads/sample-mp4-file.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf53.24.2
  Duration: 00:02:05.95, start: 0.000000, bitrate: 669 kb/s
  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 282 kb/s, 15 fps, 15 tbr, 15360 tbn, 30 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
File '/Users/svacchanda/Desktop/tmp.webm' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
  Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0xc83de00] No bit rate set. Defaulting to 320000 bps.
[libvpx-vp9 @ 0xc83ca00] v1.11.0
Output #0, webm, to '/Users/svacchanda/Desktop/tmp.webm':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.76.100
  Stream #0:0(und): Video: vp9, yuv420p(progressive), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 1000 kb/s, 15 fps, 1k tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libvpx-vp9
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: opus, 48000 Hz, 5.1, flt, 320 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libopus
frame= 1889 fps=5.9 q=0.0 Lsize=   18134kB time=00:02:05.93 bitrate=1179.6kbits/s speed=0.39x    
video:14142kB audio:3934kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.319563%

So I have rebuilt ffmpeg with libvpx 1.11.0 and it successfully produced webm video file.

36-47% port -v installed libvpx
The following ports are currently installed:
  libvpx @1.5.0_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T17:21:42+0800'
  libvpx @1.6.1_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T19:15:51+0800'
  libvpx @1.11.0_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-17T19:46:03+0800'
36-47% port -v installed ffmpeg 
The following ports are currently installed:
  ffmpeg @4.4.1_1+gpl2 requested_variants='+gpl2' platform='darwin 10' archs='ppc' date='2022-02-15T18:07:25+0800'
  ffmpeg @4.4.1_1+gpl2+gpl3+nonfree (active) requested_variants='+gpl2+gpl3+nonfree' platform='darwin 10' archs='ppc' date='2022-02-17T20:21:06+0800'

PowerPC-specific features in libvpx remain broken at the moment. I rebuilt it now for generic-gnu target.

comment:20 in reply to:  15 Changed 2 years ago by barracuda156

Replying to kencu:

If we can show it works, then we might be in the running for an actual PR here eventually !

Well, it appears that we can pass ppc-specific flags under generic-gcu target, and that works. I can't make ppc targets work, and I think I won't try further. However this worked (in a sense flags get passed to compiler):

@@ -1419,10 +1378,21 @@
           ;;
       esac
       ;;
-    *-gcc|generic-gnu)
+    universal*|*-gcc|generic-gnu)
+      bits=${tgt_isa##ppc}
       link_with_cc=gcc
       enable_feature gcc
       setup_gnu_toolchain
+      add_cflags  -arch ppc -Os -m32 -mcpu=970
+      add_asflags -arch ppc
+      add_ldflags -arch ppc -Os -m32
+      add_cflags  "-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+      add_cflags  "-mmacosx-version-min=10.5"
+      add_ldflags "-isysroot /Developer/SDKs/MacOSX10.6.sdk"
+      add_ldflags "-mmacosx-version-min=10.5"
+      soft_enable altivec
+      enabled altivec && add_cflags -maltivec
+      enabled vsx || RTCD_OPTIONS="${RTCD_OPTIONS}--disable-vsx"

Now, I dunno how to make it OS-depended (unless we want a separate patch for each ppc OS) and of course we don't want -mcpu flag in general case, but I assume we may keep any of these we think are useful, since without all these libvpx still builds and seems to work. (To be honest I am not even sure if these do more good than harm. It may be the case that generic-gnu target is good enough as it is.)

I have successfully rebuilt ffmpeg with a new libvpx and confirmed it produces webm video file:

36-47% ffmpeg -i /Users/svacchanda/Downloads/sample-mp4-file.mp4  -c:v libvpx-vp9 -b:v 1000K -threads 8 -speed 4 -f webm /Users/svacchanda/Desktop/tmp.webm
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.0 (MacPorts gcc10 10.3.0_2)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --disable-libzvbi --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --enable-zlib --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --disable-opencl --disable-outdev=xv --disable-audiotoolbox --disable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/opt/local/bin/gcc-mp-10 --enable-libzimg --disable-filter=coreimage --disable-filter=coreimagesrc --enable-libdav1d --disable-indev=avfoundation --arch=ppc --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-version3 --enable-libsmbclient --enable-nonfree --enable-libfdk-aac
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/svacchanda/Downloads/sample-mp4-file.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf53.24.2
  Duration: 00:02:05.95, start: 0.000000, bitrate: 669 kb/s
  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 282 kb/s, 15 fps, 15 tbr, 15360 tbn, 30 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
File '/Users/svacchanda/Desktop/tmp.webm' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
  Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0xc83de00] No bit rate set. Defaulting to 320000 bps.
[libvpx-vp9 @ 0xc83ca00] v1.11.0
Output #0, webm, to '/Users/svacchanda/Desktop/tmp.webm':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.76.100
  Stream #0:0(und): Video: vp9, yuv420p(progressive), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 1000 kb/s, 15 fps, 1k tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libvpx-vp9
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: opus, 48000 Hz, 5.1, flt, 320 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 libopus
frame= 1889 fps=0.0 q=0.0 Lsize=   18134kB time=00:02:05.93 bitrate=1179.6kbits/s speed=N/A      
video:14142kB audio:3934kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.319563%

I had to add one extra flag into ffmpeg profile:

configure.ldflags-append -read_only_relocs suppress

Otherwise linker complained about static addresses been used in some component of libvpx. This flag was not needed when I built libvpx earlier for generic-gnu target.

36-47% port -v installed libvpx
The following ports are currently installed:
  libvpx @1.5.0_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T17:21:42+0800'
  libvpx @1.6.1_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T19:15:51+0800'
  libvpx @1.11.0_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-17T19:46:03+0800'
  libvpx @1.11.0_1 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-19T04:03:08+0800'
36-47% port -v installed ffmpeg
The following ports are currently installed:
  ffmpeg @4.4.1_1+gpl2 requested_variants='+gpl2' platform='darwin 10' archs='ppc' date='2022-02-15T18:07:25+0800'
  ffmpeg @4.4.1_1+gpl2+gpl3+nonfree (active) requested_variants='+gpl2+gpl3+nonfree' platform='darwin 10' archs='ppc' date='2022-02-19T04:48:23+0800'

What do you think?

  1. S. If you or anyone want to test, I can share specific patches and port file settings I used. Those are not supposed to be for general use at the moment though. But works-for-me.

comment:21 Changed 2 years ago by kencu (Ken)

There is always a bit of a leap from "works on my system" to "works in the main ports repo for everyone".

I think you are to the stage now where you might pick a few of the simpler PPC fixes you have done, and actually take them all the way through the stage of generating the PR, facing down the corrections and fixes that will come, and getting it actually committed.

Then you can start to add fixes for all these things.

Keep them "tight" -- nobody wants to see a Portfile turned into a confusing mess of conditionals... but people will accept them if they can understand them and feel they are at least reasonably maintainable.

Good luck!

Note: See TracTickets for help on using tickets.