[MacPorts] #64653: 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

MacPorts noreply at macports.org
Fri Feb 18 21:13:29 UTC 2022


#64653: 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
---------------------------+-------------------------------------
  Reporter:  barracuda156  |      Owner:  (none)
      Type:  defect        |     Status:  closed
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.7.1
Resolution:  invalid       |   Keywords:  powerpc, Leopard, ppc64
      Port:  libvpx        |
---------------------------+-------------------------------------

Comment (by barracuda156):

 Replying to [comment:15 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?

 P. 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/64653#comment:20>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list