Subject: Re: different behaviour of system cc and TOOLDIR/cc
To: Todd Vierling <tv@pobox.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-toolchain
Date: 06/26/2003 20:23:18
tv@pobox.com said:
> -rpath is not accepted by "cc", so it requires -Wl prepended.  On the
> other hand, -R can be passed directly to "cc" (so this is what I'd
> recommend using, also in <bsd.prog.mk>). 

It works with an i386 target.
With a i386->m68k cross toolchain, the -R is not recognized:

/usr/tools/bin/m68k--netbsdelf-gcc -v -Wl,-nostdlib -B/scratch/netbsd/d
ist-cesfic/usr/lib/ -B/scratch/netbsd/dist-cesfic/usr/lib/  -Wl,-x -sha
red -Wl,-soname,libc.so.12 -o libc.so.12.99  -Wl,--whole-archive libc_p
ic.a  -Wl,--no-whole-archive   -L/scratch/netbsd/dist-cesfic/usr/lib -L
/scratch/netbsd/dist-cesfic/lib -L/scratch/netbsd/dist-cesfic/usr/lib
-R/lib -R/usr/lib
Reading specs from /usr/tools/lib/gcc-lib/m68k--netbsdelf/2.95.3/specs
m68k--netbsdelf-gcc: unrecognized option `-R/lib'
m68k--netbsdelf-gcc: unrecognized option `-R/usr/lib'
gcc version 2.95.3 20010315 (release) (NetBSD nb4)
 /usr/tools/lib/gcc-lib/m68k--netbsdelf/2.95.3/collect2 -m m68kelfnbsd
-shared -o libc.so.12.99 /scratch/netbsd/dist-cesfic/usr/lib/crti.o /sc
ratch/netbsd/dist-cesfic/usr/lib/crtbeginS.o -L/scratch/netbsd/dist-ces
fic/usr/lib -L/scratch/netbsd/dist-cesfic/lib -L/scratch/netbsd/dist-ce
sfic/usr/lib -L/scratch/netbsd/dist-cesfic/usr/lib -L/scratch/netbsd/di
st-cesfic/usr/lib -L/usr/tools/lib/gcc-lib/m68k--netbsdelf/2.95.3 -L/us
r/tools/m68k--netbsdelf/lib -nostdlib -x -soname libc.so.12 --whole-arc
hive libc_pic.a --no-whole-archive -lgcc_pic -lgcc_pic /scratch/netbsd/
dist-cesfic/usr/lib/crtendS.o /scratch/netbsd/dist-cesfic/usr/lib/crtn.
o

Can you tell me where this is controlled?
Is it worth fixing the compiler, or should we resort to -Wl,-rpath?

best regards
Matthias