Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[solved] Why no /usr/bin/clang link?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
pjp
Administrator
Administrator
User avatar
Posts: 20668
Joined: Tue Apr 16, 2002 10:35 pm

[solved] Why no /usr/bin/clang link?

  • Quote

Post by pjp » Sat Jun 03, 2023 2:50 am

I have not found an explanation, only an aside mention that it doesn't exist.
Clang is not added to /usr/bin and instead lives in a separate path that is added to the PATH variable.
https://wiki.gentoo.org/wiki/Clang#sudo ... _not_found

So, why /usr/bin/gcc, but not /usr/bin/clang?
Last edited by pjp on Tue Jun 06, 2023 2:26 am, edited 1 time in total.
Quis separabit? Quo animo?
Top
Ionen
Developer
Developer
User avatar
Posts: 3013
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Sat Jun 03, 2023 5:11 am

Because gcc is otherwise not in PATH, while clang is -- making it unnecessary for the latter. Their management just haven't been designed the same way for handling multiple versions (slots) and such.

gcc may have more historical hardcoded paths hanging around too, while clang is unlikely to.

Trying to call a compiler using "secure" limited PATH seem kind of a odd thing to need too (emerge won't use that). Not that these can't be modified if need be.

Edit: also we've been trying to reduce the amount of modifications to the live system, e.g. tools like gcc-config that create a bunch of symlinks straight in /usr not tracked by the package manager, and with llvm's large amount of binaries and split packages it'd be messy to use common wrappers, or app-alternatives-like ebuilds ultimately would likely still want PATH for switching.
Top
pjp
Administrator
Administrator
User avatar
Posts: 20668
Joined: Tue Apr 16, 2002 10:35 pm

  • Quote

Post by pjp » Tue Jun 06, 2023 2:25 am

Thank you, I appreciate the details. I presumed there was a degree of "upstream" involved.

I guess I've done things to make it not in my PATH. I vaguely recall having avoided some /etc/profile change a long time ago that altered root's PATH. Maybe there were other changes I also avoided. I've never been a fan of random programs polluting global PATH.

I'm now noticing /etc/env.d and... that looks like a nightmare. Hard coding versions into a path variable seems like a bad alternative to a /usr/bin/clang link.

Anyway, thanks again for the info.
Quis separabit? Quo animo?
Top
Ionen
Developer
Developer
User avatar
Posts: 3013
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Tue Jun 06, 2023 9:17 am

pjp wrote:I'm now noticing /etc/env.d and... that looks like a nightmare. Hard coding versions into a path variable seems like a bad alternative to a /usr/bin/clang link.
Yeah, that does have problems when it comes to updating current shells every time (aka won't get new llvm PATH until relogin, or source /etc/profile, and those that don't or can't use /etc/profile need to update manually every time). Albeit that's only on "major" version numbers and isn't /that/ frequent with llvm.

fwiw I used bit of a hybrid approach with eselect-wine, symlinks are a pain to manage there too -- lot of bin/ stuff to match (winecfg, msidb, notepad, etc...), variants, slots, and not all wine versions even install the same binaries (and it changes on USE too!) making it hard to tell what to even cleanup or make in a "generic" way without risking breaking unrelated things in /usr/bin. So it uses PATH too but the path never changes, and instead it uses that private directory for updates. Not that fully happy with this still.
Top
pjp
Administrator
Administrator
User avatar
Posts: 20668
Joined: Tue Apr 16, 2002 10:35 pm

  • Quote

Post by pjp » Tue Jun 06, 2023 7:49 pm

My initial thought was to hijack the install (bashrc) and add my own symlink. For now, I only need the one for clang. But making sure it is handled properly for updates might be a bigger pain than it is worth. I've also thought about adding some sort of bashrc trigger to notify something else to manage the link, but... it'd be easier to write a short script and run it manually when needed. Or, as has been my pattern so far, after being annoyed for a bit, I forget about it until the next time I want to test something quickly. :)
Quis separabit? Quo animo?
Top
Post Reply

5 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic