Skip to content
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

Error in test: Unable to find target for this triple (no targets are registered) #59

Open
weliveindetail opened this issue Sep 9, 2024 · 0 comments

Comments

@weliveindetail
Copy link
Collaborator

When I build the plugin against an LLVM, that is configured without support for the host target, then string obfuscation cannot JIT-compile the encode() routine during at compile-time. That's expected behavior. Unfortunately, the error isn't helpful right now:

/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -S -emit-llvm -target aarch64-unknown-linux-android-O1 -std=c++17 -mllvm --opaque-pointers -o /var/folders/2k/myk8kt8d4f52dzr19331wtxr0000gn/T/lit-tmp-1s5r_xy6/omvll-aarch64-unknown-linux-android-O1-1af1b7.cpp.ll /var/folders/2k/myk8kt8d4f52dzr19331wtxr0000gn/T/lit-tmp-1s5r_xy6/omvll-aarch64-unknown-linux-android-O1-1af1b7.cpp 
Unable to find target for this triple (no targets are registered)

This is confusing because:

  1. no targets are registered is wrong (it had AArch64). The problem is that we don't have the target for the requested triple (X86 in this case).
  2. The requested triple isn't dumped in the error message, so it's not clear which specific target is missing.
  3. It seems that the error happens before we dump the respective command. That way it looks like the previous command is the one that failed. (The one with the AArch64 triple above.)

I think the target-check is done when constructing the host-JIT inside StringEncoding::genRoutines():

HOSTJIT = new Jitter(HostTriple.getTriple());

The error is dumped from LLVM itself, so improving (2) might need an extra check upfront in OMVLL. Note that this might be hard to reproduce on a Apple Silicon machine.

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

No branches or pull requests

1 participant