This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: different x86_64 ABIs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Haley wrote:
> Sebastian Biallas writes:
> > Andrew Haley wrote:
> > > Sebastian Biallas writes:
> > > > Hello everyone,
> > > >
> > > > I'm working on a x86_64 project which has mixed C and assembly code. The
> > > > program should (ultimatively) run on all major x86_64 platforms but
> > > > currently I'm facing the problem that x86_64 has a completely different
> > > > ABI on e.g. Linux and Windows. This makes interfacing between C and
> > > > assembler impossible in a portable manner.
> > > >
> > > > So I either need to provide the assembly files in different flavours or
> > > > (which is why I ask here) gcc provides some __attribute__((elf_abi)) or
> > > > __attribute__((linux_abi)) or something like that.
> > > >
> > > > Is the already such an attribute or is it planned? Or this there another
> > > > solution for the problem?
> > >
> > > Make life easy for yourself: Write different assembly code.
> >
> > Well, actually it would be much easier for me if gcc could handle
> > this :)
>
> Mostly it can. That's what inline asm is for.
Well, I haven't told the whole story. Actually it's some sort of JIT
which generated tons of machine code, which also wants to interface with
C code.
>
> > Keeping 2500 lines of assembly code in sync is not really easy.
>
> I would have thought it'd be easier to fix that by not using so much
> assembler code,
I know. But in this case it's really necessary to have this support code
in assembler (because I have to rely on certain things).
> but I don't know your application area.
>
> > > The ABI is different, and to work fully with gcc, assembly code
> > > really needs DWARF2 unwinder data, and that makes no sense at all
> > > to Windows.
> >
> > Huh? I thought unwind data is only needed for C++-Exceptions, isn't it?
>
> We use it everywhere, even for C code. You can probably get away
> without it.
Some pointer for further reading?
Sebastian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEVAwUBRTO/gf81M8QtvOSJAQLc5QgApcODxRfzekV87HJISi3MTuOfww644ojO
rPXt96NRk5LjyKVGgu+KIxEZwAzGhYFOe1l75DQaFykaSMyq2WQgT8ElSxtEd4eJ
0kCuuFbz89WvAK+xFKLkirEEnssnDFV1hr4AxE3QPrF0JJRZhrQNQE5OIznmTYdo
GTBmZcTOjjnyzLMzmiYdp9CPVukaGkEXm6rpUoxbBr+OOwiIpQADmhEisrsx3XSC
cPT0uNJVA3uprvtOlvIVYv/4xe+6lUzjSPXiN+y5fjdwHifKE9Y1OHUbhaNYuyi+
BieKuA6wagGAW7kHd8TIanXeD0Tbd1pMoUAhXpm1e5vAuleCigBPcw==
=Wcqa
-----END PGP SIGNATURE-----