]> Witch of Git - ivy/commit
Modify runtime symbol decoration
authorCassie Jones <code@witchoflight.com>
Sun, 1 Mar 2020 13:30:22 +0000 (14:30 +0100)
committerCassie Jones <code@witchoflight.com>
Sun, 1 Mar 2020 13:30:22 +0000 (14:30 +0100)
commit696efd25b5a7506ce061bd8c67b5abb3f39aa976
tree97764ffdaeb6dc529cd4822ed21d0e686afa8589
parentbb8ad50a0be3571c758f84c6c783843ec5547d3d
Modify runtime symbol decoration

C name decoration varies across platforms. On macOS, names from C are
prefixed with an underscore. On Linux, they're not, and on 64-bit
Windows they're not.

The macOS situation observed by inspecting the symbols.
Linux compatibility issue discovered here (and above in the thread):
https://twitter.com/16kbps/status/1233955883148861440
Windows symbol decoration documented here:
https://docs.microsoft.com/en-us/cpp/build/reference/decorated-names#FormatC
> Note that in a 64-bit environment, functions are not decorated.

Currently handling this with conditional compilation, but that prevents
cross-compilation. In the future it would be good to have the formatting
method select how to print them, but that would involve switching away
from fmt::Display, since we can't pass the ABI information into that.
Alternately, we could pack the ABI information into the symbol enum.
src/trans/x64.rs