Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why is the ebuild for dev-lang/rust doing this?
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
leyvi
Guru
Guru


Joined: 08 Sep 2023
Posts: 409

PostPosted: Sun Jun 08, 2025 7:25 pm    Post subject: Why is the ebuild for dev-lang/rust doing this? Reply with quote

ebuild:
 538   │     if use wasm; then
 539   │         wasm_target="wasm32-unknown-unknown"
 540   │         export CFLAGS_${wasm_target//-/_}="$(filter-flags '-mcpu*' '-march*' '-mtune*'; echo "$CFLAGS")"
 541   │         cat <<- _EOF_ >> "${S}"/config.toml
 542   │             [target.wasm32-unknown-unknown]
 543   │             linker = "$(usex system-llvm lld rust-lld)"
 544   │             # wasm target does not have profiler_builtins https://bugs.gentoo.org/848483
 545   │             profiler = false
 546   │         _EOF_
 547   │     fi
This is part of the ebuild for dev-lang/rust. On my machine, it causes the build to fail, since the only command on my system that Rust will accept as a linker for wasm is wasm-ld. I imagine that I've misconfigured something, but what?
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2376

PostPosted: Mon Jun 09, 2025 7:01 am    Post subject: Reply with quote

It would help enormously to have the full build.log, emerge --info, and details of what your system/environment are. You're not new -- you know this!

As for why it does it, I don't know if it's even a problem yet -- the point there is to say "we definitely need lld in some form, not e.g. bfd/mold if using that to build Rust", but with how lld works, I would've thought that "lld" or "rust-lld" would be fine because it would pass down the needed target. It's not impossible that it's obsolete or things have changed, but without information, I don't see how we can move forward here.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 4071

PostPosted: Mon Jun 09, 2025 8:49 am    Post subject: Reply with quote

Side note:
dev-lang/rust[wasm] fails to build as
Code:
# The following warnings were emitted during compilation:
# warning: [email protected]: clang: error: unsupported argument '-mbranches-within-32B-boundaries' to option '-Wa,'
despite gcc build configuration here.
Seems a hardcoded clang call, with CFLAGS from /etc/portage/make.conf
Workaround is to inhibit using /etc/portage/package.env

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23537

PostPosted: Mon Jun 09, 2025 12:07 pm    Post subject: Reply with quote

CaptainBlood wrote:
Side note:
dev-lang/rust[wasm] fails to build as
Although build failures are worth examining, I think your report is not related to OP's issue with the linker command name. Your report deserves its own thread.
Back to top
View user's profile Send private message
leyvi
Guru
Guru


Joined: 08 Sep 2023
Posts: 409

PostPosted: Mon Jun 09, 2025 3:31 pm    Post subject: Reply with quote

Here is the full build log, but most of it's irrelevant; here are the interesting parts:
Part where config.toml is generated:
 186   │ [target.wasm32-unknown-unknown]
 187   │ linker = "lld"
 188   │ # wasm target does not have profiler_builtins https://bugs.gentoo.org/848483
 189   │ profiler = false
Resulting error:
237348   │   error: linker flavor `gnu-lld-cc` is incompatible with the current target
237349   │     |
237350   │     = note: compatible flavors are: wasm-lld, wasm-lld-cc, gcc, wasm-ld
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23537

PostPosted: Tue Jun 10, 2025 12:06 am    Post subject: Reply with quote

For those following the side note, CaptainBlood created dev-lang/rust[wasm] hardcoded calls to clang @build for the hardcoded clang call. Discussion of that issue will continue there, leaving this thread for leyvi's problem.
Back to top
View user's profile Send private message
leyvi
Guru
Guru


Joined: 08 Sep 2023
Posts: 409

PostPosted: Fri Jun 13, 2025 12:32 pm    Post subject: Reply with quote

I'd be happy to try anything; I'd really like to update dev-lang/rust...
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 3056

PostPosted: Fri Jun 13, 2025 1:01 pm    Post subject: Reply with quote

Quote:
- - wasm : Build support for the wasm32-unknown-unknown target


That means nothing to me. Does it mean something to you? If so what? If no, just disable the wasm use flag.

Best Regards,
Georgi
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2376

PostPosted: Fri Jun 13, 2025 1:41 pm    Post subject: Reply with quote

leyvi wrote:
I'd be happy to try anything; I'd really like to update dev-lang/rust...


How about answering the questions I asked?
Back to top
View user's profile Send private message
leyvi
Guru
Guru


Joined: 08 Sep 2023
Posts: 409

PostPosted: Fri Jun 13, 2025 3:14 pm    Post subject: Reply with quote

sam_ wrote:
leyvi wrote:
I'd be happy to try anything; I'd really like to update dev-lang/rust...


How about answering the questions I asked?
Right, sorry I forgot to post emerge --info and the environment file, I'll send it tomorrow.

(Also: please excuse my absent-mindedness, I've been running in and out of a bunker for that last day or so.)
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



OSZAR »