GCC - How to figure out what default flags it is using

With the GCC compiler, how do I figure out what default flags is it using?

That’s what I got compiling ‘hello world’ in C with gcc 9.2.1 ( gcc -Q -v hello_world.c )
2020-02-22-164756_1366x768_scrot

Thanks mate, do you know how do I change the default flags by any chance?

What are you trying to compile? Those are just a bunch of optimizations, there are also target specific flags that may be added as well. I don’t know whether you can disable them all, but you can pass flags yourself while compiling, many flags have negative forms, this way you can turn some of them off.

I want to try and use Clear Linux’s kernel since people claim that when they ran it on their kernel on their own distro it performs better, but it is recommended that I use Clear Linux’s default flags as the kernel can then get optimised the most. I don’t know what their default flags are. If I know how to output its current set flags, I could compile it in EndeavourOS.

Mixing other distros kernels is not recommended. Feel free to try it’s your system :yum:

Why don’t you just try Linux-zen. It works well on my system installation.

1 Like

Yes that is why on Grub I will be given different kernel options to boot into, incase Clear Linux’s kernel does not work.

I have tried it but when I did a benchmark test, it does worse than linux-vanilla.

Please post the results of the tests you ran linux vanilla and linux-zen as well as what test you ran.

1 Like

I’ve never compiled a kernel myself, so I have no idea what its default flags are. Does it use makefiles? Are you sure you need to modify/pass flags by hand? Is there a documentation?

Yeah sure I will soon when I boot into Endeavour next time and I was using glmark2.

Some guy told me that when he compiled Clear Linux’s kernel in Arch Linux (by using the default flags), he was not able to get as much performance compared to using Clear Linux’s gcc flags

Why not just install Clear Linux. It does post the fastest benchmarks if that’s what you’re looking for.

Edit: You have to remember one thing. Clear Linux is optimized for Intel Hardware. Clear Linux does not support non-intel graphics chipsets which means if you want a desktop like gnome on an amd gpu or an nvidia gpu, you can’t. The benchmark ignores graphics performance totally. The deafult Arch linux kernel is still the recommended way if you want to use non Intel GPU’s.

I could but like I prefer EndeavourOS (or something that is close to Arch) because it uses pacman and I honestly don’t like flatpak as it is too bloated (they use flatpak). I could take some parts from Clear Linux and use it in EndeavourOS instead.

Surprisingly some people on YouTube’s comment section (for a video that discussed Clear Linux) claim that when they ran Clear Linux on AMD graphics cards and/or CPUs, they claimed it still performed better than when they were running Ubuntu on it. I can give you a link to the video if you like?

But yeah my hardware is all Intel.

Ok so here are the results.

linux

1065

linux-zen

1012

Last time there was a much bigger difference when I ran the glmark2 test.

1 Like

Perhaps you can try this…beware it’s a :rabbit: hole :yum:

2 Likes

Looks very interesting. I might want to try it one day. Thanks for sharing this link :slight_smile: