-
Notifications
You must be signed in to change notification settings - Fork 146
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
Pass opaque pointer flag to Clang so it can handle Remill's IR #605
Conversation
@@ -181,6 +181,8 @@ MAKE_RW_FP_MEMORY(64) | |||
//MAKE_RW_FP_MEMORY(80) | |||
MAKE_RW_FP_MEMORY(128) | |||
|
|||
State __remill_state{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I fixed the problem with the Clang flag, I noticed the linker yelling at me when building test dependencies. That's what this fix is for.
add_custom_command( | ||
OUTPUT tests_${name}.S | ||
COMMAND ${CMAKE_BC_COMPILER} -Wno-override-module -S -O0 -g0 -c tests_${name}.bc -o tests_${name}.S | ||
COMMAND ${CMAKE_BC_COMPILER} -Wno-override-module -S -O0 -g0 -c tests_${name}.bc -o tests_${name}.S -mllvm -opaque-pointers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I didn't know what I was talking about. This is quite straightforward. The only catch is that the flag is named differently in LLVM trunk (-Xclang -opaque-pointers
). However, in LLVM 15 opaque pointers should be on by default so we'll be able to just check the LLVM version and only supply -mllvm -opaque-pointers
when using LLVM 14.
// TODO(alex): Some of the optimization passes that the builder adds still rely on typed pointers | ||
// so we cannot use them. We should switch to using the new pass manager and choose which passes | ||
// we want. | ||
builder.OptLevel = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't ideal but it looks like Anvill doesn't actually use this. It's just remill-lift
that calls into it so I'm assuming the impact of this is minimal.
Closes #604