remove obsolete extern declaration of main() - #23473
Conversation
|
Given that this was working for x86, this smells, and it does seem odd that multiple externs are resulting in an error. |
|
The linker for the other platforms will merge the duplicates. The linker for Arm64 does not. I cannot fix the linker. |
|
Have you confirmed that with clang? It could be something on our end with flags. |
? I use the Mac clang ld linker, which dies when it sees two declarations with the same name. Chatgpt also told me that it was broken to have such. I can't fix the linker, I have to live with it. Eliminating the duplicate in the code generation is a good solution. There's another one I have to eliminate - the _Dmain duplication, which is turning out to be a bit harder to remove. core.internal.entrypoint is the culprit on that one. Please merge this so I can move on with fixing the _Dmain problem. |
|
I am meaning to use clang with source files to generate multiple declarations, does it differ from the object file dmd is generating? Please confirm, it could be hiding a different bug in dmd, if clang does the same then yeah I'll merge it. |
|
If you make multiple declarations of the same name in the same object file, it will work with x86_64, but not with Arm64. |
|
thank you! |
Now you get one :P |
That extern declaration was causing the Mac linker to error out. And it took me a while to figure out where the extra declaration was coming from.