Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 671736

Summary: rust-toolchain.eclass: improve CHOST matching
Product: Gentoo Linux Reporter: Dirkjan Ochtman (RETIRED) <djc>
Component: EclassesAssignee: Gentoo Rust Project <rust>
Status: CONFIRMED ---    
Severity: normal CC: gentoo, herrtimson, navi, randy
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=872533
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 679878, 842246    

Description Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-23 08:29:15 UTC
> +  case ${CTARGET%%*-} in
> +    aarch64*)     echo aarch64-unknown-linux-gnu;;
> +    mips64*)      echo mips64-unknown-linux-gnuabi64;;
> +    powerpc64le*) echo powerpc64le-unknown-linux-gnu;;
> +    powerpc64*)   echo powerpc64-unknown-linux-gnu;;
> +    x86_64*)      echo x86_64-unknown-linux-gnu;;
> +    armv6j*s*)    echo arm-unknown-linux-gnueabi;;

mgorny wrote: Substring match for a single letter is a horrible idea.  It even fails with one of standard CHOSTs we have: armv6j-unknown-linux-musleabihf.
Comment 1 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-23 08:31:15 UTC
tt_1, since you previously added this, would you mind helping to improve this? I don't know enough about ARM to be of much use here.
Comment 2 tt_1 2018-11-23 08:39:10 UTC
Can you please explain what substring matches are, for the sake of the argument? 

Also, please mind you, there are no offical rust musl stages. And you can't take a glibc linked one to bootstrap from, so the argument where CHOST=armv6j-unknown-linux-musleabihf will fail doesn't convince me. 

Is there even a stage3 for that? I mean, last thing I read about armv6+musl is that it is a really hacky thing, which would require some pretty advanced busybox kungfu to make it even boot.
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-23 12:49:36 UTC
I think he means some of these CTARGET patterns aren't very specific and might match on things that aren't actually supported upstream. So my question is if we can make them more specific to guard against false positive matches.
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-01-29 08:07:04 UTC
I got to this eclass while adding amd64 musl targets, we need rework of the matches.