[systemd-devel] Can apps ship their own copy of libudev?

Jan Engelhardt jengelh at inai.de
Fri Oct 25 11:57:25 CEST 2013


On Friday 2013-10-25 11:24, Thiago Macieira wrote:
>> Even if it isn't that "minor" of an issue, the correct thing to do here
>> is to dlopen it, as that removes this type of issue completely.
>
>That's what we'll do. It's just a sub-optimal solution, compared to direct & 
>normal linking -- which is something we need to enable for distros to do.
>
>The drawbacks of this solution are:
> - no link-time dependency for packaging tools to detect and create the
>   package dependency without intervention

Given most .run-type software bypasses package tools already,
there is not much more to lose.

> - sub-optimal resolution and calling (hand-written code worse than linker-
>   generated PLT)

How worse is it, actually?

5               void *h = dlopen("libc.so.6", RTLD_LAZY);
(gdb) n
6               int (*scmp)(const char *, const char *) = dlsym(h, "strcmp");
(gdb) 
7               return scmp(argv[0], "x.c") == 0;
(gdb) p scmp
$1 = (int (*)(const char *, const char *)) 0x7ffff7953c40 <__strcmp_ssse3>


So even though I used the, as you call it, "suboptimal" dlopen mechanism,
I do get the SSSE3-optimized variant. Can't be _that_ bad.


More information about the systemd-devel mailing list