From: Mike H. <mi...@th...> - 2004-01-03 12:54:12
|
On Sat, 2004-01-03 at 00:17, Ethan Blanton wrote: > We cannot depend on ELF binaries, for starters. This patch only changes Gaims behaviour on Linux, and all Linux distros that it's interesting for Gaim to run on use ELF. > Likewise, we cannot > depend on dlopen() and family to either exist or work consistenly. Systems with broken or non-existant dladdr() are not Linux so the patch code would not be used or enabled. > Similarly, /proc may or may not exist and may or may not contain the > information you are looking for. This would be the case on very few systems - on these systems the prefix detection can simply be disabled by recompiling. > As you say, some of this can be detected at runtime (such as the lack > of /proc); the rest of it can likewise be detected at compile time > (binary format, dl*) ... but that's even uglier than the problem > you're trying to "fix", in my opinion. Detecting the presence of features at runtime is done all the time and is not ugly - Gaim already does this for MSN/SSL support, for instance. > I remain an advocate of a --prefix runtime argument-type solution to > this problem. This simply shifts responsibility for determining the prefix to a wrapper script, which requires even more ugly hacks like scanning the path. The ELF base address approach is 100% reliable on Linux systems and can be cleanly implemented in C. thanks -mike |