Subject: re: different behaviour of system cc and TOOLDIR/cc
To: None <M.Drochner@fz-juelich.de>
From: matthew green <mrg@eterna.com.au>
List: tech-toolchain
Date: 06/27/2003 04:41:23
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?
netbsd compilers should support it. the GCC specs should DTRT
(pass it to ld(1)).. eg, the "*link" needs a "%{R*}".