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

llvm_19.1.6: port latest LLVM version and fix the cross-compilation config LLVM_HOST_TRIPLE #199

Open
wants to merge 2 commits into
base: scarthgap
Choose a base branch
from

Conversation

hashraf91
Copy link
Contributor

We are experiencing issue with EGL initialization. As mesa depends on LLVM for llvmpipe driver, so porting the latest version available as of today which seems to fix the issue.
Ported from:
openembedded/openembedded-core@8546473

Tested-by: Ahsan Hussain [email protected]
Signed-off-by: Haseeb Ashraf [email protected]

The correct way to configure cmake for cross-compilation includes setting the LLVM_HOST_TRIPLE as well. This fixes the bug when LLVM is cross-compiled for AAarch64 but it was getting built with the triple of native build system instead of the TARGET_SYS ('aarch64-oe-linux' in my case).

No available targets are compatible with triple "x86_64-unknown-linux-gnu"

Documentation Ref:
https://github.com/llvm/llvm-project/blob/llvmorg-19.1.6/llvm/docs/HowToCrossCompileLLVM.rst#configuring-cmake

JIRA-ID: SB-24074

Signed-off-by: Haseeb Ashraf [email protected]

@hashraf91 hashraf91 self-assigned this Jan 24, 2025
@hashraf91 hashraf91 changed the title llvm_19.1.6: port latest LLVM version and fix the cross-compilation config for host triple llvm_19.1.6: port latest LLVM version and fix the cross-compilation config LLVM_HOST_TRIPLE Jan 24, 2025
We are experiencing issue with EGL initialization. As mesa depends
on LLVM for llvmpipe driver, so porting the latest version available
as of today which seems to fix the issue.

Ported from:
openembedded/openembedded-core@8546473

JIRA-ID: SB-24074

Tested-by: Ahsan Hussain <[email protected]>
Signed-off-by: Haseeb Ashraf <[email protected]>
@hashraf91 hashraf91 force-pushed the SB-24074 branch 2 times, most recently from 0e78604 to ac7889b Compare January 24, 2025 10:33
# ---------------------------------------------------------------------------------------------------------------------

EXTRA_OECMAKE:append:class-target = " -DLLVM_HOST_TRIPLE=${TARGET_SYS}"
EXTRA_OECMAKE:append:class-nativesdk = " -DLLVM_HOST_TRIPLE=${TARGET_SYS}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change for class-nativesdk? Isn't it for SDKMACHINE

Copy link
Contributor Author

@hashraf91 hashraf91 Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class-nativesdk is for SDK which could also built for different arch. See the original recipe: https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/llvm/llvm_19.1.6.bb#L89

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this should be SDK_SYS. Thanks for pointing this out.

The correct way to configure cmake for cross-compilation includes
setting the LLVM_HOST_TRIPLE as well.

Documentation Ref:
https://github.com/llvm/llvm-project/blob/llvmorg-19.1.6/llvm/docs/HowToCrossCompileLLVM.rst#configuring-cmake

This fixes the bug when LLVM is cross-compiled for AAarch64 but it
was getting built with the triple of native build system instead of
the TARGET_SYS ('aarch64-oe-linux' in my case).
```
No available targets are compatible with triple "x86_64-unknown-linux-gnu"
```

JIRA-ID: SB-24074

Signed-off-by: Haseeb Ashraf <[email protected]>
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.

2 participants