Jump to content
I would like to know about gcc 9.1.0 compilers compatibility with intel processors?

The matter is that I want use Linux From Scratch as a daily driver.

I have 7th gen Intel core i5 processor 7200U in my laptop whose code name is kabylake.

When compiling the last version of Linux From Scratch I used to pass CFLAGS="-O2 -pipe -march=skylake" to the compiler because there was no kabylake support in the gcc compiler.

Now I am making the newer version of LFS for my system and I have switched over to gcc-9.1.0 compiler and expected that -march=kabylake support would be there.

 

When I did that the compiler reported

 

gcc -Wall -Winline -O2 -pipe -march=kabylake -g -D_FILE_OFFSET_BITS=64 -c blocksort.c

cc1: error: bad value ('kabylake') for '-march=' switch

cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native

 

But then I noticed there is canonlake listed above which is  10-nanometer die shrink of the Kaby Lake microarchitecture (ref wikipedia)

And My Question is

Can I pass -march=canonlake to gcc-9.1.0 compiler

Would my processor support the binaries or is there any better switch for my processor

Link to comment
Share on other sites

Link to post
Share on other sites

I think the best way to try this is compiling a simple binary to test?

Even though, you could just use -march=native to be sure to have optimized binaries for your cpu

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, ibrahim665 said:

The matter is that I want use Linux From Scratch as a daily driver.

Don't. That's not what it's intended for. You get a minimal system that only does the basics so you can learn how a Linux system is typically built. You don't get something you can use effectively out of the box.

 

The architecture you want is probably skylake-avx512 but, as @Chunchunmaru_ pointed out, you can just use "native" to use whatever the compiler thinks is appropriate for your cpu.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

45 minutes ago, Sauron said:

Don't. That's not what it's intended for. You get a minimal system that only does the basics so you can learn how a Linux system is typically built. You don't get something you can use effectively out of the box.

 

The architecture you want is probably skylake-avx512 but, as @Chunchunmaru_ pointed out, you can just use "native" to use whatever the compiler thinks is appropriate for your cpu.

I Know that LFS gives only minimal system, but I had Xfce running on the base system and I had built LFS so many times that I know the underlying basics of a Linux system can compile it with ease. Also  I don't want to hand over my pc to systemd. I prefer Xfce the most and want to have absolute control over my system.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, ibrahim665 said:

I Know that LFS gives only minimal system, but I had Xfce running on the base system and I had built LFS so many times that I know the underlying basics of a Linux system can compile it with ease. Also  I don't want to hand over my pc to systemd. I prefer Xfce the most and want to have absolute control over my system.

If you don't want systemd and want to control compilation flags you can use gentoo

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

18 hours ago, Sauron said:

If you don't want systemd and want to control compilation flags you can use gentoo

Yeah, I thought of using gentoo, but I don't know how to build it.

Once I tried building gentoo but its manual is so much confusing that I quit trying to build it.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, ibrahim665 said:

Yeah, I thought of using gentoo, but I don't know how to build it.

Once I tried building gentoo but its manual is so much confusing that I quit trying to build it.

 

3 hours ago, ibrahim665 said:

Also I want to use runit instead of openrc-init

Gentoo supports runit iirc. If you're having trouble building it try watching a youtube tutorial.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, ibrahim665 said:

Also I want to use runit instead of openrc-init

just change the symlink for /sbin/init, but be sure to completely configure the init...

Link to comment
Share on other sites

Link to post
Share on other sites

On 8/16/2019 at 9:55 AM, ibrahim665 said:

I would like to know about gcc 9.1.0 compilers compatibility with intel processors?

<...>

Would my processor support the binaries or is there any better switch for my processor

Generally, optimization options would only change when there's a substantial departure from an older microarchitecture, be it a new instruction set or a latency/throughput change. Cannon Lake introduces the AVX512 extension, while Kaby Lake just isn't different enough from, I guess, Skylake, to get a different set of optimization parameters.

 

You may ask the compiler itself for its opinion on the native architecture with `gcc -Q -march=native --help=target | grep march`.

Link to comment
Share on other sites

Link to post
Share on other sites

I will go with -march=skylake because

gcc -Q -march=native --help=target | grep march`

returns broadwell which is older than skylake

 

Link to comment
Share on other sites

Link to post
Share on other sites

30 minutes ago, ibrahim665 said:

I will go with -march=skylake because

gcc -Q -march=native --help=target | grep march`

returns broadwell which is older than skylake

 

probably the cpu feature sets are the same

Link to comment
Share on other sites

Link to post
Share on other sites

I will switch to gentoo If I found a good tutorial in youtube

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, ibrahim665 said:

I will switch to gentoo If I found a good tutorial in youtube

Just following the gentoo documentation isn't a bad idea tbh, it's not that difficult once you know what is needed
 
What was the problem? 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, ibrahim665 said:

I will go with -march=skylake because

gcc -Q -march=native --help=target | grep march`

returns broadwell which is older than skylake

 

You probably run an older gcc (most likely gcc 7). Are you sure it is gcc 9? What does `gcc -v` say?

Link to comment
Share on other sites

Link to post
Share on other sites

15 hours ago, Chunchunmaru_ said:

Just following the gentoo documentation isn't a bad idea tbh, it's not that difficult once you know what is needed
 
What was the problem? 

I am good with linux from scratch for now 

viewed youtube tutorials but they were outdated and my installation was not going in the same direction a it did on youtube 

and the gentoo documentation is a mess I couldn't understand a single thing

 

Gentoo gave me one hell of a headache by just viewing its manuals

I could have made another LFS base system with Xorg and wireless network capabilities instead of wasting my entire evening yesterday

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, elevenish said:

You probably run an older gcc (most likely gcc 7). Are you sure it is gcc 9? What does `gcc -v` say?

I ran the command on host gcc 7

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×