Gentoo Archives: gentoo-embedded

From: Matthijs Kooijman <matthijs@×××××.nl>
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] Versioned symbols break alsa-lib
Date: Sun, 06 Jan 2008 17:52:43
Message-Id: 20080106175238.GD20593@katherina.student.utwente.nl
1 Hey,
2
3 I've been trying to get alsa to work with uclibc and found out that it breaks
4 against uclibc when using versioned symbols.
5
6 As far as I understand, uclibc doesn't support versioned symbols. However, the
7 default gentoo-embedded toolchain is happy to compile binaries with versioned
8 symbols. So, there are no problems at compile or link time.
9
10 However, at runtime, the dynamic module loader (I think?) ignores the versions
11 on symbols and just picks some symbol to link against. In my case, pulseaudio
12 linked against the symbols from the old alsa api (so not even the default
13 version). This resulted in some hard to debug breakage.
14
15 The solution to this problem turned out to be compiling alsa-lib with
16 --without-versioned. This way, only the default version of each symbol is
17 compiled, and no version information is added.
18
19 Now, how to fix this for real? I have thought of a number of options.
20
21 1. Add an alsa-compat use flag to alsa-libs. Only compile also with
22 --with-versioned if this flag is defined. It makes sense to add this
23 useflag, since the versioning of symbols is only (?) needed to support
24 clients that use the old alsa API. Adding alsa-compat to use.mask in the
25 uclibc profile solves the problem.
26
27 I don't really like this option because it doesn't really define the
28 actual problem (Instead of not compiling with versioned symbols, you're
29 disabling the old API, which just happens to be the same). Also, this
30 addresses the problem only for alsa-lib, while I expect there to be more
31 packages with problems.
32
33 2. Add a symver (global?) useflag. This usefalg does the same as the
34 alsa-compat flag above, but has a more appropriate meaning. By making it
35 global, any other packages that show this problem can be fixed in a
36 consistent way.
37
38 I like this option, because it solves the actual problem. I'm not really
39 sure how Gentoo works with adding use flags like these, though.
40
41 3. Modify the configure script of alsa-lib (probably upstream). The current
42 configure script checks if the version of libtool is 1.3 or higher. If so,
43 versioned symbols are enabled. Perhaps adding an explicit uclibc check here
44 could help, or some other way to check for symbol versions exists or can be
45 created. This solution might be a problem if uclibc introduces versioned
46 symbols later on (I think there were some long term plans, though I'm not
47 sure).
48
49 Any thoughts?
50
51 Gr.
52
53 Matthijs

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies