Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915207 - media-libs/libpulse-16.1-r2 fails to link with clang-17: ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_glib_mainloop_free' failed: symbol not defined
Summary: media-libs/libpulse-16.1-r2 fails to link with clang-17: ld.lld: error: versi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Igor V. Kovalenko
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 912821
  Show dependency tree
 
Reported: 2023-10-05 11:44 UTC by ppw0
Modified: 2023-10-06 20:15 UTC (History)
2 users (show)

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


Attachments
build log (media-libs:libpulse-16.1-r2:20231005-113110.log,111.10 KB, text/x-log)
2023-10-05 11:44 UTC, ppw0
Details
emerge --info (emerge_info.log,7.38 KB, text/x-log)
2023-10-05 11:44 UTC, ppw0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ppw0 2023-10-05 11:44:01 UTC
Created attachment 872168 [details]
build log

In a clang-17[default-libcxx] environment, media-libs/libpulse-16.1-r2 will fail to link during emerge with the following error message:
```
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_glib_mainloop_free' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_glib_mainloop_get_api' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_glib_mainloop_new' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_drain' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_flush' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_free' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_get_latency' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_new' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_read' failed: symbol not defined
ld.lld: error: version script assignment of 'PULSE_0' to symbol 'pa_simple_write' failed: symbol not defined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
```
This can be avoided by passing "-Wl,--undefined-version" to LDFLAGS.

Attaching logs.
Comment 1 ppw0 2023-10-05 11:44:25 UTC
Created attachment 872169 [details]
emerge --info
Comment 2 Igor V. Kovalenko 2023-10-05 20:07:27 UTC
see also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274111
Comment 3 Larry the Git Cow gentoo-dev 2023-10-06 12:09:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c01eccf735d0b918640ad353b338e7f58753c995

commit c01eccf735d0b918640ad353b338e7f58753c995
Author:     Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
AuthorDate: 2023-10-05 20:54:14 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-06 12:05:09 +0000

    media-libs/libpulse: Fix build with lld
    
    Pulseaudio uses the same linker version script for all library variants,
    so a few symbols remain undefined for some variants. This breaks buid with new
    lld which defaults to errors with undefined symbols in linker version scripts.
    
    Fix this by adding -Wl,--undefined-version to linker flags.
    See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274111
    
    Closes: https://bugs.gentoo.org/915207
    Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/libpulse/libpulse-16.1-r3.ebuild | 215 ++++++++++++++++++++++++++++
 1 file changed, 215 insertions(+)