1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Author: Luca Boccassi <luca.boccassi@gmail.com>
Description: let Kbuild set the compiler version
If CC=cc is passed to make, the default system compiler will be used. But we
want to build the kernel modules with the same compiler version used to build
the kernel itself. Remove the CC parameter from upstream's Makefile's make
invocation.
--- a/Makefile
+++ b/Makefile
@@ -121,9 +121,9 @@ else
.PHONY: modules module clean clean_conftest modules_install
modules clean modules_install:
- @$(MAKE) "LD=$(LD)" "CC=$(CC)" "OBJDUMP=$(OBJDUMP)" \
+ $(MAKE) \
$(PAHOLE_VARIABLES) $(KBUILD_PARAMS) $@
- @if [ "$@" = "modules" ]; then \
+ @set -x; if [ "$@" = "modules" ]; then \
for module in $(NV_KERNEL_MODULES); do \
if [ -x split-object-file.sh ]; then \
./split-object-file.sh $$module.ko; \
--- a/Kbuild
+++ b/Kbuild
@@ -172,7 +172,7 @@ NV_CONFTEST_SCRIPT := $(src)/conftest.sh
NV_CONFTEST_HEADER := $(obj)/conftest/headers.h
NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST_SCRIPT) \
- "$(CC)" $(ARCH) $(NV_KERNEL_SOURCES) $(NV_KERNEL_OUTPUT)
+ "$(strip $(CC))" $(ARCH) $(NV_KERNEL_SOURCES) $(NV_KERNEL_OUTPUT)
NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_CONFTEST_CMD) build_cflags)
|