OpenMandrivaAssociation / distribution

OpenMandriva Lx is an exciting free Desktop Operating System that aims to cater to and interest first time and advanced users alike. It has the breadth and depth of an advanced system but is designed to be simple and straightforward in use.
https://openmandriva.org
8 stars 2 forks source link

Build per cpu libc libraries #2728

Open tpgxyz opened 4 years ago

tpgxyz commented 4 years ago

Idea is to ship per cpu tuned glibc libraries same as ClearLinux does. They build glibc like this:

provide one i.e libc6 package that ships: /usr/lib64/libm.so /usr/lib64/$mtuned/libm.so

See here how it looks like https://github.com/clearlinux-pkgs/glibc

glibc is smart enough these days so it can pick right libraries that support cpu intructions.

abucodonosor commented 4 years ago

I'm against that way even it may sound nice for you. No, glibc is not smart regarding that, you need to change your whole build system if you wish something like this.

Clear Linux cares about Intel only optimization and nothing else.

tpgxyz commented 4 years ago

Then why it works for CLR ?

abucodonosor commented 4 years ago

They optimize just for Intel even the default build. Didn't look the build sys/boot process but they have for sure something to change the PATH's.

Also, Clear Linux is the wrong Distro to look at for generic builds, really :-).

abucodonosor commented 4 years ago

There is what they build as 'default' glibc:

export CFLAGS="-O3 -march=westmere -mtune=skylake -g2 -m64 -Wl,-z,max-page-size=0x1000 -fPIC -falign-functions=32 -Wa,-mbranches-within-32B-boundaries"

And since they build all with that getting AVX/non-AVX is not much of the problem, just some patches needed and some adjustments to boot process probably.

BTW, isn't your job to research all that before proposing stuff?

tpgxyz commented 3 years ago

glibc-2.33 does support HWCAPS, so we may reach this goal soon.

https://sourceware.org/pipermail/libc-alpha/2020-June/115250.html