View previous topic :: View next topic |
Author |
Message |
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 370
|
Posted: Wed Dec 18, 2024 12:05 pm Post subject: How do I get rid of LLVM? |
|
|
Hi.
Finally llvm-related software became the most bloated part of the system (apart from qt). As far as I understand llvm is just a kind of frontend to compilers, so I wondering, is it possible to get rid of this bloatware?
If there is useful info about it, please share
Thanks _________________ GNU is Not Usable |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22848
|
Posted: Wed Dec 18, 2024 12:13 pm Post subject: |
|
|
You can remove it just like anything else: emerge --ask --verbose --depclean sys-devel/llvm. If it is on your system, this will probably fail with a message about some package that needs it. Add that package to the depclean list and retry. Keep growing the list until either you find a package you're not willing to remove, or you get a successful run. In some cases, packages conditionally need it based on a USE flag. If that is your situation, disabling the USE flag (and rebuilding the affected package) may let you remove LLVM without removing the consuming package. This depends on whether the USE flag controls a feature you are not willing to remove.
My guess is that you will fail, as most modern graphical desktops want Mesa, and Mesa wants LLVM, at least in the common configurations. However, some less common configurations, and anything that can remove Mesa, may not be blocked here. |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 370
|
Posted: Wed Dec 18, 2024 1:43 pm Post subject: |
|
|
Thanks ofr reply!
Code: | emerge --ask --verbose --depclean llvm
Calculating dependencies... done!
llvm-core/llvm-18.1.8-r1 pulled in by:
dev-util/intel_clc-24.2.8 requires llvm-core/llvm:18/18.1=, llvm-core/llvm:18=
dev-util/spirv-llvm-translator-18.1.4 requires llvm-core/llvm:18/18.1=[abi_x86_64(-)], llvm-core/llvm:18=[abi_x86_64(-)]
llvm-core/clang-18.1.8 requires ~llvm-core/llvm-18.1.8[llvm_targets_AMDGPU], ~llvm-core/llvm-18.1.8[llvm_targets_LoongArch], ~llvm-core/llvm-18.1.8[llvm_targets_Lanai], ~llvm-core/llvm-18.1.8[llvm_targets_MSP430], ~llvm-core/llvm-18.1.8[llvm_targets_ARM], ~llvm-core/llvm-18.1.8[llvm_targets_AVR], ~llvm-core/llvm-18.1.8[llvm_targets_WebAssembly], ~llvm-core/llvm-18.1.8[llvm_targets_Sparc], ~llvm-core/llvm-18.1.8[llvm_targets_Mips], ~llvm-core/llvm-18.1.8[llvm_targets_XCore], ~llvm-core/llvm-18.1.8[llvm_targets_NVPTX], ~llvm-core/llvm-18.1.8[llvm_targets_SystemZ], ~llvm-core/llvm-18.1.8[llvm_targets_AArch64], ~llvm-core/llvm-18.1.8:18/18.1=[-debug,abi_x86_64(-)], ~llvm-core/llvm-18.1.8[llvm_targets_PowerPC], ~llvm-core/llvm-18.1.8[llvm_targets_Hexagon], ~llvm-core/llvm-18.1.8[llvm_targets_X86], ~llvm-core/llvm-18.1.8[llvm_targets_RISCV], ~llvm-core/llvm-18.1.8[llvm_targets_BPF], ~llvm-core/llvm-18.1.8[llvm_targets_VE]
llvm-core/llvm-toolchain-symlinks-18-r1 requires llvm-core/llvm:18
llvm-core/llvmgold-18 requires llvm-core/llvm:18[binutils-plugin]
media-libs/mesa-24.2.8 requires llvm-core/llvm:18[llvm_targets_AMDGPU(+),abi_x86_64(-)] |
Code: | emerge --ask --verbose --depclean dev-util/intel_clc
Calculating dependencies... done!
dev-util/intel_clc-24.2.8 pulled in by:
media-libs/mesa-24.2.8 requires ~dev-util/intel_clc-24.2.8 |
It seems only mesa depends on llvm . I removed mesa (built from sources) and installed it from binhost, and the same for intel_clc, but emerge --depclean still says that llvm is still required by mesa/intel_clc. Why binary packages requires compilers? _________________ GNU is Not Usable |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22848
|
Posted: Wed Dec 18, 2024 2:24 pm Post subject: |
|
|
LLVM is not just a compiler. Look at the list of libraries it installs. Even if it were only a compiler, if your depclean has --with-bdeps=y, then Portage would retain packages that you would need if you chose to rebuild Mesa from source. |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 370
|
Posted: Wed Dec 18, 2024 4:17 pm Post subject: |
|
|
At least switching to binary mesa prevented two new huge packages from being pulled in: llvm-runtimes/compiler-rt and llvm-runtimes/compiler-rt-sanitizers.
Not bad. _________________ GNU is Not Usable |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6175 Location: Dallas area
|
Posted: Wed Dec 18, 2024 4:22 pm Post subject: |
|
|
a whole 57 meg ... impressive. _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 370
|
Posted: Wed Dec 18, 2024 4:58 pm Post subject: |
|
|
Anon-E-moose wrote: | a whole 57 meg ... impressive. |
137 Mb, and a lot of time... _________________ GNU is Not Usable |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6175 Location: Dallas area
|
Posted: Wed Dec 18, 2024 5:19 pm Post subject: |
|
|
Not to argue, but are you sure we're talking about the same packages?
Code: | equery s compiler-rt-sanitizers
* llvm-runtimes/compiler-rt-sanitizers-17.0.6
Total files : 109
Total size : 30.22 MiB
equery s compiler-rt
* llvm-runtimes/compiler-rt-17.0.6
Total files : 13
Total size : 239.07 KiB
genlop -t compiler-rt-sanitizers |tail -3
Wed Dec 18 05:22:57 2024 >>> llvm-runtimes/compiler-rt-sanitizers-17.0.6
merge time: 39 seconds.
genlop -t compiler-rt |tail -3
Wed Dec 18 05:22:18 2024 >>> llvm-runtimes/compiler-rt-17.0.6
merge time: 15 seconds. |
Maybe llvm 19* version is larger, but I wouldn't think it would be that much larger. _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 370
|
Posted: Wed Dec 18, 2024 5:59 pm Post subject: |
|
|
Code: | emerge -s compiler-rt-sanitizers
[ Results for search key : compiler-rt-sanitizers ]
Searching...
* llvm-runtimes/compiler-rt-sanitizers
Latest version available: 19.1.4
Latest version installed: [ Not Installed ]
Size of files: 137945 KiB
Homepage: https://llvm.org/
Description: Compiler runtime libraries for clang (sanitizers & xray)
License: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
[ Applications found : 1 ] |
_________________ GNU is Not Usable |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2521
|
Posted: Wed Dec 18, 2024 8:17 pm Post subject: |
|
|
Blind_Sniper wrote: | As far as I understand llvm is just a kind of frontend to compilers, so I wondering, is it possible to get rid of this bloatware?
Thanks |
Are you seriously calling a compiler frontend bloatware?
Compiler#Frontend wrote: | The front end analyzes the source code to build an internal representation of the program, called the intermediate representation (IR). |
In other words it translates a high level language like C++ into IR:
LLVM wrote: | LLVM is designed around a language-independent intermediate representation (IR) that serves as a portable, high-level assembly language that can be optimized with a variety of transformations over multiple passes. |
Which is then processed by a frontend resulting in optimized, architecture specific byte code:
Compiler#Backend wrote: | The back end is responsible for the CPU architecture specific optimizations and for code generation[56].
The main phases of the back end include the following:
- Machine dependent optimizations: optimizations that depend on the details of the CPU architecture that the compiler targets.[57] A prominent example is peephole optimizations, which rewrites short sequences of assembler instructions into more efficient instructions.
- Code generation: the transformed intermediate language is translated into the output language, usually the native machine language of the system. This involves resource and storage decisions, such as deciding which variables to fit into registers and memory and the selection and scheduling of appropriate machine instructions along with their associated addressing modes (see also Sethi–Ullman algorithm). Debug data may also need to be generated to facilitate debugging.
|
Blind_Sniper wrote: | Anon-E-moose wrote: | a whole 57 meg ... impressive. |
137 Mb, and a lot of time... |
If you don't want to compile, use binary packages. You're not getting much from optimizing those specifically for your CPU.
Blind_Sniper wrote: | Code: | emerge -s compiler-rt-sanitizers
[ Results for search key : compiler-rt-sanitizers ]
Searching...
* llvm-runtimes/compiler-rt-sanitizers
Latest version available: 19.1.4
Latest version installed: [ Not Installed ]
Size of files: 137945 KiB
Homepage: https://llvm.org/
Description: Compiler runtime libraries for clang (sanitizers & xray)
License: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
[ Applications found : 1 ] |
|
This is the size of the source package(s) to be downloaded. Although significantly bigger packages are expected to produce bigger binaries, that's not necessarily the case. You can't compare packages by the size of their source code. There might be correlation but not in an proportional.
Here's the binary size with the consideration that gcc is a monolith and say an LLVM C++ based compiler need several components:
Code: | # equery s gcc
* sys-devel/gcc-13.3.1_p20241115
Total files : 1861
Total size : 264.79 MiB
* sys-devel/gcc-14.2.1_p20241116
Total files : 1936
Total size : 311.73 MiB |
Code: | # equery s llvm-core/*
* llvm-core/clang-19.1.4
Total files : 1694
Total size : 186.86 MiB
* llvm-core/clang-common-19.1.4
Total files : 45
Total size : 101.56 KiB
* llvm-core/clang-runtime-19.1.4
Total files : 0
Total size : 0 bytes
* llvm-core/clang-toolchain-symlinks-19
Total files : 11
Total size : 72.04 KiB
* llvm-core/lld-19.1.4
Total files : 50
Total size : 6.22 MiB
* llvm-core/lld-toolchain-symlinks-19
Total files : 7
Total size : 72.01 KiB
* llvm-core/llvm-19.1.4
Total files : 2385
Total size : 246.01 MiB
* llvm-core/llvm-common-19.1.4
Total files : 24
Total size : 129.38 KiB
* llvm-core/llvm-toolchain-symlinks-18-r1
Total files : 31
Total size : 72.27 KiB
* llvm-core/llvm-toolchain-symlinks-19
Total files : 31
Total size : 72.27 KiB
* llvm-core/llvmgold-19
Total files : 6
Total size : 20.04 KiB |
Code: | # equery s llvm-runtimes/*
* llvm-runtimes/compiler-rt-19.1.4
Total files : 16
Total size : 595.33 KiB
* llvm-runtimes/compiler-rt-sanitizers-19.1.4
Total files : 138
Total size : 40.96 MiB
* llvm-runtimes/openmp-19.1.4
Total files : 18
Total size : 3.05 MiB |
It seems LLVM can also be used independently. At least that seem to be the case with firefox, because I have llvm-18 because of it(stripped from the above output for clarity), but no 18 version of the other components. Unless it's using the newer ones.
One thing to note is the difference between GCC 13 and 14. Programming languages standards evolve and become more complex. Indeed this is the case with C++. This also contributes to increase in source and binary size. So you're calling the development of languages bloatware?
One last thing:
Blind_Sniper wrote: |
Why binary packages requires compilers? |
Default state for portage is source based builds. Unless you tell it you're using binary packages, either by -g/G or -k/K or FEATURES="binpkgs", it will consider build time dependencies. While when you emerge software, you (usually) explicitly pass those flag to emerge, you need to explicitly instruct portage to not consider them with --with-bdeps=n when depcleaning. But don't do that. You can't always use binary packages and that means you'll need the toolchain from time to time, even if you put your best effort towards using binary packages.
Best Regards,
Georgi
Last edited by logrusx on Wed Dec 18, 2024 8:43 pm; edited 2 times in total |
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 407
|
Posted: Wed Dec 18, 2024 8:35 pm Post subject: |
|
|
Blind_Sniper wrote: | GNU is Not Usable |
I can't resist. If you do not want to have LLVM installed and GNU is not usable, which compiler do you prefer for your source-based linux distro?
Taking your signature at face value, have you considered BSDs? |
|
Back to top |
|
|
jesnow l33t
Joined: 26 Apr 2006 Posts: 887
|
Posted: Thu Dec 19, 2024 8:43 pm Post subject: |
|
|
I have kind of accepted that we now have to have minimum two c/c++ compilers. But do we really have to have three slotted clangs? I don't even have a fancy system.
Code: |
bartali /home/jesnow # equery list python
* Searching for python ...
[IP-] [ ] dev-lang/python-3.10.16_p1:3.10
[IP-] [ ] dev-lang/python-3.11.11_p1:3.11
[IP-] [ ] dev-lang/python-3.12.8:3.12
[IP-] [ ] dev-lang/python-3.13.1:3.13
bartali /home/jesnow # equery list clang
* Searching for clang ...
[IP-] [ ] llvm-core/clang-15.0.7-r3:15/15g1
[IP-] [ ] llvm-core/clang-18.1.8-r6:18/18.1
[IP-] [ ] llvm-core/clang-19.1.4:19/19.1
bartali /home/jesnow # equery list gcc
* Searching for gcc ...
[IP-] [ ] sys-devel/gcc-14.2.1_p20241116:14
|
I feel like *one* python interpreter and *one* compiler ought to be enough. Especially when you need to recompile clang and it recompiles all three at once.
Jon.
ps: I got rid of the oldest python and clang/llvm by unmerging and masking. But that's not how it should work.
Last edited by jesnow on Thu Dec 19, 2024 9:45 pm; edited 1 time in total |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2521
|
Posted: Thu Dec 19, 2024 8:55 pm Post subject: |
|
|
You most definitely don't need clang:15.
What does emerge -pvc clang:15 say?
I bet you have it in world.
Best Regards,
Georgi |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6175 Location: Dallas area
|
Posted: Thu Dec 19, 2024 8:58 pm Post subject: |
|
|
[IP-] [ ] llvm-core/clang-15.0.7-r3:15/15g1
[IP-] [ ] llvm-core/clang-18.1.8-r6:18/18.1
So what does "emerge -pvc llvm-core/clang-15.0.7-r3" return, same for 18.1 _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
jesnow l33t
Joined: 26 Apr 2006 Posts: 887
|
Posted: Thu Dec 19, 2024 9:53 pm Post subject: |
|
|
Anon-E-moose wrote: | [IP-] [ ] llvm-core/clang-15.0.7-r3:15/15g1
[IP-] [ ] llvm-core/clang-18.1.8-r6:18/18.1
So what does "emerge -pvc llvm-core/clang-15.0.7-r3" return, same for 18.1 |
It needed a '=' for the package spec. I already unmerged and depcleaned 15, so no issues there.
Code: |
bartali /home/jesnow # emerge -pvc =llvm-core/clang-18.1.8-r6
Calculating dependencies... done!
llvm-core/clang-18.1.8-r6 pulled in by:
app-office/libreoffice-24.2.7.2 requires llvm-core/clang:18
dev-qt/qttools-6.7.3 requires llvm-core/clang:18/18.1=, llvm-core/clang:18=
llvm-core/clang-toolchain-symlinks-18 requires llvm-core/clang:18
llvm-runtimes/compiler-rt-18.1.8-r2 requires llvm-core/clang:18
llvm-runtimes/compiler-rt-sanitizers-18.1.8-r6 requires llvm-core/clang:18
>>> No packages selected for removal by depclean
|
so libreoffice and qttools. I guess I could keyword the next version up and see if it works with 19, then I could get rid of 18.
Next time. Libre only seems to have 24.2.9999 available.
Thanks!
Jon. |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1775 Location: South America
|
Posted: Fri Dec 20, 2024 2:32 am Post subject: |
|
|
jesnow wrote: | so libreoffice and qttools. |
As far as I can see, only if the clang USE flag is set. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
jesnow l33t
Joined: 26 Apr 2006 Posts: 887
|
Posted: Fri Dec 20, 2024 2:22 pm Post subject: |
|
|
The way I read this qttools hard requires 18 and everything requies qttools. So currently all my machines have to
recompile all of llvm twice. Thanks guys. some of the weaker machines my be at it for days.
Users should not be forced to have two massive C compilers on their system. But they *really* should not be forced to have three or four.
Aha: I *could* have masked off llvm/clang 19 as nothing seems to hard require it. Great.
Code: |
dev-qt/qttools-6.7.3 (llvm_slot_15 ? llvm-core/clang:15)
(llvm_slot_16 ? llvm-core/clang:16)
(llvm_slot_17 ? llvm-core/clang:17)
(llvm_slot_18 ? llvm-core/clang:18)
(llvm_slot_15 ? llvm-core/clang:15)
(llvm_slot_16 ? llvm-core/clang:16)
(llvm_slot_17 ? llvm-core/clang:17)
(llvm_slot_18 ? llvm-core/clang:18)
|
GDH-gentoo wrote: | jesnow wrote: | so libreoffice and qttools. |
As far as I can see, only if the clang USE flag is set. |
|
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2521
|
Posted: Fri Dec 20, 2024 2:30 pm Post subject: |
|
|
jesnow wrote: |
so libreoffice and qttools. I guess I could keyword the next version up and see if it works with 19, then I could get rid of 18.
Next time. Libre only seems to have 24.2.9999 available.
Thanks!
Jon. |
I don't recommend any live packages. Especially on slower systems. Better switch to a binary libreoffice. Unless there's a deal breaking use incompatibility, source-based emerge of libreoffice gives you nothing. You're not likely to notice any performance gains. Even if you do, that's highly subjective as productivity apps tend to be unaffected by performance optimizations.
jesnow wrote: |
Users should not be forced to have two massive C compilers on their system. But they *really* should not be forced to have three or four. |
Please take a moment to appreciate what a tremendous amount of work it is to maintain a working source based rolling distribution consistent. Then think about complaining again. Doesn't it feel a little bit uncomfortable?
Best Regards,
Georgi
Last edited by logrusx on Fri Dec 20, 2024 2:32 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22848
|
Posted: Fri Dec 20, 2024 2:30 pm Post subject: |
|
|
Since jesnow's complaint is a little unclear to me as to whom "Thanks guys" is addressing, I want to point out explicitly that Gentoo is generally limited to what upstream supports. Gentoo maintainers do not, as a general practice, create and maintain deeply invasive patches to the packages, so if upstream's qttools release only works with LLVM-18, that is what Gentoo's ebuilds will require. Unless you have specific evidence that upstream qttools has good support for LLVM-19 without serious adverse side effects to other packages on the system, please refrain from assuming the Gentoo maintainers are trying to make your life hard. I doubt they voluntarily create scenarios that force extra builds when they readily could avoid that. |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2029
|
Posted: Fri Dec 20, 2024 2:53 pm Post subject: |
|
|
I'll note again (as in other threads) that part of the point of the llvm-r1 eclass is to control this and not greedily pull in new slots so it's aligned to the default in profiles. Of course, sometimes software might only support an older or newer slot, and not the default one, but that's not the common case. It's hard to know what's happening for individual people here: ebuilds may still be using llvm.eclass (not everything is migrated yet, and possibly even from an overlay), or maybe the user has set custom LLVM_SLOT in /etc/portage.
(It's not clear to me if everyone in this thread even has the same problem, e.g. LLVM 19 being pulled in unnecessarily, or rather wanting everything off LLVM 18 right now, or something else). The default in eclasses is currently 19 as of about a week and a half a go, to coincide with LLVM 19 stabilisation. Some packages really don't support LLVM 19, though.
We dislike the LLVM ecosystem's issues as much as you do. |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2884
|
Posted: Fri Dec 20, 2024 3:11 pm Post subject: |
|
|
jesnow wrote: | The way I read this qttools hard requires 18 and everything requies qttools. | It doesn't, equery is just bad at showing the full picture.
The dependency is as such in the ebuild: Code: | clang? (
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
) | Which resolves to the llvm_slot_18? ( ) and such, still inside the clang? ( ) block.
So only with USE=clang as it's been stated already. Even if any llvm_slot_* is set it won't pull clang without it. USE=clang is also off by default (or at least on non-llvm profiles), but may have ended up setting it if you needed qdoc (which itself requires clang, qdoc is typically only needed when you set USE=doc on "some" Qt-using packages but I haven't checked everything that depends on it). |
|
Back to top |
|
|
jesnow l33t
Joined: 26 Apr 2006 Posts: 887
|
Posted: Fri Dec 20, 2024 7:32 pm Post subject: |
|
|
Thanks!
Of course the new 19 slot dropped in just when I was getting ready for this update, and dum-dee-dum-dee-dum I just let it do its thing. I should have checked more carefully.
I masked off clang-19 for the moment and all seems to be compiling well. I unmerged libreoffice but qttools seems to pull it in anyway, and mesa. I guess from wat you're saying i could put -clang and save myself the entire trouble of compiling it. But would still need llvm. I masked off version 19 of that too.
And of course clang puts max stress on my machine.
Ionen wrote: | jesnow wrote: | The way I read this qttools hard requires 18 and everything requies qttools. | It doesn't, equery is just bad at showing the full picture.
The dependency is as such in the ebuild: Code: | clang? (
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}=
llvm-core/llvm:${LLVM_SLOT}=
')
) | Which resolves to the llvm_slot_18? ( ) and such, still inside the clang? ( ) block.
So only with USE=clang as it's been stated already. Even if any llvm_slot_* is set it won't pull clang without it. USE=clang is also off by default (or at least on non-llvm profiles), but may have ended up setting it if you needed qdoc (which itself requires clang, qdoc is typically only needed when you set USE=doc on "some" Qt-using packages but I haven't checked everything that depends on it). |
|
|
Back to top |
|
|
|