-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong name mangling in inline assembly on Windows x64 #727
Comments
Confirmed. |
Seems reasonable, but I'm a bit surprised that it should only pop up now. Was naked inline asm simply not used on Win64 before? |
No clue. |
Phobos does use naked asm for Win64, e.g., in std.math (atan2 etc). I guess the naked functions just haven't called another function so far. |
Nope, the compile time conditional isn't per se problematic here. It's just a hack from when the two different files from x86/x86_64 were merged together (note that asm-x86.h is header-only without an include guard). The actual asm parser selection is still done at runtime. Making the bitness a runtime parameter would indeed be a bit cleaner and save on code size, though. |
I know, as it was me who merged the two asm parsers a while ago. ;) I'd just prefer the runtime check because it's more intuitive and seems less hacky. |
Oh, yes – sorry, I forgot. ;) |
Could somebody who can actually test this on Win64/MSVC please create a pull request? |
Environment: MSVC x64, LLVM head, LDC head
When trying to compile a hello-world program, the linker complains about not finding _fiber_entryPoint referenced in core.thread.Fiber.initStack().trampoline() (a naked assembly function).
Win64's C calling convention doesn't prepend symbol names with an underscore, so this issue can be fixed with the following patch:
The text was updated successfully, but these errors were encountered: