Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RESOLVED] LLVM_TARGETS include unnecesary architectures?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
e8root
n00b
n00b


Joined: 09 Feb 2024
Posts: 71

PostPosted: Fri Mar 29, 2024 3:24 pm    Post subject: [RESOLVED] LLVM_TARGETS include unnecesary architectures? Reply with quote

In the file /var/db/repos/gentoo/profiles/base/package.use.force there is section where llvm_target's USE flags are forced.
And for example instead of having just X86 and AMDGPU and maybe WebAssembly so the targets I at this moment want I have support for things like PowerPC, LoongArch, Sparc, etc.

Is all this noise really necessary?
I know I can just put my own USE flag ideas in to /etc/portage/profile/package.use.force/ and rebuild all packages that have e.g. llvm_targets_SystemZ but maybe there is some reasoning behind enforcing these specific architectures?

There is also in x86 and amd64 profiles force to always use llvm_targets_NVPTX which also feels unnecessary.

Also on AArch64 when I tried removing said USE flags I encountered what seems to be a bug: media-libs/mesa when I put wanted to rebuild packages complained about missing llvm_target_AMDGPU USE flag when used with llvm USE flag.
To me it makes very little sense as I am pretty sure my AArch64 device doesn't contain GPU from AMD. I wish it had and maybe in the future when possible I will put one to my Raspberry Pi 5 (for fun mostly) but it still seems like a dependency bug caused by always forcing this USE flag for all profiles and/or not giving enough attention if what is installed on the system makes any sense.

EDIT://
Resolved - that is workaround to avoid issues which can happen when changing these LLVM targets. Resolution is the right order of emerging packages.
_________________
Unix Wars - Episode V: AT&T Strikes Back


Last edited by e8root on Fri Mar 29, 2024 7:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21642

PostPosted: Fri Mar 29, 2024 4:16 pm    Post subject: Reply with quote

According to the block comment immediately above the section you identified, yes, this is necessary:
profiles/base/package.use.force:
# Michał Górny <mgorny@gentoo.org> (2021-11-04)
# Enable all LLVM targets unconditionally.  Unfortunately, disabling
# targets tend to break reverse dependencies (e.g. Rust) and we are yet
# to find a clean way of resolving that.  Compared to the damage
# potential, the increase of build time is a minor problem.  Users who
# really insist of building a smaller system can un-force the flags
# at their own responsibility. See bug #767700.
>=sys-devel/clang-13.0.1_rc llvm_targets_AArch64 llvm_targets_AMDGPU
As I read sys-devel/lld: needs rebuild if LLVM_TARGETS on llvm changed., the problem is that LLVM changes its list of exported symbols depending on the enabled LLVM_TARGETS, so anything with a load-time dependency on a symbol can break when that symbol is removed by disabling an entry in LLVM_TARGETS.
Back to top
View user's profile Send private message
e8root
n00b
n00b


Joined: 09 Feb 2024
Posts: 71

PostPosted: Fri Mar 29, 2024 7:27 pm    Post subject: Reply with quote

My bad! I should have read comment right there.

For now I guess all I need to do is to first emerge rust, then clang, then lld and lastly llvm.
Emerging llvm first I can already say ends with needing to force GCC to be able to use clang at all due to missing symbols in used so. Building now everything with X86, AMDGPU and WebAssembly and for Pi5 only AArch64 and just to be able to use Mesa LLVM also AMDGPU.

On my main PC I kinda don't care to compile few hundreds files more but for something like Raspberry Pi it makes sense to be more specific with these things and not need to build something I will never use each time I do package update. Hopefully I will be able to use AMDGPU on my Pi5 so its efforts building support for Clang won't be in vain :)
_________________
Unix Wars - Episode V: AT&T Strikes Back
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum