Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can someone explain the new "multiarch" flag in glibc?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
kajzer
Apprentice
Apprentice


Joined: 27 Nov 2014
Posts: 299

PostPosted: Thu Oct 25, 2018 4:42 pm    Post subject: Reply with quote

Tony0945 wrote:
Wouldn't that be the multilib flag not multiarch ?


Different names for the same thing, at least I think that's the case.
Anyway I don't have multilib flag for glibc.
One way to test what I said would be to turn off multiarch flag and try to run steam, one of these days...

Edit:
Maybe you meant multilib profile, yeah I do have that.
There was no multilib flag in 'equery uses glibc' and that confused me....


Last edited by kajzer on Thu Oct 25, 2018 7:07 pm; edited 2 times in total
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2688
Location: Illinois, USA

PostPosted: Thu Oct 25, 2018 5:35 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I didn't notice any artifacts (but I'm running an older tbird anyway) but I did go ahead and recompile glibc without multiarch.
I don't see a need for it, at least on my system.

not true artifacts as in little squares , but slow loading and half size then a few seconds later full size, wrong shapes that correct themselves, things like that, like I was running a twenty year old cpu.

Loads fast now.
Back to top
View user's profile Send private message
s_j_newbury
n00b
n00b


Joined: 05 Apr 2007
Posts: 55
Location: UK

PostPosted: Fri Nov 30, 2018 6:13 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Not sure what it does, but it seems to be in the fpu area of the source code. Not sure if it's necessary or not.


ETA:
Quote:
What is this Multiarch?

Multiarch lets you install library packages from multiple architectures on the same machine. This is useful in various ways, but the most common is installing both 64 and 32-bit software on the same machine and having dependencies correctly resolved automatically. In general you can have libraries of more than one architecture installed together and applications from one architecture or another installed as alternatives. Note that it does not enable multiple architecture versions of applications to be installed simultaneously.


https://wiki.debian.org/Multiarch/HOWTO

Maybe they're trying to fix the 64/32 bit jungle that they created.

Funnily enough, I'm going to try to create such a Gentoo profile soon. It's near the top of my TODO list after completing x32 support! ;-)

It's something that Debian got right IMHO. It has the distinct advantage of much easier cross-emerge-support, you can have multiple archs like current multi-abi, and even qemu-user based dynamic re-compilation which in principle enables such features as running x86* binary only games on powerpc for example.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1574
Location: United Kingdom

PostPosted: Fri Nov 30, 2018 9:55 pm    Post subject: Reply with quote

https://gentoo.org/support/use-flags/

Quote:
multiarch     enable optimizations for multiple CPU architectures (detected at runtime)

I assume it is fine (better?) for users of multilib Gentoo on a single machine to merge glibc with USE="-multiarch multilib"?
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2490
Location: Canada

PostPosted: Fri Nov 30, 2018 10:40 pm    Post subject: Reply with quote

krinn wrote:


And my second question i had in mind was already answered by Anon-E-moose quote in IFUNC, as i was worried about implementation of testing with the Once an implementation choice is made it is fixed and may not be changed for the lifetime of the process
Because if you are making test each time the function is called, the test will draw any benefits from their results (you test if mmx or sse is better, but it has a speed cost doing the testing, voiding the speed gain from branching to the best function).

Result of this (for me), is that it looks good on paper, but i'm less sure it do good finally. Testing if a function run faster or slower in mmx or see on a busy cpu may not gives the best answer for the given cpu, while people try to run benchmark on a non busy cpu to not disturb the test, glibc will run its tests when the function is called, with random results in practice as the cpu may be working hard doing something else ; with the end result that glibc will say "mmx version run faster", while in real, the sse one will always do better, but not at the time the tests were made.


But then I read it that it tests the function once during process lifetime, on the first call, which seems to be a good compromise between testing it on every call and once during compile time ? Yes, if CPU state during the first call is very different than during subsequent life of the process, it may make non-optimal choice, but this is not too bad.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1574
Location: United Kingdom

PostPosted: Sat Dec 01, 2018 5:41 pm    Post subject: Reply with quote

Are the following Stack Overflow question and replies referring to the same thing as USE="multiarch" in this Gentoo Forums thread?: https://unix.stackexchange.com/questions/458069/multilib-and-multiarch

Stephen Kitt wrote:
Note that you can build either way, and then run either way — a binary built with multilib can be run in a multiarch setup, and vice-versa.

_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Moonboots
Tux's lil' helper
Tux's lil' helper


Joined: 02 Dec 2006
Posts: 113

PostPosted: Sun Dec 02, 2018 8:53 am    Post subject: Reply with quote

Perhaps one of our developers could chip in and explain the flag ?
Back to top
View user's profile Send private message
Ionen
n00b
n00b


Joined: 06 Dec 2018
Posts: 1

PostPosted: Thu Dec 06, 2018 2:58 pm    Post subject: Reply with quote

While I'm aware of what --enable/disable-multi-arch does, I'm confused as to which version of functions glibc uses in a case where it's disabled. Does it just use the generic version by default? Anyone know how that goes?

Edit: Upon closer inspection, I "think" most default picks receive hand-crafted asm-based optimizations without it (seems to be handled in the top function.S while separate multiarch/function-avx.S and the like are unused if disabled, do think the C version is not used if the arch allows it), all those cross-references and stubs in the source are pretty confusing. So I believe it's safe (and faster) for the average gentoo user to disable this flag unless you're building for use on multiple machines with same arch but different cpus. IFUNC-using glibc (what multi-arch uses to select function versions) also break some older software, but that's not going to be a problem for a lot of people.
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
Goto page Previous  1, 2
Page 2 of 2

 
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