Question on /lib/compile (for cross-compiling to Sys4-3.2 on 4.0)
jackson at csc-ws-srv.umd.edu
jackson at csc-ws-srv.umd.edu
Fri Mar 17 10:29:07 AEST 1989
>It almost works. The problem is in linking. /root3.2/lib/compile invokes
>the right ld (/root3.2/pub/bin/ld), but passes it two options "-dc -dp"
>that are understood only by the 4.0 ld (it should pass just "-d" instead).
>My question, then, is how does /lib/compile know what arguments to pass to
>ld? The arguments are not "hardwired" into the binary, because the same
This is tricky. What happens is that compile tries to find some file (I'm
thinking crt0.o, but I don't remember for sure) in both /usr/lib and /lib.
If it finds it in /usr/lib, it thinks you're on a 4.0 system and uses 4.0
ld arguments. If it's in /lib, it thinks you're on 3.2 and uses 3.2 ld
arguments. (Evidently, the 3.2 compile is really the 4.0 compile with
hooks for backwards compatiblity.) I found this by use of the trace(1)
command, and fixed the problem by changing the offending file name in the
3.2 compile binary using adb. (Change it to something like
"/zzz/lib/whatever"; it won't be found, and compile will use 3.2-style
argments for ld.)
Chris Jackson University of Maryland Computer Science Department
(no, I don't work here, I'm just a student...)
More information about the Comp.sys.sun
mailing list