[loongson-dev] LSF/CLSF for loongson 2f (mipsel with -n 64 abi).

51 views
Skip to first unread message

Javier Vasquez

unread,
Dec 31, 2016, 10:35:36 PM12/31/16
to loongson-dev
Hi,

Are there any LSF/CLSF instructions (patches, specific hitns, and so
on) specific for loongson 2F?

I have 2 old lemote mini-pcs with loongson 2F, but I'd like to build
from scratch a mipsel with -n64 ABI (not the common -n32 one) for
them...

Also pretty useful BLSF/BCLSF (beyond LSF/CLSF), to build as well
applications and stuff.

I'd guess building on loongson 3A/3B would be a lot faster, but
getting boards from lemote, though possible, not affordable. But just
in case, I'd guess by changing "-march" from loongson2f to loongson3a,
that would be it (the patches for 2F would als work for 3A)... If
not, then just in case, can the same references be provided for
loongson 3A/3B?

Thanks,

--
Javier

Mart Raudsepp

unread,
Dec 31, 2016, 10:43:31 PM12/31/16
to loongs...@googlegroups.com
Ühel kenal päeval, L, 31.12.2016 kell 21:35, kirjutas Javier Vasquez:
> Hi,
>
> Are there any LSF/CLSF instructions (patches, specific hitns, and so
> on) specific for loongson 2F?

I'm sorry, but what are LSF/CLSF?

> I have 2 old lemote mini-pcs with loongson 2F, but I'd like to build
> from scratch a mipsel with -n64 ABI (not the common -n32 one) for
> them...

Sure, use Gentoo? :D

> Also pretty useful BLSF/BCLSF (beyond LSF/CLSF), to build as well
> applications and stuff.

Again, I have no clue what BLSF or BCLSF would be.
Google searches don't say anything usefuol for ANY of these acronyms
thrown out here.

> I'd guess building on loongson 3A/3B would be a lot faster, but
> getting boards from lemote, though possible, not affordable.  But
> just
> in case, I'd guess by changing "-march" from loongson2f to
> loongson3a,
> that would be it (the patches for 2F would als work for 3A)...  If
> not, then just in case, can the same references be provided for
> loongson 3A/3B?

Huh?

Javier Vasquez

unread,
Dec 31, 2016, 11:53:49 PM12/31/16
to loongson-dev
> On Sat, Dec 31, 2016 at 9:43 PM, Mart Raudsepp <le...@gentoo.org> wrote:
> I'm sorry, but what are LSF/CLSF?

