XboxDev / nxdk-pdclib

The Public Domain C Library (adapted for original Xbox / nxdk toolchain)
http://pdclib.rootdirectory.de
Creative Commons Zero v1.0 Universal
19 stars 9 forks source link

Use local labels in inline asm of assert() implementation #20

Closed thrimbor closed 4 years ago

thrimbor commented 4 years ago

The name of the label currently used in our assert() implementation can cause issues when using LTO. The linker may try to inline the function, which causes an error because there are then multiple labels with the same name. This did happen to me yesterday when I was experimenting with LTO.

This fixes that issue by replacing the label with a local label (link leads to gas docs, but LLVM follows the same behavior).

JayFoxRox commented 4 years ago

Sorry for the long delay on some of the PRs, I was busy with other Xbox related things.

Compiles fine and looks good. Merged.