Codegen can handle XRay for AArch64, tell the driver to allow it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/Driver/XRay/xray-instrument-macos.c | ||
---|---|---|
1 | --target= Avoid -target (legacy) for new tests. |
Addressing feedback by @MaskRay:
- Moved // REQUIRES: directive to the top of the test file
- Replaced legacy -target option with proper --target in tests
- Also rebased on updated trunk
This is a kinda odd case. Normally we should enable the option in the driver when the feature actually works.
However, Triple.isMacOSX() is allowed before the feature actually works and compiler-rt/test/xray/lit.cfg.py tests it.
clang/test/Driver/XRay/ is broken and does not follow the practice testing driver changes.
clang/test/Driver should not test code generation but XRay/ tests do.
The targets aren't really enabled since REQUIRES: aarch64 || x86_64 || x86_64h lines specified lit features aren't available.
clang/lib/Driver/XRayArgs.cpp | ||
---|---|---|
66 | The file was written in a non-conventional way. I just cleaned up the file a bit. |
I have some patches for compiler-rt cooking, fixing the build for AArch64. Should those go in first, before clang is ultimately allowed to use -fxray-instrument when targeting AArch64, so that everything works out of the box?
For me, Clang is able to compile binaries with XRay sections (with this change), but I have compiler-rt disabled and not linked in, since it's not possible to build it for AArch64 yet.
I thought it could be done separately. I was not aware of those tests in compiler-rt, checking all archs.
I guess the build should be fixed first, then this change should simultaneously allow clang to target AArch64 and update compiler-rt's expectations of what works.
How does that sound to you?
Since Mach-O porting is supposed to be done soon, I think landing this change is fine. This patch should make fixing the underlying issue easier as we don't need to locally patch XRayArgs.cpp...
I think D152661 is very much desired and ideally landed before other fixes.
Needs to be rebased first. Hold on. I'll improve the xray-instrument* tests soon and you may want to git pull:)
The file was written in a non-conventional way. I just cleaned up the file a bit.