Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Years ago I read about someone building an LFS system using LLVM / clang instead of gcc. I assumed at the time that it was BS.
Recently I was trying out OpenBSD and typed "ls -l $(which cc)" and to my surprise, cc was a link to clang, not to gcc. Surprise! Maybe that compiler is now polished enough.
LLVM is mentioned in the BLFS book, but so far as I was able to find, only so much as to describe how to compile LLVM.
It would be interesting to build an LFS system without gcc at all, just to see if it is possible. Has anyone done this already?
As title said, mostly using clang.
Can not compile kernel using clang. Still using gcc.
Maybe you can try compile BSD kernel using clang, but it will be BSD From Scratch.
Notes :
1. When I posted it, it was LFS 8.0 & 8.1
2. Never used this method for LFS 9 and 10
3. Many errors when trying this method for LFS 11, so I put it off for a while.
Last edited by anak_bawang; 01-08-2023 at 11:23 PM.
Thank you for the reply. It is good to hear from someone who has tried this.
Quote:
Originally Posted by anak_bawang
Hi,
Maybe it was my old post.
It was actually a post on 4chan, which is part of the reason I suspected its veracity. I am embarrassed that I did not see your post here.
EDIT: I am even more embarrassed, because I saw that I'd posted reply on your thread back in 2017 and then entirely forgot. I am an idiot.
An update: I found a page on compiling the Linux kernel with LLVM, on the actual kernel.org web site. Whoa. Here is the ink. It seems a bit terse, though?
Maybe it *is* possible now?
Last edited by jr_bob_dobbs; 01-09-2023 at 08:11 PM.
Reason: D'oh!
An update: I found a page on compiling the Linux kernel with LLVM, on the actual kernel.org web site. Whoa. Here is the ink. It seems a bit terse, though?
Maybe it *is* possible now?
Thanks for the link.
I guess it will only work for latest kernel. Version 6 and later.
I've tried compile kernel version 5 with clang, but it did not work.
But I will try it later, because I'm very busy right now.
So I ended up using regular GCC for my LFS 11.2 install. It had been long enough since 8.1 that I wanted to refresh my memory before going to new territory, compiler-wise.
When I progressed to BLFS 11.2, I discovered that several (many?) packages now can only be compiled with clang, indicating to me that it is most likely feature complete? Neat!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.