This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: an installation bug in either gcc, gld, or readline -- I don't know which


On Tue, Dec 25, 2001 at 09:50:38AM -0500, Andrew Koenig wrote:
> Installation of readline 4.2a (the latest version, as far as I know)
> fails with the message
> 
>       /usr/gnu/bin/ld: -r and -shared may not be used together
> 
> The command that fails is
> 
>       gcc -shared -Wl,-i -Wl,-h,libreadline.so.4  -o libreadline.so.4

This might be readline assuming that, because you're on a Solaris system,
that Solaris' ld is being used.  Clearly you're using GNU's ld.  (Which is
usually a smart thing to do on Solaris.)  The compiler knows this, but
the readline makefile wouldn't.

I'm guessing this because Sun's ld's -i means to ignore LD_LIBRARY_PATH
when linking.  GNU ld's -i is the same as -r, which means to perform an
incremental link and emit a file which can be used as input on a subsequent
link call; this can't be done when creating a shared library, but -r is
used in the error message instead of -i, since -r is the primary option
and -i is just a synonym.


I don't have GNU readline installed, so I can't verify this.  I do see
that there is a 4.2a released.  I will grab a copy and take a look.


> I am reporting this problem to gcc-bugs because the cause appears to be
> that gcc is passing options to the Gnu loader that the loader will not
> accept.  I would think that that should not happen even if inappropriate
> options are given to the gcc command.

In this case, it wouldn't help anyway:  the -Wl switch is a hook, which
passes its argument(s) to the linker directly.  The linker sees the -i
without any rewriting.  For one linker it would be okay, for another linker
it isn't; so I suspect readline's configuration is understandably assuming
Sun's linker is present.


Phil
P.S.- As an aside, I see that you yourself took the cover photo for
Accelerated C++.  Might I ask where that photo was taken?

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]