OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:31 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Clang using GCC as linker?
PostPosted: Thu Sep 15, 2022 8:13 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Hello,
I was doing some work on my OS and noticed how clang calls my host's GCC to perform linking, seemingly discarding -fuse-ld=lld. How come this is?

I would like for my OSes build environment to be completely isolated from the host's tools so that it doesn't rely on anything in the host. Also, I don't want to have whole layer extra where issues could prop up. How can I make clang use LLD directly for linking and not GCC?

Thanks,
nexos

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: Clang using GCC as linker?
PostPosted: Thu Sep 22, 2022 10:05 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
lld might be a stub which calls gcc. You could query your package manager to see if there's another package which provides lld.

`file $(which lld)` may show obvious signs of it being a stub, but don't rely on it.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: Clang using GCC as linker?
PostPosted: Sat Sep 24, 2022 7:58 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
No, because running with -V shows gcc calling /usr/bin/ld.lld (since clang forwarded -fuse-ld=lld to gcc). It works fine currently, it's just that I'd like clang to call my custom built lld.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: Clang using GCC as linker?
PostPosted: Sat Oct 01, 2022 11:46 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
I did the simplest thing: simple add the path of my LLD before /usr/bin. How simple :oops:

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 77 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group