clang on BeagleV

Hi, Is there already someone trying to get clang/llvm running on BeagleV?

I am really interested in getting this running.

Regards,
Michael!

1 Like

Hi Michael, the RISC-V arch is supported in upstream clang [1]. Khem
Raj gave a good talk about the state of software on RISC-V and he
talked about clang/llvm [2]. But like most software on RISC-V, there
is still room for improvement in clang and llvm for RISC-V so I'm sure
there are aspects you could help with if it interests you.

Thanks,
Drew

[1] https://github.com/riscv/riscv-software-list
[2] https://www.youtube.com/watch?v=n4aHBoKtW_I

looks interesting- what I could additionally offer: host the machine on a static IP and give others remote access and add enough storage via NFS

Regards,
Michael!

I have clang working on beagleV using yocto. I am using it as cross-compiler to build image as well as clang on target also is available and working totally fine.

you can use Yoe Distro

% . ./beaglev-starlight-jh7100-envsetup.sh

in local.conf Set

TOOLCHAIN = "clang"
IMAGE_INSTALL_append = " clang"

then

bitbake yoe-sdk-image
2 Likes

Awesome! That is great to hear that it’s working

Here we go.

root@beaglev-starlight-jh7100:~# clang -v 
clang version 12.0.0 (https://github.com/llvm/llvm-project fa0971b87fb2c9d14d1bba2551e61f02f18f329b)
Target: riscv64-yoe-linux
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/riscv64-yoe-linux/11.1.0
Found candidate GCC installation: /usr/bin/../lib/riscv64-yoe-linux/11.1.0
Found candidate GCC installation: /usr/lib/gcc/riscv64-yoe-linux/11.1.0
Found candidate GCC installation: /usr/lib/riscv64-yoe-linux/11.1.0
Selected GCC installation: /usr/bin/../lib/riscv64-yoe-linux/11.1.0
root@beaglev-starlight-jh7100:~#
1 Like

It does compile on gentoo. It took a few hours in chroot on a ryzen with 16 cpus and 32GB of ram, so expect a very long time if you try to compile on the target. I did start on the target thinking that it would be done the next evening. It looks like the board crashed a few hours after I went to bed. I do have the fan on so I am not sure why it shutdown.

On my funtoo arm boards I have always disabled it because it would never compile without error when compiling at the target.
I can’t disable that anymore because some important programs insist on using it. What is wrong with using gcc? gcc has none of those issues. Gentoo should provide a llvm-bin so we don’t have to curse at llvm everytime there is an upgrade to do.

Rust is the worst one though. Luckily gentoo does have a rust-bin package. After 8-9 hours of compiling it ended in an error. Even the continue or merge would not work. I haven’t tried it yet after some fix that were done on the gentoo code on the weekend. Those fixes help me finally compile elogind. Failing to compile that kept me from compiling the xorg drivers. elogind is needed for those of us who do not want anything to do with systemd.

I guess when I have finished my mate image I will try again.
I use a modified version of fchroot from Funtoo so it would compile on gentoo. The nice part about it is that you don’t have to enter a bunch of commands as fchroot does everything for you to get into a chroot.

Originally I was going to make a stage 4 on funtoo but gave up and went back to gentoo when I found that crossdev is broken on funtoo and they have no plan to fix it. It works for some arm board but not for riscv64

Michel

1 Like