Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

[info] ClangBuiltLinux #147

Open
nickdesaulniers opened this issue Aug 28, 2019 · 3 comments
Open

[info] ClangBuiltLinux #147

nickdesaulniers opened this issue Aug 28, 2019 · 3 comments
Labels
upstream-linux Work that needs to happen in Linux itself

Comments

@nickdesaulniers
Copy link

Hello! Neat project, a lot of folks in Android are keeping an eye on it. If you run into any issues with Clang or LLVM for the Linux kernel (or need help with anything else roughly related), please let us know: https://github.com/ClangBuiltLinux/linux/issues.

@geofft
Copy link
Collaborator

geofft commented Aug 28, 2019

Thanks! A few things that come to mind:

  • We changed our target triple from x86-unknown-linux-gnu to x86-elf to avoid LLVM emitting a call to bcmp() instead of memcmp(). I see the upstream kernel solved this by just adding a memcmp() symbol, do you know if it would be better to change the target triple to not claim to be linux-gnu? (See Do not pretend to be a GNU/Linux #114.)
  • Do you have a suggested qemu image or something of a Clang-built kernel that we can throw in our CI? (Right now our CI is currently "use the kernel installed on Travis" but next time I get a chunk of free time I'll retool it to call into qemu images or something.)

@nickdesaulniers
Copy link
Author

lol, I wrote the kernel patch for bcmp. I highly recommend sticking with the same target triple that the rest of clang and the kernel use, ie. <arch>-linux-gnu. I also backported my patch to stable LTS branches, so those should all work for you (though some distro's have strange non-LTS kernel versions, I assume they manually backport stable...or at least I hope they do).

For CI+QEMU, all of our stuff is here. It's setup to do a basic boot test, then power off the machine cleanly. If the machine doesn't exit cleanly, timeout snaps qemu's neck and the tests fail. Feel free to use our fs images or buildroot scripts or w/e. I'm also happy to help answer any questions. See also: https://nickdesaulniers.github.io/blog/2018/10/24/booting-a-custom-linux-kernel-in-qemu-and-debugging-it-with-gdb/

@alex
Copy link
Member

alex commented Aug 29, 2019

Thanks!

@alex alex added the upstream-linux Work that needs to happen in Linux itself label Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream-linux Work that needs to happen in Linux itself
Projects
None yet
Development

No branches or pull requests

3 participants