public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Stephane Hockenhull <shockenhull@niceberg.com>
To: gcc@gcc.gnu.org
Cc: Dave Korn <dave.korn@artimi.com>,
	'Daniel Jacobowitz' <drow@false.org>,
	 'Joe Buck' <Joe.Buck@synopsys.com>
Subject: Re: why are stl template classes not mangled as other classes  andtemplates
Date: Tue, 27 Nov 2007 21:32:00 -0000	[thread overview]
Message-ID: <200711271539.45293.shockenhull@niceberg.com> (raw)
In-Reply-To: <001001c83127$bb18a820$2e08a8c0@CAM.ARTIMI.COM>

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	other threads:[~2007-11-27 20:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 19:00 why are stl template classes not mangled as other classes and templates Stephane Hockenhull
2007-11-26 19:08 ` Joe Buck
2007-11-26 19:52   ` Stephane Hockenhull
2007-11-26 19:55   ` Daniel Jacobowitz
2007-11-26 21:42     ` Joe Buck
2007-11-27  0:29     ` Stephane Hockenhull
2007-11-27  6:25       ` Joe Buck
2007-11-27 13:26         ` Daniel Jacobowitz
2007-11-27 16:51           ` Stephane Hockenhull
2007-11-27 16:35         ` Stephane Hockenhull
2007-11-27 17:32           ` Dave Korn
2007-11-27 18:11             ` Dave Korn
2007-11-27 18:39               ` Stephane Hockenhull
2007-11-27 19:58                 ` Dave Korn
2007-11-27 20:04                   ` 'Daniel Jacobowitz'
2007-11-27 20:19                     ` why are stl template classes not mangled as other classes andtemplates Dave Korn
2007-11-27 21:32                       ` Stephane Hockenhull [this message]
2007-11-27 21:44                         ` Andrew Pinski
2007-11-27 22:30                           ` Stephane Hockenhull
2007-11-27 22:14                         ` Andreas Schwab
2007-11-27 22:34                           ` Stephane Hockenhull
2007-11-28 20:36                           ` Stephane Hockenhull
2007-11-28 20:44                             ` Dave Korn
2007-11-28 20:45                               ` Stephane Hockenhull
2007-11-28 20:58                                 ` 'Daniel Jacobowitz'
2007-11-28 21:25                                   ` Stephane Hockenhull
2007-11-28 22:03                                     ` why are stl template classes not mangled as other classes ?andtemplates 'Daniel Jacobowitz'
2007-11-28 23:17                                     ` why are stl template classes not mangled as other classes andtemplates Andrew Pinski
2007-11-29  0:08                                       ` Stephane Hockenhull
2007-11-28 23:25                                     ` Jonathan Wakely
2007-11-29  0:11                                       ` Stephane Hockenhull
2007-11-28 22:24                                   ` Stephane Hockenhull
2007-11-28 21:00                                 ` Dave Korn
2007-11-27 22:23                         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711271539.45293.shockenhull@niceberg.com \
    --to=shockenhull@niceberg.com \
    --cc=Joe.Buck@synopsys.com \
    --cc=dave.korn@artimi.com \
    --cc=drow@false.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).