Hi.
I wrote the following mail two weeks ago, but did not send it, because it
is way to long and i was too lazy to shorten it. Now i send it anyways,
because it should be said, what i said. Feel free to correct me.
BTW: I _know_ that -mimpure-text will not work. My neural net (aka
experience) tells me so. I did not have time to try it.
Here it goes:
My perception has always been that people try to avoid the use of GNU
binutils under Solaris, because there have been quite a few problems
in the past. So do i. And i also do it, because i think the linker is
an important OS subsystem and should not get overridden without *VERY*
good reasons.
Now, when using the native Solaris ld, gcc insists to hand over the
"-z text" option to the linker as a default. One thing that caused
problems from the beginning on, when it was invented - at least from
my point of view.
The "-z text" option _forces_ the linker to treat non position-independent
code as a fatal error - despite the fact that it is perfectly able to
handle it. But then, i don't know an option that tells the linker to spit
out only _warnings_ in such cases from the top of my head...
Anyways, because most - if not all - libraries created by OpenPKG are
static (*1*), this "-z text" causes problems. Switching over to binutils
for this reason is also not a solution, because many developers _expect_
that the native linker is used under Solaris (see above). So, with binutils
there are just "other" problems.
I saw, that gcc knows the option "-mimpure-text" under Solaris. One
solution could be to add -mimpure-text to %l_ldflags (maybe through
rpmtool -ldflags ?). But this way other instances except gcc itself
would have to know how gcc was compiled. Or - much, much worse - the
user would have to specify it in his "private" configuration. Also, it
is not always sure that %l_ldflags is used in every build, is it ?
So, what i recommend is, that the "-z text" part is removed from the
gcc specs file ($opkg_root/lib/gcc-lib/<platform>/<gcc-version>/specs),
when gcc is compiled with "binutils=no". At least as long as OpenPKG
does not use shared libraries as a default. Then, perhaps, position
dependent code could be treated as a "real" error.
What i mean turns out to be something like a "sed s/-z text//g" on
$opkg_root/lib/gcc-lib/<platform>/<gcc-version>/specs.
(mk)
(*1*) And compiled position-dependent. One could generate position
independent code even for static libraries, but nobody does it and
i really don't know whether this would solve the problem. That
nobody does it is enough to forget it as a solution.
--
Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47
>> Im pr�motorischen Cortex kann jeder ein Held sein. (bdw) <<
______________________________________________________________________
The OpenPKG Project www.openpkg.org
Developer Communication List [EMAIL PROTECTED]