Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CHOST question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1072
Location: Romania

PostPosted: Fri Jul 17, 2020 5:44 pm    Post subject: CHOST question Reply with quote

Hello

Why do we need 2 different CHOSTs for armv6j and armv7a? Why can't we have just one?

And further more, any idea why gentoo would just have a problem with CHOST=arm-linux-gnueabihf?

I tried to unify the 2 under a single construction, and ran into a whole lot of problems.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46700
Location: 56N 3W

PostPosted: Fri Jul 17, 2020 5:55 pm    Post subject: Reply with quote

axl,

The CHOST is used when the toolchain is built. It determines the CPU the tool chain will run on.

armv6j and armv7a have different instruction sets. You can run armv6j code on a armv7a. Raspbian does just that but the other way around won't work.

Don't confuse "the CPU the tool chain will run on" with the "the CPU the tool chain will make code for".
The latter is determined by CFLAGS.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1072
Location: Romania

PostPosted: Fri Jul 17, 2020 6:12 pm    Post subject: Reply with quote

We've started on the wrong foot I think. With "no".

Let's backup a few steps and start over. I built a toolchain with arm-linux-gnueabihf. crossdev -t arm-linux-gnueabihf.

Next, I built with arm-linux-gnueabihf-emerge a system around it.

Next I mounted it over nfs, and tried to run in it with chroot. I tested pi zero (which is an armv6), a pi 1, a pi 2 a, and a lot of them up. It's not easy, but I'm tempted to test on a lego brick. the mindstorms brick. I think that one has a arm 5smth. See ev3dev.org for more info.

Anyway, it worked.

It works to have only ONE toolchain as distcc server, instead of 2.

it works on arm... in general. But you could link a different profile (make.profile). as you say, AND use certain cflags to optimize for that cpu.

But why do we need 2 different chosts? And I'm guessing the other arm versions (i never checked) also have different chosts. and why don't we have an armv8x for newer versions? I am tempted to download these just to check the chost. http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv5tel/

Think of a gentoo box built with arm-linux-gnueabihf and CFLAGS="-marm -O2 -pipe". OFC it will work. It will most often complain about MB_LEN_MAX not being the right size, and I haven't gotten to the bottom of it, but lets at least TRY to hypothetically start with yes. And build on that...
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1072
Location: Romania

PostPosted: Fri Jul 17, 2020 6:23 pm    Post subject: Reply with quote

Think distcc server. Why do I have 2 toolchains when I only need one? Because gentoo comes as 2 different stages3 with different chosts and because someone at one point thought that armv6 and armv7 and too different to use the same toolchain/chost. but not armv8. armv8 is too similar to armv7 to have a toolchain/chost of it's own. And if you happen to have another arm device around that is not 6 or 7... well, good luck with that.

I'll put it another way. Do you know a technical reason why CHOST=armv6j has to be different from armv7a?

We have x86_64 for all 64 bit pc cpus right? We have i686 for all pc 32 bit cpus. Why does arm 32 bit need 2 chosts?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46700
Location: 56N 3W

PostPosted: Fri Jul 17, 2020 7:55 pm    Post subject: Reply with quote

axl,

We have i586 and i486 and used to have i366 for 32 bit CPUs too.
That matters a lot if you don't have an i686 (Pentium Pro or later) 32 bit Intel/AMD/Cyrex/...CPU.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1072
Location: Romania

PostPosted: Fri Jul 17, 2020 8:11 pm    Post subject: Reply with quote

NeddySeagoon wrote:
axl,

We have i586 and i486 and used to have i366 for 32 bit CPUs too.
That matters a lot if you don't have an i686 (Pentium Pro or later) 32 bit Intel/AMD/Cyrex/...CPU.



retroactively we do. I think they settled on 486 as the lowest denominator. qemu & libvirt seem to agree. I am not privy to why that is. but i noticed it. (another question for another day... but good point).

look. the expectation here is that we're gonna get a lot more arms. apple decided to go into arms for stuff.

i circle back to my initial idea... do we need a different chost for every cpu variation? can't we use cflags and profles? why does it have to trickle down to the chost?

it's the same gcc. it can compile code for any arm/arm64/x86/x86_64/whatever... as long as it's arm. why do we need so many chosts?
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1072
Location: Romania

PostPosted: Fri Jul 17, 2020 8:36 pm    Post subject: Reply with quote

x86_64-pc-linux-gnu

very little debate about that one. it is what it is.

PS. and honestly you make it sound way more alien than it needs to be. than it ever was. special consideration to my stepmother is an alien: https://www.imdb.com/title/tt0095687/.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM 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