-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix: do no use .cfi_negate_ra_state within the assembly on Arm64 #15784
Conversation
@lundman - could you check, if this works also on Apple? I have tested this only on userspace on an Apple Mac mini (M1, 2020):
|
Ah can't apply directly of course, but if we are just testing that the opcodes are understood, a patch like assembly test
I can confirm that compiles and links ok. Obviously can't run it, so in terms of syntax it is all go. I would perhaps Ultimately, I think you can proceed with Linux/FreeBSD changes. We've pretty much given up on merging macOS, and will plan to arrange our repo and workflow to be permanently down-stream, and have own copies of files for easier merging. |
This will break FreeBSD 15.0 on hardware with BTI. As far as I can tell all you need to do is remove |
I thought that there is no way that it's this simple, but it's a no-op on platforms without pointer authentication: Without knowing anything about how binutils is structured, it looks like it first does the same thing as So it seems to me like this could be the result of a simple ifdef, and on platforms without |
@ziggythehamster and @zxombie - Thanks for these findings - I will create a second and smaller approach
This sounds no so good :( |
Another thought - any reason that SIMDE couldn't be integrated into an autoconf macro / codegen script so that everyone's assembly is decided at ./configure time? That would allow for greater optimization on more recent compilers, allow for platform-specific stuff (Apple Silicon PAC), and also open this up to architectures which currently don't get optimized versions. If this assembly is hand-optimized, I could see this being problematic, but AFAIK it isn't. |
fa4c588
to
5d6625c
Compare
This would make the things a bit more complex I think. |
Compiling openzfs on aarch64 with gcc-8 and gcc-9 is failing currently. See issue openzfs#14965 for deeper context. On platforms without pointer authentication, .cfi_negate_ra_state can be defined to a no-op: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/aarch64-tdep.c#l1413 I have tested this on Arm64 FreeBSD 13.2 and AlmaLinux-8. Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de> Closes: openzfs#14965
5d6625c
to
4d89693
Compare
I've tested this on EC2 and the latest version of the patch seems to work just fine. |
This resolved my issue compiling on Apple M1 in Debian 10. |
Compiling openzfs on aarch64 with gcc-8 and gcc-9 is failing currently. See issue #14965 for deeper context. On platforms without pointer authentication, .cfi_negate_ra_state can be defined to a no-op: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/aarch64-tdep.c#l1413 I have tested this on Arm64 FreeBSD 13.2 and AlmaLinux-8. Reviewed-by: Andrew Turner <andrew.turner4@arm.com> Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de> Closes #14965 Closes #15784
Compiling openzfs on aarch64 with gcc-8 and gcc-9 is failing currently. See issue openzfs#14965 for deeper context. On platforms without pointer authentication, .cfi_negate_ra_state can be defined to a no-op: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/aarch64-tdep.c#l1413 I have tested this on Arm64 FreeBSD 13.2 and AlmaLinux-8. Reviewed-by: Andrew Turner <andrew.turner4@arm.com> Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de> Closes openzfs#14965 Closes openzfs#15784
Motivation and Context
Compiling openzfs on aarch64 with gcc-8 and gcc-9 is failing currently.
See issue #14965 for deeper context.
On platforms without pointer authentication,
.cfi_negate_ra_state
can bedefined to a no-op: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/aarch64-tdep.c#l1413
Closes: #14965
Description
How Has This Been Tested?
I have tested this on Arm64 FreeBSD 13.2 and AlmaLinux-8.
Types of changes
Checklist:
Signed-off-by
.