This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reg. cross compiling


>my task is to convert the C-code into VM-Code (VM is a kind of
>assembly lang developed by my collegues). for this, i'm taking the GNU
>assembly code generated by GCC by compiling with '-S' option.
>but the problem is that GCC is generating the GAS code based on the
>architecture of the machine it is running on.
>is there any way i can set the architecture info to make GCC to
>generate the assembly code for a target architecture? ( i.e, running
>on SPARC machine can i generate the assembly code for Intel x86 )
>thank you in advance.

Sure.

You want to build a cross-compiler, one to run on a sparc, but
produce code for the x86.  Look at crosstool
(www.kegel.com/crosstool/) for a great tool to build GNU cross-toolchains,
and also look at the crossgcc mailing list archives
http://sources.redhat.com/ml/crossgcc/ 

-- 
Peter Barada
peter@the-baradas.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]