RE: How to compile and link 32 bit c code with 64 bit c code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you, Eljay.
Even though it is not my situation, it is a good FYI for me;-)
Qing

----------------------------------------
> From: eljay@xxxxxxxxx
> To: qinggwang@xxxxxxxxxxx
> CC: gcc-help@xxxxxxxxxxx
> Date: Thu, 7 Jan 2010 09:31:17 -0800
> Subject: RE: How to compile and link 32 bit c code with 64 bit c code
>
> Hi Qing,
>
> On Macintosh OS X, you can compile a source file such that the compiler creates a multiple architecture target executable. For example:
>
> # file /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
> /Developer/Applications/Xcode.app/Contents/MacOS/Xcode: Mach-O universal binary with 4 architectures
> /Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture ppc7400): Mach-O executable ppc
> /Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture ppc64): Mach-O 64-bit executable ppc64
> /Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture i386): Mach-O executable i386
> /Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture x86_64): Mach-O 64-bit executable x86_64
>
> Is that your situation?
>
> Or, perhaps, are you trying to write a kernel executor that does pre-emptive multi-processing with both i386 PIDs and x86_64 PIDs, so you need whatever-the-kernel-isn't springboard code for the other mode? (I understand the theory, but I don't know how that's implemented in practice with actual kernels and real-life architectures. All magic to me.)
>
> Or, as from what I gather from the conversation thus far, you really really really are trying to have both i386 and x86_64 code living in one executable, both that can be executed in the same PID? Despite that the calling conventions and ABI's are incompatible (hence you will need to write thunking code for each API that goes between both modes), and you cannot use any Standard C routine in the mode that the code was not linked against.
>
> Curiously,
> --Eljay
>
>
>
 		 	   		  
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux