On Tuesday 27 November 2007 14:00, Dave Korn wrote:
> On 27 November 2007 18:47, 'Daniel Jacobowitz' wrote:
> > On Tue, Nov 27, 2007 at 06:39:09PM -0000, Dave Korn wrote:
> >>> joking aside, we need to generate ELF object files for running on
> >>> windows.
> >>
> >>   OK, you are now attempting something very very wrong indeed.  The
> >> win32 version of the assembler will not generate ELF files, and even if
> >> it did, windows cannot make any use of the ELF format, it uses PE-COFF. 
> >> And the output file format has absolutely nothing to do with whether or
> >> not the symbols have leading underscores, so claiming that you have to
> >> use -fleading-underscores because you need to generate ELF files is a
> >> non-sequitur.
> >
> > Please give them a little credit.  I would assume they're using an
> > i386-elf compiler and have some mechanism of their own to make the ELF
> > files run.
>
>   I am making no assumptions either way; I'd like some clarification.
>
>   Wouldn't a simpler and more-likely-to-be-reliable technique be to use a
> win32 /compiler/ (so as to get all the ABI issues right, not just the
> amount of underscores on symbols) and only generate/convert to ELF further
> down the toolchain?

no, it would not.
because for one simple fact: COFF format lacks many features of ELF.

this is why we're compiling, assembling, linking, patching, and dynamically 
re-linking everything in ELF format, including using a custom linker script 
that generates an ELF file that is win32 "compatible" (load addresses and 
all)

we then convert the final executable to PE format and run it on the target 
platform.

this even allows us to debug the win32 application from linux using the ELF 
version of the executable file and system's default GDB, or Kdbg, or DDD, or 
what not, with a gdb stub so even if we're running fullscreen under windows 
we can still debug even tho the win32 GUI is frozen and a normal win32 
debugger would just deadlock the system.

this turns debugging under win32 into something akin to working on an embedded 
platform, we also have the same source code running natively on GameCube 
(PPC32-BE), Nintendo DS (ARM-LE), and Linux AMD64 among others.

please dont worry for us about ABI issues and what not, I've got that part 
working, thank you.

now, if only someone actually knew where in the g++ source code the special 
case for std::string is I could fix that, provide a patch, and make the world 
a little bit better.

-- 
Stephane Hockenhull
SSC-Studios.com

Reply via email to