Subject: Re: py-postgresql package
To: None <tech-pkg@netbsd.org>
From: None <mcmahill@mtl.mit.edu>
List: tech-pkg
Date: 02/24/2000 11:07:28
On Thu, 24 Feb 2000, D'Arcy J.M. Cain wrote:

> Thus spake Brook Milligan
> >    > I'm trying to compile the py-postgresql package and get the following
> >    > error:
> >    > 
> >    > ===>  Building for py-postgresql-2.4
> >    > ld -Bshareable  pgmodule.o  -Wl,-R/usr/pkg/pgsql/lib -L/usr/pkg/pgsql/lib -lpq -lcrypt -o _pgmodule.so
> >    > ld: invalid command option `-Wl,-R/usr/pkg/pgsql/lib'
> >    > *** Error code 1
> > 
> >    should be '-R/usr/pkg/pgsql/lib' if passed directly to ld.  I started to
> >    look into a fix, but just haven't had time to finish.  Feel free to send
> >    in a patch if you fix it before someone else does...
> > 
> > So replacing -Wl,-R... with -R... is the fix for a.out?  Will it also
> > work with elf?  Or does there need to be a a.out/elf detection
> > mechanism included to differentiate the cases?
> 
> The thing that confuses me is how does -Wl work with ELF anyway.  If
> the Python build uses ld for a.out builds why does it suddenly use cc
> (or gcc) for ELF builds?  I am willing to go ahead and fix this as
> described but if I don't understand exactly what is happening I'm
> afraid to break it for some other case that hasn't been brought up.
> 
> Or does ld accept -Wl on newer versions and perhaps it has nothing to
> do with a.out vs. ELF.

-Wl is a flag to gcc.  

gcc -Wl,option

causes

ld option

when gcc calls the linker.  So to pass "-Rpath" to ld, you either do

gcc -Wl,-Rpath

or

ld -Rpath

So doing "ld -Wl,-Rpath" breaks both on a.out and ELF.  If you do 
"gcc -Wl,-Rpath" or "ld -Rpath" on either a.out or ELF its ok.  ELF
records the run time lib path and a.out (I believe) simply ignores it.

so this package actually doesn't currently (or at least a few days ago)
build on a.out either for this reason.

-Dan