-
Compiling Compiler
Hi there,
I need some advice/opinion of the experts out there regarding
compilers.
I have sun cc compiler that supports 64 bit environment. Now, I compile
ACK using this compiler.This should give a compiler that supports 64bit
environment. Since the output files are in Solaris format, I compile
the ACK source *once again* using the just compiled ACK compiler so
that I get Minix object and binary files.
Now my questions is that does this 2nd version of ACK be able to
produce true 64bit code?
-
Re: Compiling Compiler
Sanky wrote:[color=blue]
> Hi there,
>
> I need some advice/opinion of the experts out there regarding
> compilers.
> I have sun cc compiler that supports 64 bit environment. Now, I compile
> ACK using this compiler.This should give a compiler that supports 64bit
> environment. Since the output files are in Solaris format, I compile
> the ACK source *once again* using the just compiled ACK compiler so
> that I get Minix object and binary files.
> Now my questions is that does this 2nd version of ACK be able to
> produce true 64bit code?
>[/color]
A compiler doesn't inherent capabilities of the compielr it was compiled
on. If that was the case, then ACK should be able to compile out to ELF
objects.
You're going to have to manually code in 64-bit support.
-
Re: Compiling Compiler
On Fri, 2 Dec 2005, Sanky wrote:
[color=blue]
>
>
> Hi there,
>
> I need some advice/opinion of the experts out there regarding
> compilers.
> I have sun cc compiler that supports 64 bit environment. Now, I compile
> ACK using this compiler.This should give a compiler that supports 64bit
> environment. Since the output files are in Solaris format, I compile
> the ACK source *once again* using the just compiled ACK compiler so
> that I get Minix object and binary files.
> Now my questions is that does this 2nd version of ACK be able to
> produce true 64bit code?[/color]
No. The compiler itself (pre-linker) would now -run- on the 64-bit machine
(or in in 64 bit mode), but would produce the same output as it did
before. The program would have no way to find out about any additional
64-bit instructions, different sized operands etc (and if any default
operand sizes change that could break the outputed code).
-But- the libraries would have beeen compiled with the 64-bit compiler, so
after linking they would have a mix of 32 bit code & 64 code, not the
desired "true 64-bit" code. In fact, these may not even be compatable. If
the 32 bit code has 32 bit ints and the 64 bit has 64 bit, then the
function calls would be broken for anything with ints as arguments.
Plus the linker/library formats may not have been compatable in the first
place...
A re-write of the compiler is needed, (tho for ack it's only the "backend"
that need re-written and then you've also written a FORTRAN, COBOL, C++,
etc. compiler too! [or whatever front ends there are]), plus possibly a
rewrite of a few libraries
3ch