diff mbox

kvm-kmod: x86: Drop duplicate external-module-compat objects

Message ID 4A170535.3090007@web.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka May 22, 2009, 8:04 p.m. UTC
This redundancy breaks subtly when building against recent OpenSUSE
kernels.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 x86/Kbuild |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Chris Wright May 23, 2009, 1:36 a.m. UTC | #1
* Jan Kiszka (jan.kiszka@web.de) wrote:
> This redundancy breaks subtly when building against recent OpenSUSE
> kernels.

What breaks?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Kiszka May 23, 2009, 11:55 a.m. UTC | #2
Chris Wright wrote:
> * Jan Kiszka (jan.kiszka@web.de) wrote:
>> This redundancy breaks subtly when building against recent OpenSUSE
>> kernels.
> 
> What breaks?

When building external-module-compat.c, linux/scripts/basic/hash somehow
gets called with a multi-word modname. It complains via its usage, and
gcc then tries to compile files it derives from that output:

  gcc -Wp,-MD,/data/kvm-kmod/x86/../.external-module-compat.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.3/include -D__KERNEL__ -I/data/kvm-kmod/include -Iinclude    -Iinclude2 -I/lib/modules/2.6.27.21-0.1-default/source/include  -Iarch/x86/include -I/data/kvm-kmod/include-compat      -include include/linux/autoconf.h       -include /data/kvm-kmod/x86/external-module-compat.h   -I/data/kvm-kmod/x86 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -I/usr/src/linux-2.6.27.21-0.1/include/asm-x86/mach-default -Iinclude/asm-x86/mach-default -fno-stack-protector -fomit-frame-pointer -fasynchronous-unwind-tables -g -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -DMODULE -D"KBUILD_STR(
s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(external_module_compat)"  -D"DEBUG_HASH=Usage: ./scripts/basic/hash <djb2|r5> <modname>" -D"DEBUG_HASH2=Usage: ./scripts/basic/hash <djb2|r5> <modname>" -c -o /data/kvm-kmod/x86/../.tmp_external-module-compat.o /data/kvm-kmod/x86/../external-module-compat.c
gcc: <djb2|r5>: Datei oder Verzeichnis nicht gefunden
gcc: <modname>: Datei oder Verzeichnis nicht gefunden
gcc: <djb2|r5>: Datei oder Verzeichnis nicht gefunden
gcc: <modname>: Datei oder Verzeichnis nicht gefunden

Jan
Avi Kivity May 24, 2009, 8:15 a.m. UTC | #3
Jan Kiszka wrote:
> This redundancy breaks subtly when building against recent OpenSUSE
> kernels.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
>  x86/Kbuild |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/x86/Kbuild b/x86/Kbuild
> index e304c79..ade87fc 100644
> --- a/x86/Kbuild
> +++ b/x86/Kbuild
> @@ -13,7 +13,7 @@ endif
>  ifeq ($(CONFIG_IOMMU_API),y)
>  kvm-objs += iommu.o
>  endif
> -kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o
> -kvm-amd-objs := svm.o ../external-module-compat.o
> +kvm-intel-objs := vmx.o vmx-debug.o
> +kvm-amd-objs := svm.o
>  
>   

IIRC, for really old kernels, some symbols are defined in 
external-module-compat.c and needed by kvm-$arch.ko.  So we'll have to 
export those symbols if we drop the double link (which is a good idea 
regardless of the build problem).
Avi Kivity May 24, 2009, 8:17 a.m. UTC | #4
Jan Kiszka wrote:
> Chris Wright wrote:
>   
>> * Jan Kiszka (jan.kiszka@web.de) wrote:
>>     
>>> This redundancy breaks subtly when building against recent OpenSUSE
>>> kernels.
>>>       
>> What breaks?
>>     
>
> When building external-module-compat.c, linux/scripts/basic/hash somehow
> gets called with a multi-word modname. It complains via its usage, and
> gcc then tries to compile files it derives from that output:
>
>   gcc -Wp,-MD,/data/kvm-kmod/x86/../.external-module-compat.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.3/include -D__KERNEL__ -I/data/kvm-kmod/include -Iinclude    -Iinclude2 -I/lib/modules/2.6.27.21-0.1-default/source/include  -Iarch/x86/include -I/data/kvm-kmod/include-compat      -include include/linux/autoconf.h       -include /data/kvm-kmod/x86/external-module-compat.h   -I/data/kvm-kmod/x86 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -I/usr/src/linux-2.6.27.21-0.1/include/asm-x86/mach-default -Iinclude/asm-x86/mach-default -fno-stack-protector -fomit-frame-pointer -fasynchronous-unwind-tables -g -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -DMODULE -D"KBUILD_STR(
> s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(external_module_compat)"  -D"DEBUG_HASH=Usage: ./scripts/basic/hash <djb2|r5> <modname>" -D"DEBUG_HASH2=Usage: ./scripts/basic/hash <djb2|r5> <modname>" -c -o /data/kvm-kmod/x86/../.tmp_external-module-compat.o /data/kvm-kmod/x86/../external-module-compat.c
> gcc: <djb2|r5>: Datei oder Verzeichnis nicht gefunden
> gcc: <modname>: Datei oder Verzeichnis nicht gefunden
> gcc: <djb2|r5>: Datei oder Verzeichnis nicht gefunden
> gcc: <modname>: Datei oder Verzeichnis nicht gefunden
>
>   

