Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 651696 - media-libs/alsa-lib-1.1.2 built with sys-devel/clang-5.0.1 - aplay: relocation error: aplay: symbol snd_pcm_hw_params_set_rate_near, version ALSA_0.9.0rc4 not defined in file libasound.so.2 with link time reference
Summary: media-libs/alsa-lib-1.1.2 built with sys-devel/clang-5.0.1 - aplay: relocatio...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo ALSA team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-27 12:33 UTC by Patrik Osgnach
Modified: 2022-12-25 10:12 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge.info.txt,5.46 KB, text/plain)
2018-03-27 12:33 UTC, Patrik Osgnach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Osgnach 2018-03-27 12:33:29 UTC
Created attachment 525660 [details]
emerge --info

Hello, if I try to build media-libs/alsa-lib-1.1.2 with sys-devel/clang-5.0.1 and then use aplay, I get this message:

cat /dev/urandom | aplay -D hw:0,0 -f S16_LE -c 2                                                                       
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
aplay: relocation error: aplay: symbol snd_pcm_hw_params_set_rate_near, version ALSA_0.9.0rc4 not defined in file libasound.so.2 with link time reference

By analysing libasound.so I get this

objdump -T /usr/lib/libasound.so | grep snd_pcm_hw_params_set_rate_near                                                 
000000000007b400 g    DF .text  0000000000000013  ALSA_0.9.0rc4 snd_pcm_hw_params_set_rate_near@@ALSA_0.9.0rc4
000000000007f0b0 g    DF .text  0000000000000027 (ALSA_0.9)   snd_pcm_hw_params_set_rate_near@ALSA_0.9
000000000007b400 g    DF .text  0000000000000013  ALSA_0.9    __snd_pcm_hw_params_set_rate_near

On the other hand, if I do the same on a libasound.so built by gcc, I get this:

objdump -T /usr/lib/libasound.so | grep snd_pcm_hw_params_set_rate_near                                                 
000000000004eb60 g    DF .text  0000000000000010  ALSA_0.9    __snd_pcm_hw_params_set_rate_near
000000000004eb60 g    DF .text  0000000000000010  ALSA_0.9.0rc4 snd_pcm_hw_params_set_rate_near
0000000000051a20 g    DF .text  0000000000000023 (ALSA_0.9)   snd_pcm_hw_params_set_rate_near

Clang appends that "@@ALSA_0.9.0rc4" to the "ALSA_0.9.0rc4" version of the symbol. Clang's flags are:

CFLAGS=-O2 -pipe -march=native -flto=thin
LDFLAGS=-Wl,-O1 -Wl,--as-needed -fuse-ld=lld

while gcc's are:

CFLAGS=-O2 -pipe -march=native -w
LDFLAGS=-Wl,-O1 -Wl,--as-needed -fuse-ld=gold

This is not a showstopper, but I thought it might be interesting for the purpose of trying to use clang/llvm to build a gentoo system (well... to build as much as possible)
Comment 1 Pacho Ramos gentoo-dev 2022-12-25 10:12:16 UTC
Please test with an updated system

Thanks