This is exactly the same problem I'm having with a dynamically linked C++ (extern "C") plugin of mine, which links dynamically with ALSA through PortAudio. I made a not so aptly titled post about it earlier, "Problem with __OLD_GET". I was still a bit confused as to what was going on .. :)
Regards
Arve Knudsen
On Fri, 16 Jan 2004 20:02:00 +0100 (CET), Rene Rebe <[EMAIL PROTECTED]> wrote:
Hi all,
we experience a fairly strange problem with the versioned symbols in the libasound.so. We have a C++ wrapper library which is normally linked as shared obkect, too. But for some strange reasonsthe linker does not map stuff like "snd_pcm_hw_params_get_channels_max" and friends (with a pointer to the val at the end, now) to the correct symbol.
Of course when linked statically into a single binary it works fine.
Example log of some testing:
Let's link a normal object and a shared obeject of the ALSAHelper:
[EMAIL PROTECTED]:~/develop/trunk/lowlevel/src$ g++ -g -Wall -I. -I../include -I../../dam/include -I../../utility/include -c -o ALSAHelper.o ALSAHelper.cc
[EMAIL PROTECTED]:~/develop/trunk/lowlevel/src$ g++ --shared -g -Wall -I. -I../include -I../../dam/include -I../../utility/include -o ALSAHelper.so ALSAHelper.cc
And now let's link the test application:
First the shared object:
[EMAIL PROTECTED]:~/develop/trunk2/lowlevel/tests$ g++ -g -Wall -I. -I../include -I../../dam/include -I../../utility/include -o ALSAHelper ALSAHelper.cc ../src/ALSAHelper.so -lasound
[EMAIL PROTECTED]:~/develop/trunk2/lowlevel/tests$ ./ALSAHelper Format 16 bit Channels min: 268513264 Channels max: 268513264 Rate min: 0 Rate max: 0 Periods min: 0 Periods max: 0 Period Size: 0 Get periods: 0
Hm - quite incorrect values - let's see which symbol is used:
gdb) bt
#0 0x0ff433f0 in __old_snd_pcm_hw_params_get_channels_max (params=0x10013498)
at pcm.c:6407
#1 0x0ffdc438 in GSMP::ALSAPCM::GetChannelsMax() (this=0x7ffff4e0)
at ALSAHelper.cc:342
#2 0x10002238 in main () at ALSAHelper.cc:67
Hm - but it works fine linked statically with the normal obcject:
[EMAIL PROTECTED]:~/develop/trunk2/lowlevel/tests$ g++ -g -Wall -I. -I../include -I../../dam/include -I../../utility/include -o ALSAHelper ALSAHelper.cc ../src/ALSAHelper.o -lasound
[EMAIL PROTECTED]:~/develop/trunk2/lowlevel/tests$ ./ALSAHelper Format 16 bit Channels min: 2 Channels max: 2 Rate min: 44100 Rate max: 48000 Periods min: 1 Periods max: 32 Period Size: 2048 Get periods: 4
;-) - and which symbol is used:
(gdb) bt
#0 __snd_pcm_hw_params_get_channels_max (params=0x10017f68, val=0x7fffe48c)
at pcm.c:3334
#1 0x10003cac in GSMP::ALSAPCM::GetChannelsMax() (this=0x7ffff4e0)
at ALSAHelper.cc:342
#2 0x10001c00 in main () at ALSAHelper.cc:67
Any idea what is happening to ALSA's symbol versioning using shared objects?
In the case it matters, this is all on PowerPC (ROCK Linux) ...
gcc (GCC) 3.2.3 GNU C Library stable release version 2.3.2, by Roland McGrath et al. GNU ld version 2.14.90.0.4.1 20030523 GNU assembler 2.14.90.0.4.1 20030523
Thanks in advance - yours, René
-- René Rebe - Europe/Germany/Berlin [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.rocklinux.org http://www.rocklinux-consulting.de http://gsmp.tfh-berlin.de/gsmp http://gsmp.tfh-berlin.de/rene
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel