BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.
GNU General Public License v3.0
314 stars 39 forks source link

Leading Underscores #92

Closed leifo closed 2 years ago

leifo commented 2 years ago

I'd like to share symbols between C and ASM sources. Amiga convention defaults to leading underscores, e.g. as in _GfxBase. However, the toolchain currently does not use leading underscores from GCC.

Leaving it off gives a double symbol in the ASM source as GfxBase is already defined by Commodore's includes.

Turning it on with -fleading-underscore (in CCFLAGS) throws a lot of "undefined reference to" errors.

Can it be done? Was it a design decision to leave it off?

BartmanAbyss commented 2 years ago

Hi, I just looked through the Makefile and how I built GCC, and don't see anything related to not using leading underscores. I have modified the example project for you to include -fleading-underscore, it requires quite some changes, but compiles and links successfully. I hope this would be useful for you. amiga_example-leading-underscore.zip