Ups, I wrote them backwards, :-(

LFS = Linux From Scratch (http://www.linuxfromscratch.org)
CLFS = Cross LFS (http://trac.clfs.org)

I'm sorry, I thought those were well known terms...

> Sure, use Gentoo? :D

Sure Gentoo is an alternative, though I'd rather go with LFS/CLFS if
possible... BTW, though a big deal, but on Gentoo one needs to start
with -n32 abi.

> Again, I have no clue what BLSF or BCLSF would be.
> Google searches don't say anything usefuol for ANY of these acronyms
> thrown out here.

Those are the "beyond" initial build:

BLFS = Beyond LFS (http://www.linuxfromscratch.org/blfs)
CBLFS = Community driven BLFS (http://cblfs.clfs.org/index.php/Main_Page)

> Huh?

Just wondering if the same flags, patches and so on, that apply for
loongson 2F would also apply to 3A. That was all...

BTW, searching for LFS, not mitakenly written will give you outputs on
google, :-) My bad, sorry about that...

Thanks,

--
Javier

Mart Raudsepp

unread,
Jan 2, 2017, 8:22:40 PM1/2/17
to loongs...@googlegroups.com
Ühel kenal päeval, L, 31.12.2016 kell 22:53, kirjutas Javier Vasquez:
> >
> > On Sat, Dec 31, 2016 at 9:43 PM, Mart Raudsepp <le...@gentoo.org>
> > wrote:
> > I'm sorry, but what are LSF/CLSF?
>
> Ups, I wrote them backwards, :-(
>
> LFS = Linux From Scratch (http://www.linuxfromscratch.org)
> CLFS = Cross LFS (http://trac.clfs.org)
>
> I'm sorry, I thought those were well known terms...

LFS, I guess is more known, yeah :)

I consider it to be sort of like Gentoo as an end result, but just with
unnecessary self-inflicted huge pain to choose over Gentoo which leads
to 20x more time needed to get anywhere.

> >
> > Sure, use Gentoo? :D
>
> Sure Gentoo is an alternative, though I'd rather go with LFS/CLFS if
> possible...  BTW, though a big deal, but on Gentoo one needs to start
> with -n32 abi.

And that's the most sensible thing to use on a loongson2f.
n64 would only be for academic use or something imho. But at that point
researching NUBI or something might be more interesting, if that's even
a thing anymore.

n32 IS 64bit, just with 32bit pointers, which on e.g a yeeloong is all
you need as you can address 4GB of virtual memory, and that's more than
you have there, pretty much. Also the limitation of 4GB would be for
one process, you can still have loads of memory, and you can still use
it all, just not map more than 4GB in a given single process.
If you have limited memory, it is better to have 32bit pointers because
it saves process memory and leads to less memory usage.
n32 is like x32 when compared to the PC world, not x86, except unlike
x32, it's actually rather well supported. o32 is what is 32bit and a
waste for a 64bit mips, but n32 still gives you hardware "long long"
type, etc.

That's why I have not personally looked at n64 Gentoo on my yeeloong.
It would simply be worse in every aspect I care, given the RAM it has.

For yeeloong, there's a project
https://wiki.gentoo.org/wiki/Project:Lemote_Yeeloong_Gentoo_Desktop
that provides a loongson2f starting image, albeit currently at a 2014
June state, but it can be upgraded from there, which is definitely
faster than doing some LFS.

That said, you can certainly have n64 too, might just need a bit more
work for an initial setup. There are old n64 stage3's available to
start from, hopefully the CPU bugs for which workarounds are necessary
on loongson2f aren't hit in the base system too hard to cause issues,
but I suspect they might, so might need some messing around, but I
doubt anything as extreme as LFS. But I strongly advise n32 unless you
need a process to use more than 4GB alone (not total, just one specific
process), if you even have 4GB (and don't consider huge swap a solution
there). I have 1GB RAM in my yeeloong, I certainly don't want to have
larger memory pointers taking memory by using n64 instead of n32.

> Just wondering if the same flags, patches and so on, that apply for
> loongson 2F would also apply to 3A.  That was all...
>

I'd really hope the newer families don't need the CPU bug workaround
flags anymore... -Wa,-mfix-loongson2f-nop etc


--
Regards,
Mart Raudsepp
Gentoo Linux - GNOME, GStreamer, X11, MIPS projects

Javier Vasquez

unread,
Jan 3, 2017, 11:20:19 AM1/3/17
to loongson-dev
On Mon, Jan 2, 2017 at 7:22 PM, Mart Raudsepp <le...@gentoo.org> wrote:
> LFS, I guess is more known, yeah :)

:-)

>
> I consider it to be sort of like Gentoo as an end result, but just with
> unnecessary self-inflicted huge pain to choose over Gentoo which leads
> to 20x more time needed to get anywhere.
> ...
> And that's the most sensible thing to use on a loongson2f.
> n64 would only be for academic use or something imho. But at that point
> researching NUBI or something might be more interesting, if that's even
> a thing anymore.
>
> n32 IS 64bit, just with 32bit pointers, which on e.g a yeeloong is all
> you need as you can address 4GB of virtual memory, and that's more than
> you have there, pretty much. Also the limitation of 4GB would be for
> one process, you can still have loads of memory, and you can still use
> it all, just not map more than 4GB in a given single process.
> If you have limited memory, it is better to have 32bit pointers because
> it saves process memory and leads to less memory usage.
> n32 is like x32 when compared to the PC world, not x86, except unlike
> x32, it's actually rather well supported. o32 is what is 32bit and a
> waste for a 64bit mips, but n32 still gives you hardware "long long"
> type, etc.

Yeap, I'm aware of the ABI differences. I want to go the painful way.
Actually for a "n32" ABI I'd guess debian unstable for mipsel, though
not loongson specif, would be the easiest path (the n32 port). Also,
there used to be a mipsel "n32" parabola release (probably loongson
specif) that was discontinued. One can get the initial setup with LFS
for n64, and then move to gentoo or SMGL just changing the flag for
the ABI as well, to keep on easier zone after the initial pain, :-)

>
> That's why I have not personally looked at n64 Gentoo on my yeeloong.
> It would simply be worse in every aspect I care, given the RAM it has.
>
> For yeeloong, there's a project
> https://wiki.gentoo.org/wiki/Project:Lemote_Yeeloong_Gentoo_Desktop
> that provides a loongson2f starting image, albeit currently at a 2014
> June state, but it can be upgraded from there, which is definitely
> faster than doing some LFS.
>
> That said, you can certainly have n64 too, might just need a bit more
> work for an initial setup. There are old n64 stage3's available to
> start from, hopefully the CPU bugs for which workarounds are necessary
> on loongson2f aren't hit in the base system too hard to cause issues,
> but I suspect they might, so might need some messing around, but I
> doubt anything as extreme as LFS. But I strongly advise n32 unless you
> need a process to use more than 4GB alone (not total, just one specific
> process), if you even have 4GB (and don't consider huge swap a solution
> there). I have 1GB RAM in my yeeloong, I certainly don't want to have
> larger memory pointers taking memory by using n64 instead of n32.
>
>> Just wondering if the same flags, patches and so on, that apply for
>> loongson 2F would also apply to 3A. That was all...
>>
>
> I'd really hope the newer families don't need the CPU bug workaround
> flags anymore... -Wa,-mfix-loongson2f-nop etc

BTW, getting familiar with those workarounds is part of the things I
wan to learn, :-) And the lesser the need for them, the better of
course, :-)

Thanks,

--
Javier

张福新

unread,
Jan 3, 2017, 6:33:46 PM1/3/17
to Mart Raudsepp, loongs...@googlegroups.com
New loongson processors do not need fix-loongson2f-nop workaround


发自手机邮件客户端


--
You received this message because you are subscribed to the Google Groups "loongson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loongson-dev...@googlegroups.com.
To post to this group, send email to loongs...@googlegroups.com.
Visit this group at https://groups.google.com/group/loongson-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages