Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile under macOS 12.7.5 and swift 5.7.2 #15591

Open
5 tasks done
jdp1024 opened this issue Dec 29, 2024 · 9 comments
Open
5 tasks done

Compile under macOS 12.7.5 and swift 5.7.2 #15591

jdp1024 opened this issue Dec 29, 2024 · 9 comments

Comments

@jdp1024
Copy link

jdp1024 commented Dec 29, 2024

Important Information

mpv v0.39.0-556-g83bb49815c-dirty Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Dec 29 2024 12:22:57
libplacebo version: v7.349.0
FFmpeg version: N-118193-g5f38c82536
FFmpeg library versions:
   libavcodec      61.28.100
   libavdevice     61.4.100
   libavfilter     10.6.101
   libavformat     61.9.102
   libavutil       59.53.100
   libswresample   5.4.100
   libswscale      8.13.100

Reproduction Steps

  • macOS version: 12.7.5
  • Source of mpv: git
  • Latest known working version: 90a7892
  • Issue started after the following happened: mpv cannot be built

The commit

meson: use swiftc instead of swift for building	8d20b72653	Neko Asakura <[email protected]>	Dec 7, 2024 at 21:27

broke the building process under macOS 12.7.5 and swift 5.7.2.

After reverting the change of the commit 8d20b72 at the latest commit 83bb498 (use swift instead swiftc and use the correct compiler flags in osdep/mac/meson.build, the build is successful.

Expected Behavior

Successful build.

Actual Behavior

2

Log File

[238/244] clang -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -Iosdep/mac -I/usr/local/Cellar/libass/0.17.3/include -I/usr/local/Cellar/libunibreak/6.1/include -I/usr/local/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fribidi/1.0.16/include/fribidi -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/include -I/usr/local/Cellar/libplacebo/7.349.0/include -I/usr/local/Cellar/shaderc/2024.4/include -I/usr/local/Cellar/vulkan-loader/1.4.304/../../../opt/vulkan-headers/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/libbluray/1.3.4/include -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/include/luajit-2.1 -I/usr/local/Cellar/rubberband/4.0.0/include -I/usr/local/Cellar/libsamplerate/0.2.2/include -I/usr/local/Cellar/zimg/3.0.5/include -I/usr/local/opt/jpeg-turbo/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -MD -MQ libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o -MF libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o.d -o libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o -c ../video/out/vulkan/context_mac.m
FAILED: libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o
clang -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -Iosdep/mac -I/usr/local/Cellar/libass/0.17.3/include -I/usr/local/Cellar/libunibreak/6.1/include -I/usr/local/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fribidi/1.0.16/include/fribidi -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/include -I/usr/local/Cellar/libplacebo/7.349.0/include -I/usr/local/Cellar/shaderc/2024.4/include -I/usr/local/Cellar/vulkan-loader/1.4.304/../../../opt/vulkan-headers/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/libbluray/1.3.4/include -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/include/luajit-2.1 -I/usr/local/Cellar/rubberband/4.0.0/include -I/usr/local/Cellar/libsamplerate/0.2.2/include -I/usr/local/Cellar/zimg/3.0.5/include -I/usr/local/opt/jpeg-turbo/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -MD -MQ libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o -MF libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o.d -o libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o -c ../video/out/vulkan/context_mac.m
In file included from ../video/out/vulkan/context_mac.m:21:
./osdep/mac/swift.h:240:9: fatal error: '/var/folders/xd/2_73x_qj2nb5dv9jlj_xrb8c0000gn/T/TemporaryDirectory.I5Lv4x/app_bridge_objc-1.pch' file not found
#import "/var/folders/xd/2_73x_qj2nb5dv9jlj_xrb8c0000gn/T/TemporaryDirectory.I5Lv4x/app_bridge_objc-1.pch"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[239/244] clang -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -Iosdep/mac -I/usr/local/Cellar/libass/0.17.3/include -I/usr/local/Cellar/libunibreak/6.1/include -I/usr/local/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fribidi/1.0.16/include/fribidi -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/include -I/usr/local/Cellar/libplacebo/7.349.0/include -I/usr/local/Cellar/shaderc/2024.4/include -I/usr/local/Cellar/vulkan-loader/1.4.304/../../../opt/vulkan-headers/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/libbluray/1.3.4/include -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/include/luajit-2.1 -I/usr/local/Cellar/rubberband/4.0.0/include -I/usr/local/Cellar/libsamplerate/0.2.2/include -I/usr/local/Cellar/zimg/3.0.5/include -I/usr/local/opt/jpeg-turbo/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -MD -MQ libmpv.2.dylib.p/video_out_hwdec_hwdec_vt_pl.m.o -MF libmpv.2.dylib.p/video_out_hwdec_hwdec_vt_pl.m.o.d -o libmpv.2.dylib.p/video_out_hwdec_hwdec_vt_pl.m.o -c ../video/out/hwdec/hwdec_vt_pl.m
[240/244] clang -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -Iosdep/mac -I/usr/local/Cellar/libass/0.17.3/include -I/usr/local/Cellar/libunibreak/6.1/include -I/usr/local/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fribidi/1.0.16/include/fribidi -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/include -I/usr/local/Cellar/libplacebo/7.349.0/include -I/usr/local/Cellar/shaderc/2024.4/include -I/usr/local/Cellar/vulkan-loader/1.4.304/../../../opt/vulkan-headers/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/libbluray/1.3.4/include -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/include/luajit-2.1 -I/usr/local/Cellar/rubberband/4.0.0/include -I/usr/local/Cellar/libsamplerate/0.2.2/include -I/usr/local/Cellar/zimg/3.0.5/include -I/usr/local/opt/jpeg-turbo/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -MD -MQ libmpv.2.dylib.p/osdep_mac_app_bridge.m.o -MF libmpv.2.dylib.p/osdep_mac_app_bridge.m.o.d -o libmpv.2.dylib.p/osdep_mac_app_bridge.m.o -c ../osdep/mac/app_bridge.m
FAILED: libmpv.2.dylib.p/osdep_mac_app_bridge.m.o
clang -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -Iosdep/mac -I/usr/local/Cellar/libass/0.17.3/include -I/usr/local/Cellar/libunibreak/6.1/include -I/usr/local/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fribidi/1.0.16/include/fribidi -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/include -I/usr/local/Cellar/libplacebo/7.349.0/include -I/usr/local/Cellar/shaderc/2024.4/include -I/usr/local/Cellar/vulkan-loader/1.4.304/../../../opt/vulkan-headers/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/libbluray/1.3.4/include -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/include/luajit-2.1 -I/usr/local/Cellar/rubberband/4.0.0/include -I/usr/local/Cellar/libsamplerate/0.2.2/include -I/usr/local/Cellar/zimg/3.0.5/include -I/usr/local/opt/jpeg-turbo/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -MD -MQ libmpv.2.dylib.p/osdep_mac_app_bridge.m.o -MF libmpv.2.dylib.p/osdep_mac_app_bridge.m.o.d -o libmpv.2.dylib.p/osdep_mac_app_bridge.m.o -c ../osdep/mac/app_bridge.m
In file included from ../osdep/mac/app_bridge.m:23:
./osdep/mac/swift.h:240:9: fatal error: '/var/folders/xd/2_73x_qj2nb5dv9jlj_xrb8c0000gn/T/TemporaryDirectory.I5Lv4x/app_bridge_objc-1.pch' file not found
#import "/var/folders/xd/2_73x_qj2nb5dv9jlj_xrb8c0000gn/T/TemporaryDirectory.I5Lv4x/app_bridge_objc-1.pch"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of parameters, and conditions used in "Reproduction Steps".
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
@Akemi
Copy link
Member

Akemi commented Dec 29, 2024

can be reproduced on macOS 13 runner + xcode 14.2, see #15594 and https://github.com/mpv-player/mpv/actions/runs/12535858622/job/34958203214?pr=15594

@NekoAsakura any idea on this one?

@jdp1024 also on a side note, for future issues please post the whole build + configuration log and not just an excerpt of the error. it's important to have all informations we can get.

@Akemi
Copy link
Member

Akemi commented Dec 29, 2024

the above error can be circumvented (temporarily) by setting -disable-bridging-pch to the swift flags. though it leads to another error.

seems like the temp path used for the generation of bridging PCH files is not writable/readable or something. path comes from getconf DARWIN_USER_TEMP_DIR.

new error might be related to

ld: warning: -undefined dynamic_lookup may not work with chained fixups

@Akemi Akemi added the os:mac label Dec 29, 2024
@Akemi
Copy link
Member

Akemi commented Dec 29, 2024

i have a feeling we are hitting a linker bug here. especially when newer build tools don't exhibit this problem.

FAILED: libmpv.2.dylib 
clang  -o libmpv.2.dylib osdep/mac/swift.o libmpv.2.dylib.p/audio_aframe.c.o libmpv.2.dylib.p/audio_chmap.c.o libmpv.2.dylib.p/audio_chmap_avchannel.c.o libmpv.2.dylib.p/audio_chmap_sel.c.o libmpv.2.dylib.p/audio_decode_ad_lavc.c.o libmpv.2.dylib.p/audio_decode_ad_spdif.c.o libmpv.2.dylib.p/audio_filter_af_drop.c.o libmpv.2.dylib.p/audio_filter_af_format.c.o libmpv.2.dylib.p/audio_filter_af_lavcac3enc.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo2.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo2_internals.c.o libmpv.2.dylib.p/audio_fmt-conversion.c.o libmpv.2.dylib.p/audio_format.c.o libmpv.2.dylib.p/audio_out_ao.c.o libmpv.2.dylib.p/audio_out_ao_lavc.c.o libmpv.2.dylib.p/audio_out_ao_null.c.o libmpv.2.dylib.p/audio_out_ao_pcm.c.o libmpv.2.dylib.p/audio_out_buffer.c.o libmpv.2.dylib.p/common_av_common.c.o libmpv.2.dylib.p/common_av_log.c.o libmpv.2.dylib.p/common_codecs.c.o libmpv.2.dylib.p/common_common.c.o libmpv.2.dylib.p/common_encode_lavc.c.o libmpv.2.dyl
ld: warning: -undefined dynamic_lookup may not work with chained fixups
0  0x10a06df7a  __assert_rtn + 139
1  0x10a079a33  ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) (.cold.2) + 35
2  0x109f5e187  ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) + 247
3  0x109f5d5bc  ld::tool::SymbolTableAtom<x86_64>::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 124
4  0x109f5cc27  ld::tool::SymbolTableAtom<x86_64>::encode() + 519
5  0x109f5047e  ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke_3 + 30
6  0x7ff81a554d91  _dispatch_call_block_and_release + 12
7  0x7ff81a556033  _dispatch_client_callout + 8
8  0x7ff81a56622a  _dispatch_root_queue_drain + 991
9  0x7ff81a566768  _dispatch_worker_thread2 + 170
10  0x7ff81a6f3c0f  _pthread_wqthread + 257
A linker snapshot was created at:
	/tmp/libmpv.2.dylib-2024-12-29-143316.ld-snapshot
