mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	kbuild: fix linux-headers package build when $(CC) cannot link userspace
Since commit5f73e7d038("kbuild: refactor cross-compiling linux-headers package"), the linux-headers Debian package fails to build when $(CC) cannot build userspace applications, for example, when using toolchains installed by the 0day bot. The host programs in the linux-headers package should be rebuilt using the disto's cross-compiler, ${DEB_HOST_GNU_TYPE}-gcc instead of $(CC). Hence, the variable 'CC' must be expanded in this shell script instead of in the top-level Makefile. Commitf354fc88a7("kbuild: install-extmod-build: add missing quotation marks for CC variable") was not a correct fix because CC="ccache gcc" should be unrelated when rebuilding userspace tools. Fixes:5f73e7d038("kbuild: refactor cross-compiling linux-headers package") Reported-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Closes: https://lore.kernel.org/linux-kbuild/CAK7LNARb3xO3ptBWOMpwKcyf3=zkfhMey5H2KnB1dOmUwM79dA@mail.gmail.com/T/#t Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
		
							parent
							
								
									d1d0963121
								
							
						
					
					
						commit
						140332b6ed
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -62,8 +62,8 @@ if [ "${CC}" != "${HOSTCC}" ]; then | ||||||
| 	# | 	# | ||||||
| 	# Clear VPATH and srcroot because the source files reside in the output | 	# Clear VPATH and srcroot because the source files reside in the output | ||||||
| 	# directory. | 	# directory. | ||||||
| 	# shellcheck disable=SC2016 # $(MAKE), $(CC), and $(build) will be expanded by Make | 	# shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make | ||||||
| 	"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC="$(CC)" VPATH= srcroot=. $(build)='"${destdir}"/scripts | 	"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"${destdir}"/scripts | ||||||
| 
 | 
 | ||||||
| 	rm -f "${destdir}/scripts/Kbuild" | 	rm -f "${destdir}/scripts/Kbuild" | ||||||
| fi | fi | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Masahiro Yamada
						Masahiro Yamada