Article View: gnu.gcc.bug
Article #2790porting GCC to SCO UNIX V/386 (3.2)
From: Steve McConnel
Date: Sun, 31 Dec 1989 00:36
Date: Sun, 31 Dec 1989 00:36
41 lines
2615 bytes
2615 bytes
Has anyone successfully ported gcc to SCO UNIX V/386? i've spent this week
working on it, learning more about COFF (and a.out) format than i ever wanted
to know, but still nothing works. The problem appears to be in the COFF
encapsulation and the output of ld. The compiler and assembler (compiled with
the AT&T compiler) seem to run okay and produce GNU-style .o files, but i
haven't been able to get an executable program yet.
Here's what i've done so far:
1) modified robotussin to handle some oddities in the SCO UNIX /lib/libc.a and
/lib/crt*.o files. (two .data segments in many of the object files in
/lib/libc.a, and an .init segment in crt1.o and crtn.o that apparently
contains text.) built /usr/local/lib/gnu/libc.a and /usr/local/lib/gcc-*.o
2) used the follow program as a test (it's rather minimal):
main()
{
write(1, "Hello, world!\n", 14); /* printf() has too much baggage! */
}
3) when this bombed out with a segmentation fault immediately, i dug into the
a.out's and found that the SCO linker was putting crtn.o first (?), and
that crt1.o had a relocation to the .init segment of crtn.o that gcc-ld was
not fixing. i wrote a shell script to invoke gcc-ld with crtn.o first, and
a program to twiddle the bits of a.out to fix that relocation. now, the
program prints "Hello, world!\n" before bombing out with a segmentation
fault, but bomb out it still does. Before digging into the code of gcc-ld,
i thought it might be worth asking if anyone else had gotten gcc working on
this setup already.
next week, i have to resume working on my normal projects, so this will drop
to a rather low priority back-burner effort... pity, i was really hoping to
get g++ going as well as gcc. :-( :-( :-(
at least i got emacs working with only a handful of edits! :-) :-) :-)
--
Stephen McConnel
Summer Institute of Linguistics PHONE: 214-709-2418
7500 W. Camp Wisdom Road UUCP: ...!{texbell|convex|pollux}!txsil!steve
Dallas, TX 75236 Internet: steve@txsil.lonestar.org
Technical Details
Message-ID:
<264@txsil.lonestar.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!texbell!attctc!pollux!txsil!steveShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!texbell!attctc!pollux!txsil!steve From: steve@txsil.lonestar.org (Steve McConnel) Newsgroups: gnu.gcc.bug Subject: porting GCC to SCO UNIX V/386 (3.2) Keywords: COFF choke SCO UNIX sputter COFF Message-ID: <264@txsil.lonestar.org> Date: 31 Dec 89 00:36:32 GMT Reply-To: steve@txsil.lonestar.org (Steve McConnel) Organization: Summer Institute of Linguistics, Dallas TX Lines: 41