* Redhat linux -> ecoff binaries?
@ 2004-02-19 2:49 Peter Sassone
2004-02-19 2:51 ` Jafir Elkurd
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Peter Sassone @ 2004-02-19 2:49 UTC (permalink / raw)
I was hoping someone could help me with this:
I have acquired an old AlphaStation 21064 with Redhat 7.2 from a collegue.
My goal is to use this machine to compile alpha ecoff binaries for some
architecture and compiler research, but we don't have a copy of DEC unix or
Compaq c.
Compiling hello world with the default gcc 2.95 produces an elf binary, and
adding -Wl,-oformat,ecoff-littlealpha gives errors about no libc.so.6.1. I
think it means that the installed glibc is elf, instead of the expected
ecoff, which is the case.
On a hunch, I made cross-binutils (2.11) and cross-gcc (3.3.2) to target
alpha-dec-osf4, so that I could compile glibc into an ecoff format. Problem
is that though the new gcc successfully compiles programs into objects, it
can't link in the c runtime crt0.o. I believe that Linux elf systems use
crt1.o, so understandably there's no crt0.o. But I can't find any
package/source/webpage/etc that can provides the right crt0.o.
Now, I did find the following:
www.kernel.org/pub/linux/libs/klibc/cvsroot/klibc/arch/alpha/crt0.S,v
Which does compile into a crt0.o file, but it gives funky "multiple
definition of main" and "relocation trucated" errors when I use it to link,
so I don't think its the right crt0.
So, I have two big questions I hope someone can answer:
1. Am I going down the easiest path to make ecoff executables?
I'd prefer not buy DEC unix and using gcc would be beneficial
to my research.
2. If this is the right path, then where can I get/make the right
crt0.o? I don't have access to any other Alpha systems to
steal it from.
Thanks for any help,
--
Peter Sassone
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 2:49 Redhat linux -> ecoff binaries? Peter Sassone
@ 2004-02-19 2:51 ` Jafir Elkurd
2004-02-19 3:34 ` Peter Sassone
2004-02-19 6:52 ` Peter Sassone
2004-02-19 14:03 ` Juhana Paavola
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Jafir Elkurd @ 2004-02-19 2:51 UTC (permalink / raw)
I don't know if it will help.... but you can download compaq C and C++ for
linux here.
http://h18000.www1.hp.com/products/software/alpha-tools/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 2:51 ` Jafir Elkurd
@ 2004-02-19 3:34 ` Peter Sassone
2004-02-20 3:22 ` fybar
2004-02-19 6:52 ` Peter Sassone
1 sibling, 1 reply; 9+ messages in thread
From: Peter Sassone @ 2004-02-19 3:34 UTC (permalink / raw)
> I don't know if it will help.... but you can download compaq C and C++
> for linux here.
>
> http://h18000.www1.hp.com/products/software/alpha-tools/
Thank you. I've submitted my application for a free "enthusiast" license.
Hopefully HP is still giving these out.
In the end, I'll still need gcc/binutils working for my research though.
And I can't help but wonder if my current setup supports ecoff binaries but
I just don't know the right gcc options...
--
Peter Sassone
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 2:51 ` Jafir Elkurd
2004-02-19 3:34 ` Peter Sassone
@ 2004-02-19 6:52 ` Peter Sassone
2004-02-19 14:10 ` Followup
1 sibling, 1 reply; 9+ messages in thread
From: Peter Sassone @ 2004-02-19 6:52 UTC (permalink / raw)
As a followup, I installed the linux versions of the alpha tools (libots,
cpml, ccc), but they compile programs to elf binaries too. Doh.
So far, the cross gcc seems like the closest thing to working:
[sassone@alpha]$ alpha-dec-osf4-gcc -c -o hello.o hello.c
[sassone@alpha]$ file hello.o
hello.o: COFF format alpha executable not stripped object - version 3.11-2
[sassone@alpha]$ alpha-dec-osf4-gcc -Wl,-oformat,ecoff-littlealpha hello.o
/opt/alpha-dec-osf4/bin/ld: cannot open crt0.o: No such file or directory
collect2: ld returned 1 exit status
But that crt0.o file seems like the missing piece...
--
Peter Sassone
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 2:49 Redhat linux -> ecoff binaries? Peter Sassone
2004-02-19 2:51 ` Jafir Elkurd
@ 2004-02-19 14:03 ` Juhana Paavola
2004-02-20 6:11 ` dooley
2004-02-20 18:42 ` Peter Sassone
3 siblings, 0 replies; 9+ messages in thread
From: Juhana Paavola @ 2004-02-19 14:03 UTC (permalink / raw)
Peter Sassone <pete@play.com> wrote:
> Now, I did find the following:
> www.kernel.org/pub/linux/libs/klibc/cvsroot/klibc/arch/alpha/crt0.S,v
> Which does compile into a crt0.o file, but it gives funky "multiple
> definition of main" and "relocation trucated" errors when I use it to link,
> so I don't think its the right crt0.
What about compiling with -fpic ?
I recently bumped to relocation errors and founded that -fpic resolved my
problems.
Maybe it could resolve yours too.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 6:52 ` Peter Sassone
@ 2004-02-19 14:10 ` Followup
0 siblings, 0 replies; 9+ messages in thread
From: Followup @ 2004-02-19 14:10 UTC (permalink / raw)
http://www.testdrive.hp.com/faq
Try logging into one of the hp test machines to see if you can compile
there.
Good luck,
Alan
>>>>> "Peter" == Peter Sassone <pete@play.com> writes:
Peter> As a followup, I installed the linux versions of the alpha
Peter> tools (libots, cpml, ccc), but they compile programs to elf
Peter> binaries too. Doh.
Peter> So far, the cross gcc seems like the closest thing to working:
Peter> [sassone@alpha]$ alpha-dec-osf4-gcc -c -o hello.o hello.c
Peter> [sassone@alpha]$ file hello.o hello.o: COFF format alpha
Peter> executable not stripped object - version 3.11-2
Peter> [sassone@alpha]$ alpha-dec-osf4-gcc
Peter> -Wl,-oformat,ecoff-littlealpha hello.o
Peter> /opt/alpha-dec-osf4/bin/ld: cannot open crt0.o: No such file
Peter> or directory collect2: ld returned 1 exit status
Peter> But that crt0.o file seems like the missing piece...
Peter> -- Peter Sassone
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 3:34 ` Peter Sassone
@ 2004-02-20 3:22 ` fybar
0 siblings, 0 replies; 9+ messages in thread
From: fybar @ 2004-02-20 3:22 UTC (permalink / raw)
In article <c11ad6$4pg$1@news-int.gatech.edu>, Peter Sassone wrote:
> Thank you. I've submitted my application for a free "enthusiast" license.
> Hopefully HP is still giving these out.
The free licenses were for OpenVMS. I requested on about a year ago and
still no go. The Tru64 enthusiast license is $99.00 US and includes
the install media, updated SRM and bundled software. I have one, well
worth the money!
http://h30097.www3.hp.com/noncommercial-unix/
fyb
--
This is my sig
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 2:49 Redhat linux -> ecoff binaries? Peter Sassone
2004-02-19 2:51 ` Jafir Elkurd
2004-02-19 14:03 ` Juhana Paavola
@ 2004-02-20 6:11 ` dooley
2004-02-20 18:42 ` Peter Sassone
3 siblings, 0 replies; 9+ messages in thread
From: dooley @ 2004-02-20 6:11 UTC (permalink / raw)
"Peter Sassone" <pete@play.com> wrote in message news:<c117pq$38g$1@news-int.gatech.edu>...
> I was hoping someone could help me with this:
>
> I have acquired an old AlphaStation 21064 with Redhat 7.2 from a collegue.
> My goal is to use this machine to compile alpha ecoff binaries for some
> architecture and compiler research, but we don't have a copy of DEC unix or
> Compaq c.
>
> Compiling hello world with the default gcc 2.95 produces an elf binary, and
> adding -Wl,-oformat,ecoff-littlealpha gives errors about no libc.so.6.1. I
> think it means that the installed glibc is elf, instead of the expected
> ecoff, which is the case.
>
> On a hunch, I made cross-binutils (2.11) and cross-gcc (3.3.2) to target
> alpha-dec-osf4, so that I could compile glibc into an ecoff format. Problem
> is that though the new gcc successfully compiles programs into objects, it
> can't link in the c runtime crt0.o. I believe that Linux elf systems use
> crt1.o, so understandably there's no crt0.o. But I can't find any
> package/source/webpage/etc that can provides the right crt0.o.
>
> Now, I did find the following:
> www.kernel.org/pub/linux/libs/klibc/cvsroot/klibc/arch/alpha/crt0.S,v
> Which does compile into a crt0.o file, but it gives funky "multiple
> definition of main" and "relocation trucated" errors when I use it to link,
> so I don't think its the right crt0.
>
> So, I have two big questions I hope someone can answer:
> 1. Am I going down the easiest path to make ecoff executables?
> I'd prefer not buy DEC unix and using gcc would be beneficial
> to my research.
> 2. If this is the right path, then where can I get/make the right
> crt0.o? I don't have access to any other Alpha systems to
> steal it from.
>
> Thanks for any help,
see http://sources.redhat.com/ml/crossgcc/2003-09/msg00110.html
they seem to know what they are talking about
If this is for "non commercial" use you can get Tru64 and the compilers
for $US 99 from HP
Phil
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Redhat linux -> ecoff binaries?
2004-02-19 2:49 Redhat linux -> ecoff binaries? Peter Sassone
` (2 preceding siblings ...)
2004-02-20 6:11 ` dooley
@ 2004-02-20 18:42 ` Peter Sassone
3 siblings, 0 replies; 9+ messages in thread
From: Peter Sassone @ 2004-02-20 18:42 UTC (permalink / raw)
Thank you to everyone who's contributed suggestions. Things still aren't
working, but I feel close to the solution. Boy am I learning a lot about
object formats and linkers! Here's the stuff I've tried:
1. After applying for the free test drive that Alan suggested, I was able to
log into an Alpha OSF 5.1 machine and borrow the crt0.o file. Unfortuntely,
using it to link a simple program (main() return 0;) on my alpha with the
cross compiler still gives errors:
[sassone@alpha]$ alpha-dec-osf4-gcc test.c
/opt/alpha-dec-osf4/lib/crt0.o: In function `__start':
/opt/alpha-dec-osf4/lib/crt0.o:345: undefined reference to `exit'
/opt/alpha-dec-osf4/lib/crt0.o: In function `__eprol':
/opt/alpha-dec-osf4/lib/crt0.o:480: undefined reference to `exit'
collect2: ld returned 1 exit status
Not sure why the crt0.o file doesn't work, but it's possible that __start,
exit, and __eprol don't come from crt0.o, but from some other object file on
OSF systems. I am planning to hunt through the lib directories on the
testdrive alpha to find where they come from. If anyone knows, that would
save me some hunting :)
2. I also tried using the cross compiler with the existing ld (since it
technically supports both formats), and it does create an executable with
the warning:
/usr/bin/ld: warning: cannot find entry symbol _start;
defaulting to 00000001200001b0
but the exectutable segfaults upon running.
3. I also tried to make glibc with the cross compiler (since it *can*
create object files fine) to possibly make a crt0 file, but the configure
script throws errors left and right about a bad compiler since it can't make
executables. I guess I could modify the configure script to ignore those
errors, but it might be telling me the truth: that I will need to build an
executable during the process and my cross compiler can't do that right now.
4. Juhana suggested -fpic or -fPIC, but neither has an effect.
5. Dooley suggested I read:
http://sources.redhat.com/ml/crossgcc/2003-09/msg00110.html
Which was one of the first websites I came across in the quest to make this
work. It was this website that convinced me to cross target gcc to
alpha-dec-osf4, since it is still supported in the latest gcc and binutils.
I don't know if cross targeting gcc to alpha-*-linux-ecoff would produce
linkable binaries, but I'm concerned about compatibility with my
architecture simulator, which requires alpha coff binaries like the ones
that CCC on OSF would produce.
I'm still open to the idea that I'm really barking up the wrong tree to make
COFF binaries on alpha linux. It's a shame that newlib doesn't support
alpha, because I know that it creates a working crt0.o file.
Thanks for any more suggestions,
--
Peter Sassone
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-02-20 18:42 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 2:49 Redhat linux -> ecoff binaries? Peter Sassone
2004-02-19 2:51 ` Jafir Elkurd
2004-02-19 3:34 ` Peter Sassone
2004-02-20 3:22 ` fybar
2004-02-19 6:52 ` Peter Sassone
2004-02-19 14:10 ` Followup
2004-02-19 14:03 ` Juhana Paavola
2004-02-20 6:11 ` dooley
2004-02-20 18:42 ` Peter Sassone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox