Skip to content

Conversation

arichardson
Copy link
Member

Not exactly a clean approach but seems to work.

The current tests don't actually include the function in the output file.
I found this while trying to debug a LTO crash for CHERI-RISC-V that
wasn't reproducible with these tests until I changed them to actually
emit the function code. We could also override the entry symbol, but
changing the LLVM IR function name to _start seemed simpler.
This is done in a rather ugly way inside createTargetMachine(): when
the Config object is created, we haven't read the first llvm::Module yet
so we create a copy of the TargetOptions and update the ABIName there.
In the case of LTO invoked directly via LLD we might not have a valid
features string, so fall back to reading the ABI.
@arichardson arichardson requested a review from jrtc27 July 8, 2021 17:16
@arichardson arichardson marked this pull request as draft July 27, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant