-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilers: CFLAGS and CLANG/LLVM options #34
Comments
The builder is currently using the defconfig(s) provided by the foundation and I have no plans to veer from this course. There is already an option for people to use a custom defconfig, if they so chose too. If someone would be willing to take on this task "wink wink" I'm all for them doing so. |
Alright. Since using Clang is mostly no profit , if the needed values are not enabled in the config |
I was under the impression when using Clang specific things got ticked off by default in the defconfig? I've also noticed that using Clang on 5.10.y is pretty much garbage and that it only shines when using 5.12.y and up. With that said, I'm sure there are things that can improve the situation with fine tuning. I'm just saying that it's not a current priority of mine and that if someone is willing to pick up that torch and run with it, I would of course have no problem with them doing so. |
git clone -b clang https://github.com/pyavitz/rpi-img-builder.git clang
You should find the following in the userdata.txt file. Tune as you wish and build. ### CLANG TUNING
CFLAGS="" Example: ### CLANG TUNING
CFLAGS="-march=armv8-a+fp+simd" When everyone is satisfied that this actual works, I will push it to master. |
Also with GCC 11 possible. |
The builder doesn't support GCC-11 yet, but I don't see it being a problem when it becomes apart of the equation. We would just need to adjust the lib/function/gcc file, add the CFLAGS variable and assign it to the distro / releases that use it by default. I'm not 100% sure, but I think the only release that currently uses it as an option is, Hirsute Hippo? Anyway, let me know what you find in your testing. I also need to test to see if nothing is placed inside the variable, does the build care? Because if so, the whole tuning bit will need to be isolated. |
CLANG/LLVM (LLVM or LLVM_IAS) LLVM="LLVM_IAS=1" COMPILER TUNING CFLAGS="" Examples: #34
We should now be able to change |
Is this normal? LLVM_IAS=1 Linux version 5.13.9-v8 (root@rpi-img-builder) (gcc (Ubuntu 10.3.0-1ubuntu1)
10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.36.1) #1 SMP PREEMPT Wed Aug 11 22:23:22 EDT 2021 LLVM=1 Linux version 5.13.9-v8 (root@rpi-img-builder) (Ubuntu clang version 12.0.0-3ubuntu1~21.04.1, LLD 12.0.0)
#1 SMP PREEMPT Wed Aug 11 14:27:03 EDT 2021 I'm no expert, but it would appear to me that something is a miss. This is in reference to the comment made here: 5714c1f |
You should use both flags if compiling with Clang LTO. In the example above you used only one compiler flag. it also depends which version of Ubuntu you compile, since you force the kernel compile process depends on the version of the distro. But there should be no difference between the versions distro and the compiled kernel. For example, if xanmod shares a kernel which is compiled with clang 12 and lto, it does not depend on the distro version. (Based on Debian ) |
In the userspace the is difference between using the same compiler. For example, Ubuntu 21.04 uses mostly only llvm/clang lto compiled packages/userspace. The compile process if using THINLTO/FULLL-LTO takes around 30 percent more time then without. |
Actually for the LVM and LVM_IAS flags they are very specific "only" to the kernel itself. And with IAS.. it uses it to choose between LLVM or GNU assembly.. distro independent,. I have found a few test cases that uses it however for output code there are no output targets and none that are non kernel specific. These are also very new and untested by the way |
Yes, thats correct. Mostly using llvm_ias for the kernel is since 5.12 a good tested solution and im also using it as daily driver on several servers and desktops. There is definitly a benefit, i also compiled complete plasma with thinlto and -march=x86-64-v3 and there is also a big differnce to feel. Same with applications like firefox, which is compiled with lto and pgo. The performance differnce is insane. |
Hey would it be possible to use https://web.libera.chat/ to communicate as well so we can have more dynamic discussion? Thank you. we use the #arm-linux-builder channel. |
The following commit should resolve this: 01df896 When GCC-11 becomes a factor, feel free to reopen the issue. |
AS very kernel version also changes the config and features, i think it should be a great idea to deploy several configs for the kernel which will be compiled.
For example:
Raspberry Pi - Zero/W/WH & 1 Model A/B/A+/B+ :
-march=armv6 -mfloat-abi=hard -mfpu=vfp
Raspberry Pi - 2 & 3 Model A/B:
-march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4
Raspberry Pi - 3 & 4 Model A+/B+ & Compute 3/3-lite/3+ (32-Bit):
-march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8
Raspberry Pi - 3 & 4 Model A+/B+ & Compute 3/3-lite/3+ (64-Bit):
-march=armv8-a+fp+simd
Other example from GCC Manuals since GCC11:
`-mtune=name
Link can be found here for more informtions:
https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/ARM-Options.html#ARM-Options
The text was updated successfully, but these errors were encountered: