-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
add -fIBT switch and emit ENDBR for function and thunk prologs #15415
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15415" |
is this the same or similar to ldc-developers/ldc#4437 ? |
This is the same as -fcf-protection=branch in GDC and LDC (after the PR). It would be good to adopt the -fcf-protection flags in DMD as well |
Wouldn't this be a @ErnyTech I'd expect dub to be a common front for all command-line differences. |
In the LDC PR I have also implemented |
It's still convenient to have consistent naming of flags across compilers, and there's no advantage of naming it differently. |
It's just too long and clunky and un-memorable. |
I fixed switch code generation so it'll work with IBT. |
Maybe, but that's what the market has chosen and what all programmers expect, GCC and Clang use -fcf-protection=branch, Rustc use cf-protection=branch Ok to have a different flag to keep consistency with the other flags, but I don't think the memory issues are applicable here as anyone who needs Intel CET IBT already knows -fcf-protection=branch |
I'd rather just let dmd be consistent with itself, as it has no incentive to copy from others in a really inconsistent way. (ie: the gcc-style prefixing letters |
Hi Walter -- Thanks for this. It works for me. |
@ibara wonderful! |
This follows PR dlang#15415 which added Intel CET IBT support and LDC PR dlang#4437 to add support for the new CET target in order to maintain a common interface between DMD and LDC. Later it would be useful to do the same for GDC as well.
This follows PR dlang#15415 which added Intel CET IBT support and LDC PR dlang#4437 to add support for the new CET target in order to maintain a common interface between DMD and LDC. Later it would be useful to do the same for GDC as well.
This follows PR dlang#15415 which added Intel CET IBT support and LDC PR dlang#4437 to add support for the new CET target in order to maintain a common interface between DMD and LDC. Later it would be useful to do the same for GDC as well.
This follows PR dlang#15415 which added Intel CET IBT support and LDC PR dlang#4437 to add support for the new CET target in order to maintain a common interface between DMD and LDC. Later it would be useful to do the same for GDC as well.
See https://news.ycombinator.com/item?id=36722823 for more information on IBT.
For the ENDBR32/64 instructions:
https://www.felixcloutier.com/x86/endbr32
https://www.felixcloutier.com/x86/endbr64
I still need to add support for switch jump tables.
I have no way to test this, as my machines don't use IBT. All I can say is disassembly shows the instruction is generated, and the programs still run.