Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#67392 closed defect (worksforme)

libvpx @1.13.0+universal: Undefined symbols

Reported by: SchmollTroll Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: arm64 Cc:
Port: libvpx

Description

Hi there,

today I switched from a MacMini i7 to the new MacMini M2 pro and now I try to install all my previous ports. One of those is ffmpeg which I install with "port install ffmpeg +x11 +gpl +nonfree +postproc +lame +xvid +x264 +x265 +a52 +faac +faad +dts +theora +libogg +vorbis +libdc1394 +librtmp +vaapi +vdpau +cuvid +nvenc +nvdec +ffnvcodec"

That had worked with macOS 13 on the x86 Mac but I got an error for "libvpx" on the ARM machine (some details from /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libvpx/libvpx/main.log):

:info:build       ...
:info:build   "_vpx_img_free", referenced from:
:info:build       libvpx_test::Y4mVideoSource::~Y4mVideoSource() in active_map_refresh_test.cc.o
:info:build       (anonymous namespace)::ActiveMapTest_Test_Test::TestBody() in active_map_test.cc.o
:info:build       libvpx_test::I420VideoSource::~I420VideoSource() in active_map_test.cc.o
:info:build       libvpx_test::I420VideoSource::~I420VideoSource() in active_map_test.cc.o
:info:build       libvpx_test::YUVVideoSource::SetSize(unsigned int, unsigned int, vpx_img_fmt) in active_map_test.cc.o
:info:build       libvpx_test::YUVVideoSource::~YUVVideoSource() in active_map_test.cc.o
:info:build       libvpx_test::YUVVideoSource::~YUVVideoSource() in active_map_test.cc.o
:info:build       ...
:info:build   "_vpx_img_wrap", referenced from:
:info:build       (anonymous namespace)::EncodeAPI_InvalidParams_Test::TestBody() in encode_api_test.cc.o
:info:build       (anonymous namespace)::EncodeAPI_ImageSizeSetting_Test::TestBody() in encode_api_test.cc.o
:info:build ld: symbol(s) not found for architecture arm64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[1]: *** [test_libvpx] Error 1
:info:build make: *** [.DEFAULT] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libvpx/libvpx/work/libvpx-1.13.0-arm64'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libvpx/libvpx/work/libvpx-1.13.0-arm64" && /usr/bin/make -j12 -w verbose=1 
:info:build Exit code: 2
:error:build Failed to build libvpx: command execution failed
:debug:build Error code: NONE
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libvpx/libvpx/main.log for details.

I also tried a solo install of libvpx with "sudo port install libvpx +universal" but also got the error.

Any hints for me? THX!

Attachments (2)

main.log (892.9 KB) - added by SchmollTroll 18 months ago.
main.log
ffmpeg_main.log (3.2 MB) - added by SchmollTroll 18 months ago.
MacPorts ffmpeg main.log

Change History (9)

comment:1 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: arm64 added; libvpx ffmpeg removed
Owner: set to mascguy
Status: newassigned
Summary: Problems building libvpx for ffmpeg on Ventura ARM MacMinilibvpx @1.13.0+universal: Undefined symbols

Please attach the main.log file.

Changed 18 months ago by SchmollTroll

Attachment: main.log added

main.log

comment:2 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

From the log:

