Open tpgxyz opened 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.
Then why it works for CLR ?
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 :-).
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?
glibc-2.33 does support HWCAPS, so we may reach this goal soon.
https://sourceware.org/pipermail/libc-alpha/2020-June/115250.html
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.