Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915041 - media-sound/audacity-3.3.3 fails to build with clang-17: ld.lld: error: undefined symbol: typeinfo for wxNavigationEnabled<wxWindow>
Summary: media-sound/audacity-3.3.3 fails to build with clang-17: ld.lld: error: undef...
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Professional Audio Applications Maintainers
URL:
Whiteboard: fixed in 3.7.0
Keywords: PATCH
Depends on:
Blocks: 912821
  Show dependency tree
 
Reported: 2023-10-01 16:30 UTC by ppw0
Modified: 2024-11-03 10:41 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (media-sound:audacity-3.3.3:20231001-162117.log.gz,126.98 KB, application/gzip)
2023-10-01 16:31 UTC, ppw0
Details
emerge --info (emerge_info.log,7.36 KB, text/x-log)
2023-10-01 16:31 UTC, ppw0
Details
audacity-3.3.3-drop-template.patch (audacity-3.3.3-drop-template.patch,415 bytes, patch)
2023-10-01 19:26 UTC, ppw0
Details | Diff
Updated patch for 3.7.0 (0001-Do-not-include-template-on-Unix-to-fix-clang-compile.patch,824 bytes, patch)
2024-11-01 05:00 UTC, David Carlos Manuelda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ppw0 2023-10-01 16:30:18 UTC
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.
Comment 1 ppw0 2023-10-01 16:31:09 UTC
Created attachment 871946 [details]
build log
Comment 2 ppw0 2023-10-01 16:31:33 UTC
Created attachment 871947 [details]
emerge --info
Comment 3 ppw0 2023-10-01 19:26:54 UTC
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).
Comment 4 ppw0 2023-10-02 02:26:50 UTC
(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.
Comment 5 Pablo Cholaky 2024-03-27 05:00:21 UTC
(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
Comment 6 ppw0 2024-04-02 03:22:06 UTC
> 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.
Comment 7 Markus Peloquin 2024-05-23 09:07:05 UTC
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).
Comment 8 ppw0 2024-07-19 09:12:59 UTC
(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.
Comment 9 Markus Peloquin 2024-08-08 09:12:42 UTC
(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.)
Comment 10 ppw0 2024-08-12 22:29:42 UTC
(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).
Comment 11 Vic Kerr (wikky) 2024-09-04 21:57:08 UTC
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.
Comment 12 David Carlos Manuelda 2024-11-01 05:00:18 UTC
Created attachment 907499 [details, diff]
Updated patch for 3.7.0
Comment 13 Larry the Git Cow gentoo-dev 2024-11-01 06:29:47 UTC
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(+)
Comment 14 Miroslav Šulc gentoo-dev 2024-11-01 06:30:31 UTC
thanks David