g++/gcc on unixpc
Karl Botts
kdb at chinet.chi.il.us
Tue Oct 17 11:26:17 AEST 1989
In article <1989Oct16.143219.29485 at ux1.cso.uiuc.edu> kubiak at bach.csg.uiuc.edu.UUCP (Ken Kubiak) writes:
>I've been trying to build g++ (near-1.36 version from labrea) on the unixpc.
...
>When gcc is called as a loader (i.e., with a bunch of .o's), I get an error:
>
>*** ld: command line *** -l can't find /libc.a
>*** ld: command line *** -l can't find /libg++.a
>
>Two questions: (1) why is it looking for these? Doesn't it just need gnulib?
> (2) why can't it find libc.a anyway?
1) gnulib is just a helper lib with some multi-precision aritmetic and such
stuff; the standard C lib on the local machine is stil needed.
2) If you have reproduced the error messages correctly, ld is looking for
the libs in the root directory; they aren't there. On the 3b1 ld has the
knowledge to search in /lib and /usr/lib hard-coded into it, except that
the value of the LIBROOT envar, if set, is prepended. Therefore I don't
see how the default search dir can be changed to the root; hence somebody
must be passing those explicit filenames to ld. The culprit must be gcc.
>By the way, I edited the linker spec in gcc.c so as not to put -lc and -lg++
>on the line, but then I have a bunch of undefineds, like "exit" and "fprintf"
>w/o leading underscores.
I'll bet this is part of the problem. You should not be editing .c files.
If you cn't configure it in the makefile or, at last resort, in the .h
files, you are inevitably going to blow away the portability which is the
best feature of gcc.
The 3b1 does require some special link handling, at least if you are going
to use the shared lib (and you definitely should). I have gcc, binaries
only, and I have managed after considerable effort to get an escellent
environment working. I have fixed up make so that it reads some config
files that tell it how to link with shcc, the excellent linker which is PD
equivalent for cc but handles the shared lib very well -- and it takes a
fair amount of finagling to do it right. I have also built front ends for
the system header files to make it look quite ansi; it gets along very
nicely with gcc. The result is that most usenet code compiles with gcc
and links with shcc with no changes to the stock makefiles if they use
macros for the compiler and linker or use the avaliable rules; otherwise I
have to change perhaps two lines.
>Of course, if anybody has already built g++ for the unix-pc (aka 3b1, 7300),
>that would save me a lot of headache. If so, perhaps we could have the
>binaries posted to cheops.
I too would love to see the g++ binaries.
Karl Botts ...{gargoyle|mcdchg|nucsrl|...}!chinet!kdb
kdb at chinet.chi.il.us
More information about the Unix-pc.general
mailing list