Subject: re: different behaviour of system cc and TOOLDIR/cc
To: None <>
From: matthew green <>
List: tech-toolchain
Date: 06/27/2003 04:41:23 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 <>). 
   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, -o  -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 /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 --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.
   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*}".