different x86_64 ABIs

Sebastian Biallas sb@biallas.net
Mon Oct 16 16:46:00 GMT 2006


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 :)

Keeping 2500 lines of assembly code in sync is not really easy.

> 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?


Sebastian



More information about the Gcc-help mailing list