kbuild: check the minimum assembler version in Kconfig
Documentation/process/changes.rst defines the minimum assembler version (binutils version), but we have never checked it in the build time. Kbuild never invokes 'as' directly because all assembly files in the kernel tree are *.S, hence must be preprocessed. I do not expect raw assembly source files (*.s) would be added to the kernel tree. Therefore, we always use $(CC) as the assembler driver, and commit aa824e0c ("kbuild: remove AS variable") removed 'AS'. However, we are still interested in the version of the assembler acting behind. As usual, the --version option prints the version string. $ as --version | head -n 1 GNU assembler (GNU Binutils for Ubuntu) 2.35.1 But, we do not have $(AS). So, we can add the -Wa prefix so that $(CC) passes --version down to the backing assembler. $ gcc -Wa,--version | head -n 1 gcc: fatal error: no input files compilation terminated. OK, we need to input something to satisfy gcc. $ gcc -Wa,--...
Showing
- Makefile 3 additions, 1 deletionMakefile
- arch/Kconfig 1 addition, 2 deletionsarch/Kconfig
- init/Kconfig 12 additions, 0 deletionsinit/Kconfig
- scripts/Kconfig.include 6 additions, 0 deletionsscripts/Kconfig.include
- scripts/as-version.sh 82 additions, 0 deletionsscripts/as-version.sh
- scripts/dummy-tools/gcc 6 additions, 0 deletionsscripts/dummy-tools/gcc
Please register or sign in to comment