configure level change on arm to build PIC until glibc-2.2?
First off, I'd like to thank all those who helped me resolve my problem with
the arm linker. I was able to load the shared library mod_auth_mysql.so after
it was re-linked against a position independent libmysqlclient.a.
This made me wonder if it might be a good idea to make a configure level
change on arm. This change would have arm targets build position independent
by default unless otherwise specified. And last until we have either a
patched glibc-2.1 or glibc-2.2. Mabey something as simple as a compiler
switch -fnopic? I havn't spent much time thinking about how to make the
change, more the why. So there are likely better implementations.
I'm suggesting this for three reasons.
1) In order for programs to run properly they, or the libraries they depend
on need to be rebuilt from source. This is not always a bad thing, but does
reduce the benefit of using packages.
To fix apache from failing to load mod_auth_mysql.so, the library it's linked
against, libmysqlclient.a, has to be rebuilt pic. This is the same problem
php3 suffers from and mod_auth_pgsql.so. Specifically, the distance the PC
needs to longjump to load a symbol is greater than the distance it can be told
to longjump by the R_ARM_PC24 reloc.
2) It will likely be a while until we are running on glibc-2.2.
3) I'm not aware of any problems that will be caused by having all objects
(and hence libraries) made position independent.
Now, why should this not happen? Will the performance penalty be too great?
Would it be easier to patch glibc-2.1 with Phil's changes to 2.2? Is there
some case where this reloc will fail even if the configure change happens? If
we were to build everything pic, are there any libraries it shouldn't happen
to? (libc.a comes to mind because of it's size.)