Can you show the call to hash?  It's more interesting than the aftermath 
of its failure.
Jan Kiszka May 25, 2009, 6:49 a.m. UTC | #5
Avi Kivity wrote:
> Jan Kiszka wrote:
>> Chris Wright wrote:
>>  
>>> * Jan Kiszka (jan.kiszka@web.de) wrote:
>>>    
>>>> This redundancy breaks subtly when building against recent OpenSUSE
>>>> kernels.
>>>>       
>>> What breaks?
>>>     
>>
>> When building external-module-compat.c, linux/scripts/basic/hash somehow
>> gets called with a multi-word modname. It complains via its usage, and
>> gcc then tries to compile files it derives from that output:
>>
>>   gcc -Wp,-MD,/data/kvm-kmod/x86/../.external-module-compat.o.d 
>> -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.3/include
>> -D__KERNEL__ -I/data/kvm-kmod/include -Iinclude    -Iinclude2
>> -I/lib/modules/2.6.27.21-0.1-default/source/include 
>> -Iarch/x86/include -I/data/kvm-kmod/include-compat      -include
>> include/linux/autoconf.h       -include
>> /data/kvm-kmod/x86/external-module-compat.h   -I/data/kvm-kmod/x86
>> -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
>> -fno-common -Werror-implicit-function-declaration -Os -m64
>> -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time
>> -maccumulate-outgoing-args -DCONFIG_AS_CFI=1
>> -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -mno-sse
>> -mno-mmx -mno-sse2 -mno-3dnow
>> -I/usr/src/linux-2.6.27.21-0.1/include/asm-x86/mach-default
>> -Iinclude/asm-x86/mach-default -fno-stack-protector
>> -fomit-frame-pointer -fasynchronous-unwind-tables -g
>> -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -DMODULE
>> -D"KBUILD_STR(
>> s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(external_module_compat)" 
>> -D"DEBUG_HASH=Usage: ./scripts/basic/hash <djb2|r5> <modname>"
>> -D"DEBUG_HASH2=Usage: ./scripts/basic/hash <djb2|r5> <modname>" -c -o
>> /data/kvm-kmod/x86/../.tmp_external-module-compat.o
>> /data/kvm-kmod/x86/../external-module-compat.c
>> gcc: <djb2|r5>: Datei oder Verzeichnis nicht gefunden
>> gcc: <modname>: Datei oder Verzeichnis nicht gefunden
>> gcc: <djb2|r5>: Datei oder Verzeichnis nicht gefunden
>> gcc: <modname>: Datei oder Verzeichnis nicht gefunden
>>
>>   
> 
> Can you show the call to hash?  It's more interesting than the aftermath
> of its failure.
> 

strace said eg.:

execve("./scripts/basic/hash", ["./scripts/basic/hash", "djb2",
"/data/kvm-kmod/x86/..kvm", "kvm-amd", "kvm-intel"], ...

Jan
Avi Kivity May 25, 2009, 9:40 a.m. UTC | #6
Jan Kiszka wrote:
>> Can you show the call to hash?  It's more interesting than the aftermath
>> of its failure.
>>
>>     
>
> strace said eg.:
>
> execve("./scripts/basic/hash", ["./scripts/basic/hash", "djb2",
> "/data/kvm-kmod/x86/..kvm", "kvm-amd", "kvm-intel"], ...
>   

Tried to look what's going on.  Never again.
diff mbox

Patch

diff --git a/x86/Kbuild b/x86/Kbuild
index e304c79..ade87fc 100644
--- a/x86/Kbuild
+++ b/x86/Kbuild
@@ -13,7 +13,7 @@  endif
 ifeq ($(CONFIG_IOMMU_API),y)
 kvm-objs += iommu.o
 endif
-kvm-intel-objs := vmx.o vmx-debug.o ../external-module-compat.o
-kvm-amd-objs := svm.o ../external-module-compat.o
+kvm-intel-objs := vmx.o vmx-debug.o
+kvm-amd-objs := svm.o
 
 CFLAGS_kvm_main.o = -DKVM_MAIN