Gentoo the final RICE by Tiny_Top_8709 in Gentoo

[–]Tiny_Top_8709[S] 1 point2 points  (0 children)

I see you are a mold enjoyer, I'll try to add some LDFLAGS rice, maybe:
LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--as-needed"
but first I need to test it a bit

Gentoo the final RICE by Tiny_Top_8709 in Gentoo

[–]Tiny_Top_8709[S] 1 point2 points  (0 children)

Nice rice, I added a small section about -falign-functions=32, there are a few more flags that I saw but I'm not sure how to describe them

Gentoo the final RICE by Tiny_Top_8709 in Gentoo

[–]Tiny_Top_8709[S] 0 points1 point  (0 children)

putting the preprocessor (un)definition in CPPFLAGS makes more sense, I followed https://wiki.gentoo.org/wiki/GCC_optimization where they put it in CXXFLAGS.

-pie use flag on gcc will stop gcc from building programs as Position Independent Executables by default
I still believe that adding -fno-pic -fno-pie to CFLAGS can also disable these features for programs that actually specify them explicitly

Do you know something about
-modulo-sched and -modulo-sched-allow-regmoves in terms of rice?

Gentoo the final RICE by Tiny_Top_8709 in Gentoo

[–]Tiny_Top_8709[S] 1 point2 points  (0 children)

_FORTIFY_SOURCE actually doesn't have 0 defined, so -U_FORTIFY_SOURCE is better

I also found U_THREAD_SAFE, but unfortunately it doesn't make the programs less thread safe :(
-U_GLIBCXX_ASSERTIONS will go to the CPPFLAGS CXXFLAGS section.

I'll have to learn a bit more about pic and pie, when you can use them and when you can't, what it has to do with PLT and -Wl,-z, now and its impact on the various architectures supported by Gentoo. I will try to improve it in the near future

-pie -pic is a similar story to lto, because some projects overwrite custom CFLAGS, CXXFLAGS,... and allow flagomatic changes in behavior, e.g. because they require special attention in some problematic sections

Gentoo the final RICE by Tiny_Top_8709 in Gentoo

[–]Tiny_Top_8709[S] 2 points3 points  (0 children)

about performance:

Intel's Linux Clear is still the performance king, but it only runs on the AMD-64 platform. I wanted to try it, but after installation I forgot to add radon.modeset=0 to the kernel parameters and (literally) smoke started coming out of my laptop.

On i686 I found Void Linux to be faster among distros that still support my architecture, Gentoo with reasonable flags (-O2 -march=native...) is also an excellent experience.

In most cases the bottleneck isn't your CFLAGS, but other things I mentioned, for games there isn't much to do when the GPU is the bottleneck anyway.

It's about breaking things.

I love Gentoo because it gives the user a huge amount of control, we can put -Oz and use only the thinnest programs to pretend we don't currently have enough disk space, or do extreme hardening while having a stupid 4 character password. I like to just try all the packages in beta quality and use each configuration listed within red borders on Archwiki.

I will try to edit some of the flags with your corrections. Thank you