Redhat linux -> ecoff binaries? - Linux

This is a discussion on Redhat linux -> ecoff binaries? - Linux ; 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, ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Redhat linux -> ecoff binaries?

  1. Redhat linux -> ecoff binaries?

    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:
    http://www.kernel.org/pub/linux/libs...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





  2. Re: Redhat linux -> ecoff binaries?

    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/s...e/alpha-tools/



  3. Re: Redhat linux -> ecoff binaries?

    > 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/s...e/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



  4. Re: Redhat linux -> ecoff binaries?

    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




  5. Re: Redhat linux -> ecoff binaries?

    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 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




  6. Re: Redhat linux -> ecoff binaries?

    Peter Sassone wrote:

    > Now, I did find the following:
    > http://www.kernel.org/pub/linux/libs...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.


  7. Re: Redhat linux -> ecoff binaries?

    In article , 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

  8. Re: Redhat linux -> ecoff binaries?

    "Peter Sassone" wrote in message news:...
    > 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:
    > http://www.kernel.org/pub/linux/libs...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/crossgc.../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

  9. Re: Redhat linux -> ecoff binaries?

    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/crossgc.../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




+ Reply to Thread