ld: Assertion failed: (it != _dylibToOrdinal.end()), function dylibToOrdinal, file OutputFile.cpp, line 5133.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[284/287] Linking target mpv
FAILED: mpv 
clang  -o mpv osdep/mac/swift.o libmpv.2.dylib.p/audio_aframe.c.o libmpv.2.dylib.p/audio_chmap.c.o libmpv.2.dylib.p/audio_chmap_avchannel.c.o libmpv.2.dylib.p/audio_chmap_sel.c.o libmpv.2.dylib.p/audio_decode_ad_lavc.c.o libmpv.2.dylib.p/audio_decode_ad_spdif.c.o libmpv.2.dylib.p/audio_filter_af_drop.c.o libmpv.2.dylib.p/audio_filter_af_format.c.o libmpv.2.dylib.p/audio_filter_af_lavcac3enc.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo2.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo2_internals.c.o libmpv.2.dylib.p/audio_fmt-conversion.c.o libmpv.2.dylib.p/audio_format.c.o libmpv.2.dylib.p/audio_out_ao.c.o libmpv.2.dylib.p/audio_out_ao_lavc.c.o libmpv.2.dylib.p/audio_out_ao_null.c.o libmpv.2.dylib.p/audio_out_ao_pcm.c.o libmpv.2.dylib.p/audio_out_buffer.c.o libmpv.2.dylib.p/common_av_common.c.o libmpv.2.dylib.p/common_av_log.c.o libmpv.2.dylib.p/common_codecs.c.o libmpv.2.dylib.p/common_common.c.o libmpv.2.dylib.p/common_encode_lavc.c.o libmpv.2.dylib.p/common
ld: warning: -undefined dynamic_lookup may not work with chained fixups
0  0x1039fbf7a  __assert_rtn + 139
1  0x103a07a33  ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) (.cold.2) + 35
2  0x1038ec187  ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) + 247
3  0x1038eb5bc  ld::tool::SymbolTableAtom<x86_64>::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 124
4  0x1038eac27  ld::tool::SymbolTableAtom<x86_64>::encode() + 519
5  0x1038de47e  ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke_3 + 30
6  0x7ff81a554d91  _dispatch_call_block_and_release + 12
7  0x7ff81a556033  _dispatch_client_callout + 8
8  0x7ff81a56622a  _dispatch_root_queue_drain + 991
9  0x7ff81a566768  _dispatch_worker_thread2 + 170
10  0x7ff81a6f3c0f  _pthread_wqthread + 257
A linker snapshot was created at:
	/tmp/mpv-2024-12-29-143316.ld-snapshot