:info:build /usr/bin/clang++ -L/opt/local/lib -Wl,-headerpad_max_install_names -Os -stdlib=libc++ -arch arm64 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -o test_libvpx ivfenc.c.o md5_utils.c.o test/active_map_refresh_test.cc.o test/active_map_test.cc.o test/alt_ref_aq_segment_test.cc.o test/altref_test.cc.o test/aq_segment_test.cc.o test/bench.cc.o test/borders_test.cc.o test/byte_alignment_test.cc.o test/config_test.cc.o test/cpu_speed_test.cc.o test/cq_test.cc.o test/decode_api_test.cc.o test/decode_corrupted.cc.o test/decode_svc_test.cc.o test/decode_test_driver.cc.o test/encode_api_test.cc.o test/encode_test_driver.cc.o test/error_resilience_test.cc.o test/external_frame_buffer_test.cc.o test/frame_size_tests.cc.o test/invalid_file_test.cc.o test/keyframe_test.cc.o test/level_test.cc.o test/realtime_test.cc.o test/resize_test.cc.o test/svc_datarate_test.cc.o test/svc_end_to_end_test.cc.o test/svc_test.cc.o test/test_libvpx.cc.o test/test_vector_test.cc.o test/test_vectors.cc.o test/timestamp_test.cc.o test/user_priv_test.cc.o test/vp8_datarate_test.cc.o test/vp9_datarate_test.cc.o test/vp9_end_to_end_test.cc.o test/vp9_ethread_test.cc.o test/vp9_ext_ratectrl_test.cc.o test/vp9_lossless_test.cc.o test/vp9_motion_vector_test.cc.o test/vp9_skip_loopfilter_test.cc.o test/y4m_test.cc.o third_party/libwebm/mkvparser/mkvparser.cc.o third_party/libwebm/mkvparser/mkvreader.cc.o webmdec.cc.o y4menc.c.o y4minput.c.o -L. -lvpx -lgtest -lpthread -lm -lpthread
:info:build ld: warning: ignoring file /opt/local/lib/libvpx.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

So the bug is happening because of these two reasons:

  1. /opt/local/lib/libvpx.dylib exists on your system and is built for x86_64 but you are trying to build for arm64 now. Did you forget the step in the migration instructions where you uninstall all your ports before reinstalling them?
  2. The build system places our LDFLAGS (including -L/opt/local/lib) before its own library path flags (-L.) so the preexisting libvpx.dylib is being used instead of the one that was just built. This could cause build failures in other situations as well, for example upgrading from an older version of the library to newer one that introduces new symbols. This should be fixed by correcting the order of the flags.

comment:3 Changed 18 months ago by SchmollTroll

"Have you tried turning it off and on again?" :-D I thought I did a migration as described, but maybe I missed a step. So I did a complete uninstall/cleanup/reinstall of MacPorts and now it works like a charm again - THANKS A LOT!

comment:4 in reply to:  3 Changed 18 months ago by mascguy (Christopher Nielsen)

Resolution: worksforme
Status: assignedclosed

Replying to SchmollTroll:

I thought I did a migration as described, but maybe I missed a step. So I did a complete uninstall/cleanup/reinstall of MacPorts and now it works like a charm again - THANKS A LOT!

Glad it's working now!

And thanks as always for jumping in Ryan, much appreciated!

Changed 18 months ago by SchmollTroll

Attachment: ffmpeg_main.log added

MacPorts ffmpeg main.log

comment:5 Changed 18 months ago by SchmollTroll

grmpf - my answer was a bit too quick. All my ports build fine except ffmpeg. Dependencies work, configuration works, but the build exits with error :-P

I upload the ffmpeg main.log – could you please take a look on it again?

comment:6 in reply to:  5 Changed 18 months ago by mascguy (Christopher Nielsen)

Replying to SchmollTroll:

grmpf - my answer was a bit too quick. All my ports build fine except ffmpeg. Dependencies work, configuration works, but the build exits with error :-P

I upload the ffmpeg main.log – could you please take a look on it again?

It looks like you're dealing with one of our known issues, tracked by issue:67327

libavcodec/libsvtav1.c:124:53: error: no member named 'compressed_ten_bit_format' in 'struct EbSvtAv1EncConfiguration'
        (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0;
                                            ~~~~~~  ^

We have a fix pending soon, and I'll add you to that ticket.

comment:7 Changed 18 months ago by SchmollTroll

MAN, you made my day (night)! Now it really works, ffmpeg is converting my favorite TV show right now :-D Thank you so much!!!

Note: See TracTickets for help on using tickets.