audacity-3.3.3 will fail to link under clang-17: --- ld.lld: error: undefined symbol: typeinfo for wxNavigationEnabled<wxWindow> >>> referenced by ListNavigationPanel.cpp >>> src/CMakeFiles/Audacity.dir/ListNavigationPanel.cpp.o:(typeinfo for ListNavigationEnabled<wxWindow>) clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. --- The stopgap solution is to add "-Wl,--undefined-version" to LDFLAGS. (This is a clang[default-libcxx] environment and the openmp workaround has been applied to libsoundtouch prior) Attaching logs.
Created attachment 871946 [details] build log
Created attachment 871947 [details] emerge --info
Created attachment 871967 [details, diff] audacity-3.3.3-drop-template.patch This patch resolves the error (taken from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271094).
(In reply to ppw0 from comment #0) > The stopgap solution is to add "-Wl,--undefined-version" to LDFLAGS. And to correct myself, this doesn't actually work.
(In reply to ppw0 from comment #3) > Created attachment 871967 [details, diff] [details, diff] > audacity-3.3.3-drop-template.patch > > This patch resolves the error (taken from > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271094). This works to compile, but: > /usr/bin/audacity: symbol lookup error: /usr/bin/../lib64/audacity/lib-audio-io.so: undefined symbol: __atomic_is_lock_free
> This works to compile, but: > > > /usr/bin/audacity: symbol lookup error: /usr/bin/../lib64/audacity/lib-audio-io.so: undefined symbol: __atomic_is_lock_free I don't think that's related.
Same issue on 3.4.2. I do have `-Wl,--undefined-version` in my LDFLAGS and I can see that it was, in fact, used (as some aggressive configure scripts strip things they shouldn't).
(In reply to Markus Peloquin from comment #7) > Same issue on 3.4.2. > > I do have `-Wl,--undefined-version` in my LDFLAGS and I can see that it was, > in fact, used (as some aggressive configure scripts strip things they > shouldn't). -Wl,--undefined version isn't going to help here. Apply the attached patch if you're encountering the same issue.
(In reply to ppw0 from comment #8) > -Wl,--undefined version isn't going to help here. Apply the attached patch > if you're encountering the same issue. Thanks! Not sure how I missed that. The patch worked with no package.env overrides at all. (I use clang, lld, thinLTO.)
(In reply to Pablo Cholaky from comment #5) > (In reply to ppw0 from comment #3) > > Created attachment 871967 [details, diff] [details, diff] [details, diff] > > audacity-3.3.3-drop-template.patch > > > > This patch resolves the error (taken from > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271094). > > This works to compile, but: > > > /usr/bin/audacity: symbol lookup error: /usr/bin/../lib64/audacity/lib-audio-io.so: undefined symbol: __atomic_is_lock_free This is actually a separate bug, but here's the solution anyway: link with -latomic (create an env with LDFLAGS="${LDFLAGS} -latomic" and point media-sound/audacity to it).
I can confirm that the patch allows a successful, working build of audacity 3.4.2-r1 with llvm 18. As a related issue, lld fails to link audacity against media-libs/libsoundtouch[openmp], with the following error: ld.lld: error: undefined reference due to --no-allow-shlib-undefined: __kmpc_fork_call >>> referenced by /usr/lib/libSoundTouch.so (repeated for a few other references to __kmpc_*). Just use -openmp.
Created attachment 907499 [details, diff] Updated patch for 3.7.0
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f7cbc8f74a55a157e03c90557427790bf5975bf commit 6f7cbc8f74a55a157e03c90557427790bf5975bf Author: Miroslav Šulc <fordfrog@gentoo.org> AuthorDate: 2024-11-01 06:29:35 +0000 Commit: Miroslav Šulc <fordfrog@gentoo.org> CommitDate: 2024-11-01 06:29:35 +0000 media-sound/audacity: fixed build of 3.7.0 with clang Bug: https://bugs.gentoo.org/915041 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org> media-sound/audacity/audacity-3.7.0.ebuild | 3 +++ ...clude-template-on-unix-to-fix-clang-compile.patch | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+)
thanks David