bebbo / amiga-gcc

The GNU C-Compiler with Binutils and other useful tools for cross development for Amiga
GNU General Public License v2.0
312 stars 66 forks source link

Linking gcc and SAS/C ? #294

Closed githubaf closed 1 year ago

githubaf commented 2 years ago

Rather a question: Is it possible to link object created by gcc and sas/c together? (I get still slightly different pictures from gcc and sas/c variant of wcs and exhanging object could help finding the difference)

I replaced one gcc-object by an sas/c object an got lots of undefined symbols from the linker. I looked with objdump and first char is different (@ from sas/c and _ from gcc)

SAS/C compiled
developer@cn-vm-afritsch:~/Desktop/SelcoGit/3DNature/Amiga$ m68k-amigaos-objdump AGUI.o --syms | grep User_Message$
00003036 g       text       0000 01 @User_Message

gcc-compiled
developer@cn-vm-afritsch:~/Desktop/SelcoGit/3DNature/Amiga$ m68k-amigaos-objdump no_flto/AGUI.o --syms | grep User_Message$
00003ebe g       .text      0000 01 _User_Message

Is there anything I can do to link both object-types together? Should it be possible to mix objects?

bebbo commented 2 years ago

The @ is used if SAS/C uses register parameters. The algorithm to choose these registers differs from the algorithm in gcc. The normal functions are compatible.

githubaf commented 2 years ago

Thanks for the info!