ld: Assertion failed: (it != _dylibToOrdinal.end()), function dylibToOrdinal, file OutputFile.cpp, line 5133.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@NekoAsakura
Copy link
Contributor

i have a feeling we are hitting a linker bug here.

I also think the issue might be related to linker:

  1. The original build process did not use Xcode's linker.
  2. Xcode 14.2 is the last version to support macOS 12.5+(https://xcodereleases.com/?q=14C18&scope=release), but Xcode 15 introduces a new linker designed to speed up static linking. (https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking)

I’ll need some time to figure out how to resolve this issue.

@jdp1024
Copy link
Author

jdp1024 commented Dec 30, 2024

I tried -Dswift-flags="-save-temps" to keep the temp files, it did keep the files, but the pch file is not recognized.

clang -Ilibmpv.2.dylib.p -I. -I.. -Icommon -Ietc -Iplayer/javascript -Iplayer/lua -Isub -ITOOLS/osxbundle -Iosdep/mac -I/usr/local/Cellar/libass/0.17.3/include -I/usr/local/Cellar/libunibreak/6.1/include -I/usr/local/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/usr/local/Cellar/glib/2.82.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.82.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.44/include -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fribidi/1.0.16/include/fribidi -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/include -I/usr/local/Cellar/libplacebo/7.349.0/include -I/usr/local/Cellar/shaderc/2024.4/include -I/usr/local/Cellar/vulkan-loader/1.4.304/../../../opt/vulkan-headers/include -I/usr/local/Cellar/little-cms2/2.16/include -I/usr/local/Cellar/libbluray/1.3.4/include -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/include/luajit-2.1 -I/usr/local/Cellar/rubberband/4.0.0/include -I/usr/local/Cellar/libsamplerate/0.2.2/include -I/usr/local/Cellar/zimg/3.0.5/include -I/usr/local/opt/jpeg-turbo/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=c11 -O2 -g -D_FILE_OFFSET_BITS=64 -Wdisabled-optimization -Wempty-body -Wformat -Wimplicit-fallthrough -Wparentheses -Wpointer-arith -Wshadow -Wundef -Wvla -Wno-cast-function-type -Wno-format-zero-length -Wno-missing-field-initializers -Wno-sign-compare -Wno-switch -Wno-unused-parameter -fno-math-errno -fno-signed-zeros -fno-trapping-math -Werror=format-security -D_GNU_SOURCE -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Wno-pointer-sign -MD -MQ libmpv.2.dylib.p/player_clipboard_clipboard-mac.m.o -MF libmpv.2.dylib.p/player_clipboard_clipboard-mac.m.o.d -o libmpv.2.dylib.p/player_clipboard_clipboard-mac.m.o -c ../player/clipboard/clipboard-mac.m
In file included from ../player/clipboard/clipboard-mac.m:19:
In file included from ./osdep/mac/swift.h:240:
/var/folders/xd/2_73x_qj2nb5dv9jlj_xrb8c0000gn/T/TemporaryDirectory.q3Pq9q/app_bridge_objc-1.pch:1:1: error: source file is not valid UTF-8
<CF><FA><ED><FE><U+0007><U+0000><U+0000><U+0001><U+0003><U+0000><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0004><U+0000><U+0000><U+0000>8<U+0004><U+0000><U+0000><U+0000> <U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0019><U+0000><U+0000><U+0000><B8><U+0003><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>

@Akemi
Copy link
Member

Akemi commented Dec 31, 2024

@NekoAsakura i hoped that there might be some easy fix for this, flag or something (to the clang linker/compiler, llvm etc -Xcc, -Xclang-linker, -Xlinker, -Xllvm). if it is too much work it might not be worth it because see below. i already invested more than a day already.

this issue has pretty low priority and might not be fixed at all, because:

  • we only support the latest 3 macOS versions (same as Apple and homebrew) for building (running i still macOS 10.15)
  • there is no issue on macOS 13 with the latest build tools (xcode 15)
  • we plan to add support for swift 6, drop swift 4 and older swift 5 versions, swift 5.8 might get mandatory and with that xcode 15 is also mandatory

@Akemi
Copy link
Member

Akemi commented Dec 31, 2024

also might be interesting, though might be obvious (since it requests the classic/old linker). when adding -ld64 to our linker flags i can reproduce the same/similar error:

add_project_link_arguments(['-ld64'], language: ['c', 'objc'])
FAILED: mpv 
cc  -o mpv osdep/mac/swift.o libmpv.2.dylib.p/audio_aframe.c.o libmpv.2.dylib.p/audio_chmap.c.o libmpv.2.dylib.p/audio_chmap_avchannel.c.o libmpv.2.dylib.p/audio_chmap_sel.c.o libmpv.2.dylib.p/audio_decode_ad_lavc.c.o libmpv.2.dylib.p/audio_decode_ad_spdif.c.o libmpv.2.dylib.p/audio_filter_af_drop.c.o libmpv.2.dylib.p/audio_filter_af_format.c.o libmpv.2.dylib.p/audio_filter_af_lavcac3enc.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo2.c.o libmpv.2.dylib.p/audio_filter_af_scaletempo2_internals.c.o libmpv.2.dylib.p/audio_fmt-conversion.c.o libmpv.2.dylib.p/audio_format.c.o libmpv.2.dylib.p/audio_out_ao.c.o libmpv.2.dylib.p/audio_out_ao_lavc.c.o libmpv.2.dylib.p/audio_out_ao_null.c.o libmpv.2.dylib.p/audio_out_ao_pcm.c.o libmpv.2.dylib.p/audio_out_buffer.c.o libmpv.2.dylib.p/common_av_common.c.o libmpv.2.dylib.p/common_av_log.c.o libmpv.2.dylib.p/common_codecs.c.o libmpv.2.dylib.p/common_common.c.o libmpv.2.dylib.p/common_encode_lavc.c.o libmpv.2.dylib.p/common_msg.c.o libmpv.2.dylib.p/common_playlist.c.o libmpv.2.dylib.p/common_recorder.c.o libmpv.2.dylib.p/common_stats.c.o libmpv.2.dylib.p/common_tags.c.o libmpv.2.dylib.p/common_version.c.o libmpv.2.dylib.p/demux_codec_tags.c.o libmpv.2.dylib.p/demux_cue.c.o libmpv.2.dylib.p/demux_cache.c.o libmpv.2.dylib.p/demux_demux.c.o libmpv.2.dylib.p/demux_demux_cue.c.o libmpv.2.dylib.p/demux_demux_disc.c.o libmpv.2.dylib.p/demux_demux_edl.c.o libmpv.2.dylib.p/demux_demux_lavf.c.o libmpv.2.dylib.p/demux_demux_mf.c.o libmpv.2.dylib.p/demux_demux_mkv.c.o libmpv.2.dylib.p/demux_demux_mkv_timeline.c.o libmpv.2.dylib.p/demux_demux_null.c.o libmpv.2.dylib.p/demux_demux_playlist.c.o libmpv.2.dylib.p/demux_demux_raw.c.o libmpv.2.dylib.p/demux_demux_timeline.c.o libmpv.2.dylib.p/demux_ebml.c.o libmpv.2.dylib.p/demux_packet.c.o libmpv.2.dylib.p/demux_timeline.c.o libmpv.2.dylib.p/filters_f_async_queue.c.o libmpv.2.dylib.p/filters_f_autoconvert.c.o libmpv.2.dylib.p/filters_f_auto_filters.c.o libmpv.2.dylib.p/filters_f_decoder_wrapper.c.o libmpv.2.dylib.p/filters_f_demux_in.c.o libmpv.2.dylib.p/filters_f_hwtransfer.c.o libmpv.2.dylib.p/filters_f_lavfi.c.o libmpv.2.dylib.p/filters_f_output_chain.c.o libmpv.2.dylib.p/filters_f_swresample.c.o libmpv.2.dylib.p/filters_f_swscale.c.o libmpv.2.dylib.p/filters_f_utils.c.o libmpv.2.dylib.p/filters_filter.c.o libmpv.2.dylib.p/filters_frame.c.o libmpv.2.dylib.p/filters_user_filters.c.o libmpv.2.dylib.p/input_cmd.c.o libmpv.2.dylib.p/input_event.c.o libmpv.2.dylib.p/input_input.c.o libmpv.2.dylib.p/input_ipc.c.o libmpv.2.dylib.p/input_keycodes.c.o libmpv.2.dylib.p/misc_bstr.c.o libmpv.2.dylib.p/misc_charset_conv.c.o libmpv.2.dylib.p/misc_codepoint_width.c.o libmpv.2.dylib.p/misc_dispatch.c.o libmpv.2.dylib.p/misc_io_utils.c.o libmpv.2.dylib.p/misc_json.c.o libmpv.2.dylib.p/misc_language.c.o libmpv.2.dylib.p/misc_natural_sort.c.o libmpv.2.dylib.p/misc_node.c.o libmpv.2.dylib.p/misc_path_utils.c.o libmpv.2.dylib.p/misc_random.c.o libmpv.2.dylib.p/misc_rendezvous.c.o libmpv.2.dylib.p/misc_thread_pool.c.o libmpv.2.dylib.p/misc_thread_tools.c.o libmpv.2.dylib.p/options_m_config_core.c.o libmpv.2.dylib.p/options_m_config_frontend.c.o libmpv.2.dylib.p/options_m_option.c.o libmpv.2.dylib.p/options_m_property.c.o libmpv.2.dylib.p/options_options.c.o libmpv.2.dylib.p/options_parse_commandline.c.o libmpv.2.dylib.p/options_parse_configfile.c.o libmpv.2.dylib.p/options_path.c.o libmpv.2.dylib.p/player_audio.c.o libmpv.2.dylib.p/player_client.c.o libmpv.2.dylib.p/player_command.c.o libmpv.2.dylib.p/player_configfiles.c.o libmpv.2.dylib.p/player_external_files.c.o libmpv.2.dylib.p/player_loadfile.c.o libmpv.2.dylib.p/player_main.c.o libmpv.2.dylib.p/player_misc.c.o libmpv.2.dylib.p/player_osd.c.o libmpv.2.dylib.p/player_playloop.c.o libmpv.2.dylib.p/player_screenshot.c.o libmpv.2.dylib.p/player_scripting.c.o libmpv.2.dylib.p/player_sub.c.o libmpv.2.dylib.p/player_video.c.o libmpv.2.dylib.p/player_clipboard_clipboard.c.o libmpv.2.dylib.p/player_clipboard_clipboard-vo.c.o libmpv.2.dylib.p/stream_cookies.c.o libmpv.2.dylib.p/stream_stream.c.o libmpv.2.dylib.p/stream_stream_avdevice.c.o libmpv.2.dylib.p/stream_stream_cb.c.o libmpv.2.dylib.p/stream_stream_concat.c.o libmpv.2.dylib.p/stream_stream_edl.c.o libmpv.2.dylib.p/stream_stream_file.c.o libmpv.2.dylib.p/stream_stream_lavf.c.o libmpv.2.dylib.p/stream_stream_memory.c.o libmpv.2.dylib.p/stream_stream_mf.c.o libmpv.2.dylib.p/stream_stream_null.c.o libmpv.2.dylib.p/stream_stream_slice.c.o libmpv.2.dylib.p/sub_ass_mp.c.o libmpv.2.dylib.p/sub_dec_sub.c.o libmpv.2.dylib.p/sub_draw_bmp.c.o libmpv.2.dylib.p/sub_filter_sdh.c.o libmpv.2.dylib.p/sub_img_convert.c.o libmpv.2.dylib.p/sub_lavc_conv.c.o libmpv.2.dylib.p/sub_osd.c.o libmpv.2.dylib.p/sub_osd_libass.c.o libmpv.2.dylib.p/sub_sd_ass.c.o libmpv.2.dylib.p/sub_sd_lavc.c.o libmpv.2.dylib.p/video_csputils.c.o libmpv.2.dylib.p/video_decode_vd_lavc.c.o libmpv.2.dylib.p/video_filter_refqueue.c.o libmpv.2.dylib.p/video_filter_vf_format.c.o libmpv.2.dylib.p/video_filter_vf_sub.c.o libmpv.2.dylib.p/video_fmt-conversion.c.o libmpv.2.dylib.p/video_hwdec.c.o libmpv.2.dylib.p/video_image_loader.c.o libmpv.2.dylib.p/video_image_writer.c.o libmpv.2.dylib.p/video_img_format.c.o libmpv.2.dylib.p/video_mp_image.c.o libmpv.2.dylib.p/video_mp_image_pool.c.o libmpv.2.dylib.p/video_out_aspect.c.o libmpv.2.dylib.p/video_out_bitmap_packer.c.o libmpv.2.dylib.p/video_out_dither.c.o libmpv.2.dylib.p/video_out_dr_helper.c.o libmpv.2.dylib.p/video_out_filter_kernels.c.o libmpv.2.dylib.p/video_out_gpu_context.c.o libmpv.2.dylib.p/video_out_gpu_error_diffusion.c.o libmpv.2.dylib.p/video_out_gpu_hwdec.c.o libmpv.2.dylib.p/video_out_gpu_lcms.c.o libmpv.2.dylib.p/video_out_gpu_libmpv_gpu.c.o libmpv.2.dylib.p/video_out_gpu_osd.c.o libmpv.2.dylib.p/video_out_gpu_ra.c.o libmpv.2.dylib.p/video_out_gpu_shader_cache.c.o libmpv.2.dylib.p/video_out_gpu_spirv.c.o libmpv.2.dylib.p/video_out_gpu_user_shaders.c.o libmpv.2.dylib.p/video_out_gpu_utils.c.o libmpv.2.dylib.p/video_out_gpu_video.c.o libmpv.2.dylib.p/video_out_gpu_video_shaders.c.o libmpv.2.dylib.p/video_out_libmpv_sw.c.o libmpv.2.dylib.p/video_out_vo.c.o libmpv.2.dylib.p/video_out_vo_gpu.c.o libmpv.2.dylib.p/video_out_vo_image.c.o libmpv.2.dylib.p/video_out_vo_lavc.c.o libmpv.2.dylib.p/video_out_vo_libmpv.c.o libmpv.2.dylib.p/video_out_vo_null.c.o libmpv.2.dylib.p/video_out_vo_tct.c.o libmpv.2.dylib.p/video_out_vo_kitty.c.o libmpv.2.dylib.p/video_out_win_state.c.o libmpv.2.dylib.p/video_repack.c.o libmpv.2.dylib.p/video_sws_utils.c.o libmpv.2.dylib.p/video_out_placebo_ra_pl.c.o libmpv.2.dylib.p/video_out_placebo_utils.c.o libmpv.2.dylib.p/video_out_vo_gpu_next.c.o libmpv.2.dylib.p/video_out_gpu_next_context.c.o libmpv.2.dylib.p/osdep_io.c.o libmpv.2.dylib.p/osdep_subprocess.c.o libmpv.2.dylib.p/osdep_timer.c.o libmpv.2.dylib.p/ta_ta.c.o libmpv.2.dylib.p/ta_ta_talloc.c.o libmpv.2.dylib.p/ta_ta_utils.c.o libmpv.2.dylib.p/osdep_threads-posix.c.o libmpv.2.dylib.p/osdep_language-mac.c.o libmpv.2.dylib.p/osdep_path-mac.m.o libmpv.2.dylib.p/osdep_utils-mac.c.o libmpv.2.dylib.p/osdep_mac_app_bridge.m.o libmpv.2.dylib.p/player_clipboard_clipboard-mac.m.o libmpv.2.dylib.p/osdep_subprocess-posix.c.o libmpv.2.dylib.p/input_ipc-unix.c.o libmpv.2.dylib.p/osdep_poll_wrapper.c.o libmpv.2.dylib.p/osdep_terminal-unix.c.o libmpv.2.dylib.p/sub_filter_regex.c.o libmpv.2.dylib.p/osdep_path-darwin.c.o libmpv.2.dylib.p/osdep_timer-darwin.c.o libmpv.2.dylib.p/player_javascript.c.o libmpv.2.dylib.p/sub_filter_jsre.c.o libmpv.2.dylib.p/stream_stream_bluray.c.o libmpv.2.dylib.p/player_lua.c.o libmpv.2.dylib.p/audio_filter_af_rubberband.c.o libmpv.2.dylib.p/video_filter_vf_fingerprint.c.o libmpv.2.dylib.p/video_zimg.c.o libmpv.2.dylib.p/audio_out_ao_avfoundation.m.o libmpv.2.dylib.p/audio_out_ao_coreaudio.c.o libmpv.2.dylib.p/audio_out_ao_coreaudio_exclusive.c.o libmpv.2.dylib.p/audio_out_ao_coreaudio_properties.c.o libmpv.2.dylib.p/audio_out_ao_coreaudio_chmap.c.o libmpv.2.dylib.p/audio_out_ao_coreaudio_utils.c.o libmpv.2.dylib.p/video_out_opengl_common.c.o libmpv.2.dylib.p/video_out_opengl_context.c.o libmpv.2.dylib.p/video_out_opengl_formats.c.o libmpv.2.dylib.p/video_out_opengl_libmpv_gl.c.o libmpv.2.dylib.p/video_out_opengl_ra_gl.c.o libmpv.2.dylib.p/video_out_opengl_utils.c.o libmpv.2.dylib.p/video_out_hwdec_hwdec_vulkan.c.o libmpv.2.dylib.p/video_out_vulkan_context.c.o libmpv.2.dylib.p/video_out_vulkan_utils.c.o libmpv.2.dylib.p/video_filter_vf_gpu_vulkan.c.o libmpv.2.dylib.p/video_out_vulkan_context_display.c.o libmpv.2.dylib.p/video_filter_vf_gpu.c.o libmpv.2.dylib.p/video_out_hwdec_hwdec_vt.c.o libmpv.2.dylib.p/video_out_hwdec_hwdec_mac_gl.c.o libmpv.2.dylib.p/video_out_hwdec_hwdec_vt_pl.m.o libmpv.2.dylib.p/video_out_vulkan_context_mac.m.o mpv.p/osdep_main-fn-mac.c.o -L/usr/lib -L/usr/local/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -L/usr/lib/swift -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,dynamic_lookup -rdynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -ld64 -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -rdynamic -Xlinker -add_ast_path -Xlinker /Users/Akemi/Projects/mpv/build/osdep/mac/swift.swiftmodule -Xlinker -rpath -Xlinker /usr/lib/swift -Wl,-rpath,/opt/homebrew/Cellar/libass/0.17.3/lib -Wl,-rpath,/opt/homebrew/Cellar/ffmpeg/7.1_3/lib -Wl,-rpath,/opt/homebrew/lib -Wl,-rpath,/opt/homebrew/Cellar/mujs/1.3.5/lib -Wl,-rpath,/opt/homebrew/Cellar/little-cms2/2.16/lib -Wl,-rpath,/opt/homebrew/Cellar/libbluray/1.3.4/lib -Wl,-rpath,/opt/homebrew/Cellar/luajit/2.1.1725453128/lib -Wl,-rpath,/opt/homebrew/Cellar/rubberband/4.0.0/lib -Wl,-rpath,/opt/homebrew/Cellar/libsamplerate/0.2.2/lib -Wl,-rpath,/opt/homebrew/Cellar/uchardet/0.0.8/lib -Wl,-rpath,/opt/homebrew/Cellar/zimg/3.0.5/lib -Wl,-rpath,/opt/homebrew/opt/jpeg-turbo/lib -Wl,-rpath,/usr/local/lib /opt/homebrew/Cellar/libass/0.17.3/lib/libass.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libavcodec.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libavfilter.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libavformat.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libavutil.dylib /opt/homebrew/lib/libplacebo.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libswresample.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libswscale.dylib -framework Cocoa -framework IOKit -framework QuartzCore -liconv /opt/homebrew/Cellar/mujs/1.3.5/lib/libmujs.dylib /opt/homebrew/Cellar/little-cms2/2.16/lib/liblcms2.dylib /opt/homebrew/Cellar/ffmpeg/7.1_3/lib/libavdevice.dylib /opt/homebrew/Cellar/libbluray/1.3.4/lib/libbluray.dylib -lm /opt/homebrew/Cellar/luajit/2.1.1725453128/lib/libluajit-5.1.dylib /opt/homebrew/Cellar/rubberband/4.0.0/lib/librubberband.dylib -framework Accelerate /opt/homebrew/Cellar/libsamplerate/0.2.2/lib/libsamplerate.dylib /opt/homebrew/Cellar/uchardet/0.0.8/lib/libuchardet.dylib /opt/homebrew/Cellar/zimg/3.0.5/lib/libzimg.dylib -lz -framework CoreMedia -framework AVFoundation -framework CoreFoundation -framework CoreAudio -framework AudioUnit -framework AudioToolbox /opt/homebrew/opt/jpeg-turbo/lib/libjpeg.dylib -framework OpenGL /usr/local/lib/libvulkan.dylib -framework CoreVideo
ld: warning: -ld_classic is deprecated and will be removed in a future release
0  0x104c13ee4  __assert_rtn + 160
1  0x104c16d40  ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) (.cold.3) + 0
2  0x104b0c990  ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) + 176
3  0x104b0e430  ld::tool::SymbolTableAtom<arm64>::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 204
4  0x104b131d8  ld::tool::SymbolTableAtom<arm64>::encode() + 436
5  0x104b003bc  ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke.413 + 36
6  0x188b83750  _dispatch_call_block_and_release + 32
7  0x188b853e8  _dispatch_client_callout + 20
8  0x188b97108  _dispatch_root_queue_drain + 1000
9  0x188b976b8  _dispatch_worker_thread2 + 156
10  0x188d31fd0  _pthread_wqthread + 228
A linker snapshot was created at:
	/tmp/mpv-2024-12-31-124805.ld-snapshot
ld: Assertion failed: (it != _dylibToOrdinal.end()), function dylibToOrdinal, file OutputFile.cpp, line 5184.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Could not rebuild /Users/Akemi/Projects/mpv/build

@NekoAsakura
Copy link
Contributor

I was trying to trace which part is responsible for generating that .pch file but haven’t found any useful clues so far. I will keep an eye on it.

Anyway, happy new year :)

@jdp1024
Copy link
Author

jdp1024 commented Jan 1, 2025

I was trying to trace which part is responsible for generating that .pch file but haven’t found any useful clues so far. I will keep an eye on it.

Anyway, happy new year :)

I know it's difficult to maintain for many OS versions, but there is something special about old Intel Macs: macOS 13/14/15 are all too heavy for them, some functions are limited, and the drivers are suboptimal. A working version of a daily-use tool like mpv means a lot.

Happy new year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants