* C++ intermediate bytecode
@ 2008-07-14 15:30 Optymizer Sez
2008-07-14 16:25 ` Ian Lance Taylor
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Optymizer Sez @ 2008-07-14 15:30 UTC (permalink / raw)
To: gcc-help
Hi!
I'd like to ask if there is a way to use GCC in order to compile a C++ source program into machine-independent code (bytecode, perhaps?) and then translate the bytecode into processor-dependent code on the target machine?
Something like the Amsterdam Compiler Kit, but for C++ and x86_64 would be great!
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: C++ intermediate bytecode
2008-07-14 15:30 C++ intermediate bytecode Optymizer Sez
@ 2008-07-14 16:25 ` Ian Lance Taylor
2008-07-15 13:33 ` Tom St Denis
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Ian Lance Taylor @ 2008-07-14 16:25 UTC (permalink / raw)
To: Optymizer Sez; +Cc: gcc-help
Optymizer Sez <optymizer@yahoo.com> writes:
> I'd like to ask if there is a way to use GCC in order to compile a
> C++ source program into machine-independent code (bytecode,
> perhaps?) and then translate the bytecode into processor-dependent
> code on the target machine?
No. Sorry.
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: C++ intermediate bytecode
2008-07-14 15:30 C++ intermediate bytecode Optymizer Sez
2008-07-14 16:25 ` Ian Lance Taylor
@ 2008-07-15 13:33 ` Tom St Denis
2008-07-18 9:10 ` Jim Cobban
2008-07-19 13:11 ` Dario Saccavino
3 siblings, 0 replies; 6+ messages in thread
From: Tom St Denis @ 2008-07-15 13:33 UTC (permalink / raw)
To: Optymizer Sez; +Cc: gcc-help
Optymizer Sez wrote:
> Hi!
>
> I'd like to ask if there is a way to use GCC in order to compile a C++ source program into machine-independent code (bytecode, perhaps?) and then translate the bytecode into processor-dependent code on the target machine?
> Something like the Amsterdam Compiler Kit, but for C++ and x86_64 would be great!
>
Why not just shell to g++ then dlopen() the object? That would require
the compiler on your target, but it lets you execute runtime provided
source in your application [which btw is a horrible security nightmare...]
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: C++ intermediate bytecode
2008-07-14 15:30 C++ intermediate bytecode Optymizer Sez
2008-07-14 16:25 ` Ian Lance Taylor
2008-07-15 13:33 ` Tom St Denis
@ 2008-07-18 9:10 ` Jim Cobban
2008-07-19 13:11 ` Dario Saccavino
3 siblings, 0 replies; 6+ messages in thread
From: Jim Cobban @ 2008-07-18 9:10 UTC (permalink / raw)
To: Optymizer Sez; +Cc: gcc-help
Optymizer Sez wrote:
> Hi!
>
> I'd like to ask if there is a way to use GCC in order to compile a C++ source program into machine-independent code (bytecode, perhaps?) and then translate the bytecode into processor-dependent code on the target machine?
> Something like the Amsterdam Compiler Kit, but for C++ and x86_64 would be great!
>
The language definition of C++ is not machine independent so the exact
meaning of a particular source program varies from platform to
platform. For example there are significant differences in the
interpretation of programs on big-endian as opposed to little-endian
platforms, and even between 32-bit and 64-bit processors in the same
family. Furthermore there are vast differences between different
operating systems. Dealing with those differences is one of the issues
that Java was designed to address.
--
Jim Cobban jcobban@magma.ca
34 Palomino Dr.
Kanata, ON, CANADA
K2M 1M1
+1-613-592-9438
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: C++ intermediate bytecode
2008-07-14 15:30 C++ intermediate bytecode Optymizer Sez
` (2 preceding siblings ...)
2008-07-18 9:10 ` Jim Cobban
@ 2008-07-19 13:11 ` Dario Saccavino
2008-07-19 15:24 ` Andrew Haley
3 siblings, 1 reply; 6+ messages in thread
From: Dario Saccavino @ 2008-07-19 13:11 UTC (permalink / raw)
To: Optymizer Sez; +Cc: gcc-help
2008/7/14 Optymizer Sez <optymizer@yahoo.com>:
> Hi!
>
> I'd like to ask if there is a way to use GCC in order to compile a C++ source program into machine-independent code (bytecode, perhaps?) and then translate the bytecode into processor-dependent code on the target machine?
> Something like the Amsterdam Compiler Kit, but for C++ and x86_64 would be great!
>
Hi, I'm not a GCC expert, but there is LLVM (http://llvm.org), that
provides an infrastructure to compile C and C++ programs into some
kind of bytecode. The compiler is "GCC-based" and the bytecode can be
translated to native code or interpreted on the target machine.
Dario
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: C++ intermediate bytecode
2008-07-19 13:11 ` Dario Saccavino
@ 2008-07-19 15:24 ` Andrew Haley
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2008-07-19 15:24 UTC (permalink / raw)
To: Dario Saccavino; +Cc: Optymizer Sez, gcc-help
Dario Saccavino wrote:
> 2008/7/14 Optymizer Sez <optymizer@yahoo.com>:
>> Hi!
>>
>> I'd like to ask if there is a way to use GCC in order to compile a C++ source program into machine-independent code (bytecode, perhaps?) and then translate the bytecode into processor-dependent code on the target machine?
>> Something like the Amsterdam Compiler Kit, but for C++ and x86_64 would be great!
>>
>
> Hi, I'm not a GCC expert, but there is LLVM (http://llvm.org), that
> provides an infrastructure to compile C and C++ programs into some
> kind of bytecode. The compiler is "GCC-based"
Not exactly. I think they use a gcc front-end, but that's all.
Andrew.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-07-19 13:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-14 15:30 C++ intermediate bytecode Optymizer Sez
2008-07-14 16:25 ` Ian Lance Taylor
2008-07-15 13:33 ` Tom St Denis
2008-07-18 9:10 ` Jim Cobban
2008-07-19 13:11 ` Dario Saccavino
2008-07-19 15:24 ` Andrew Haley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).