Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 933348

Summary: media-video/vlc-3.0.20-r11: fails to build on clang+arm64 with undefined symbol: __aarch64_ldadd4_acq_rel
Product: Gentoo Linux Reporter: kit <ludicrous_train>
Component: Current packagesAssignee: Gentoo Media-video project <media-video>
Status: UNCONFIRMED ---    
Severity: normal CC: ludicrous_train
Priority: Normal    
Version: unspecified   
Hardware: ARM64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log.gz
emerge --info

Description kit 2024-06-01 08:58:39 UTC
Created attachment 894770 [details]
build.log.gz

Trying to build vlc on a clang arm64 system fails with

ld.lld: error: undefined symbol: __aarch64_ldadd4_acq_rel
>>> referenced by dialogs_provider.cpp
>>>               gui/qt/.libs/libqt_plugin_la-dialogs_provider.o:(DialogsProvider::getOpenURL(QWidget*, QString const&, QUrl const&, QString const&, QString*))
>>> referenced by dialogs_provider.cpp
>>>               gui/qt/.libs/libqt_plugin_la-dialogs_provider.o:(DialogsProvider::getOpenURL(QWidget*, QString const&, QUrl const&, QString const&, QString*))
>>> referenced by dialogs_provider.cpp
>>>               gui/qt/.libs/libqt_plugin_la-dialogs_provider.o:(DialogsProvider::getOpenURL(QWidget*, QString const&, QUrl const&, QString const&, QString*))
>>> referenced 5498 more times
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

As far as I can tell, this error happens during linking of a shared library and for whatever reason libtool sticks a -nostdlib flag in there, which causes clang to not link against libclang_rt where the symbol is located.

This issue seems to be somewhat known as there's this commit that adds a patch in vlc https://code.videolan.org/videolan/vlc/-/commit/5c7092dfe6ee45f38c9ff7063678956ace155815. The commit message has a good description of the underlying issue.
Applying libtool-2.4.6-clang-libs.patch (or rather its updated version https://code.videolan.org/videolan/vlc/-/blob/3.0.20/extras/tools/libtool-2.4.6-clang-libs.patch) to vlc does not help. It seems that it gets overridden.
Applying it to gentoo's dev-build/libtool does help, however.
Comment 1 kit 2024-06-01 09:00:42 UTC
Created attachment 894771 [details]
emerge --info