Skip to contentSkip to conversation

need to export variables in config.mak

BUG In review Chris Friesen 5 participants 7 messages Sep 30, 2011 – Oct 3, 2011 KVM

lore
Share & tools
lore
#0 lore raw

We've been playing a bit with kvm-kmod-3.0b. We use a cross compile environment, and one of my coworkers noticed that the variables in config.mak weren't actually exported and so didn't actually have any effect.

I think something like the following patch is required.

Thanks,
Chris Friesen

configure +12 -12
Index: kvm-kmod-3.0b/configure
===================================================================
@@ -168,24 +168,24 @@ fi
 rm -f include/asm include-compat/asm
 mkdir -p include
 ln -sf asm-"$karch" include/asm
 ln -sf asm-"$karch" include-compat/asm
 
 cat <<EOF > config.mak
-ARCH=$arch
-PROCESSOR=$processor
-PREFIX=$prefix
-KERNELDIR=$kerneldir
-KERNELSOURCEDIR=$kernelsourcedir
-KERNELVERSION=$kernel_version_str
-CROSS_COMPILE=$cross_prefix
-CC=$cross_prefix$cc
-LD=$cross_prefix$ld
-OBJCOPY=$cross_prefix$objcopy
-AR=$cross_prefix$ar
-KVM_VERSION=$(kvm_version)
+export ARCH=$arch
+export PROCESSOR=$processor
+export PREFIX=$prefix
+export KERNELDIR=$kerneldir
+export KERNELSOURCEDIR=$kernelsourcedir
+export KERNELVERSION=$kernel_version_str
+export CROSS_COMPILE=$cross_prefix
+export CC=$cross_prefix$cc
+export LD=$cross_prefix$ld
+export OBJCOPY=$cross_prefix$objcopy
+export AR=$cross_prefix$ar
+export KVM_VERSION=$(kvm_version)
 EOF
 
 cat <<EOF > kvm-kmod-config.h
 #define KERNEL_EXTRAVERSION $kernel_extraversion
 $config_fedora_kernel
 EOF
Signature · 5 lines
Chris Friesen
Software Developer
GENBAND
[email protected]
www.genband.com
#1 lore raw
Quoted 3 lines · Chris Friesen

We've been playing a bit with kvm-kmod-3.0b. We use a cross compile environment, and one of my coworkers noticed that the variables in config.mak weren't actually exported and so didn't actually have any effect.

I think something like the following patch is required.

If you can confirm that they have the right effect and put a signed-off
+ description to the patch, I'll merge it.

Thanks,
Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#2 lore raw

PATCH 1/1 need to export variables in config.mak

The variables being written to config.mak by configure need to be exported in order to take effect when building the package.

The following patch fixes this in our environment.

configure +12 -12
Index: kvm-kmod-3.0b/configure
===================================================================
@@ -168,24 +168,24 @@ fi
 rm -f include/asm include-compat/asm
 mkdir -p include
 ln -sf asm-"$karch" include/asm
 ln -sf asm-"$karch" include-compat/asm
 
 cat <<EOF > config.mak
-ARCH=$arch
-PROCESSOR=$processor
-PREFIX=$prefix
-KERNELDIR=$kerneldir
-KERNELSOURCEDIR=$kernelsourcedir
-KERNELVERSION=$kernel_version_str
-CROSS_COMPILE=$cross_prefix
-CC=$cross_prefix$cc
-LD=$cross_prefix$ld
-OBJCOPY=$cross_prefix$objcopy
-AR=$cross_prefix$ar
-KVM_VERSION=$(kvm_version)
+export ARCH=$arch
+export PROCESSOR=$processor
+export PREFIX=$prefix
+export KERNELDIR=$kerneldir
+export KERNELSOURCEDIR=$kernelsourcedir
+export KERNELVERSION=$kernel_version_str
+export CROSS_COMPILE=$cross_prefix
+export CC=$cross_prefix$cc
+export LD=$cross_prefix$ld
+export OBJCOPY=$cross_prefix$objcopy
+export AR=$cross_prefix$ar
+export KVM_VERSION=$(kvm_version)
 EOF
 
 cat <<EOF > kvm-kmod-config.h
 #define KERNEL_EXTRAVERSION $kernel_extraversion
 $config_fedora_kernel
 EOF
Signature · 5 lines
Chris Friesen
Software Developer
GENBAND
[email protected]
www.genband.com
#4 lore raw
In reply to Chris Friesen
Quoted 4 lines · Chris Friesen

We've been playing a bit with kvm-kmod-3.0b. We use a cross compile environment, and one of my coworkers noticed that the variables in config.mak weren't actually exported and so didn't actually have any effect.

Please elaborate on "no effect", and what actual problems you are experiencing. I do cross-compilation builds all the time and have no such problems.

r~

#5 lore raw

Am 30.09.2011 um 19:52 schrieb Richard Henderson <[email protected]>:

Quoted 9 lines · Chris Friesen
Quoted 4 lines

We've been playing a bit with kvm-kmod-3.0b. We use a cross compile environment, and one of my coworkers noticed that the variables in config.mak weren't actually exported and so didn't actually have any effect.

Please elaborate on "no effect", and what actual problems you are experiencing. I do cross-compilation builds all the time and have no such problems.

You cross-compile kvm-kmod?

Alex

Quoted 1 line
#6 lore raw
In reply to Richard Henderson
Quoted 9 lines · Richard Henderson
Quoted 4 lines · Chris Friesen

We've been playing a bit with kvm-kmod-3.0b. We use a cross compile environment, and one of my coworkers noticed that the variables in config.mak weren't actually exported and so didn't actually have any effect.

Please elaborate on "no effect", and what actual problems you are experiencing. I do cross-compilation builds all the time and have no such problems.

The behaviour I see is that I configure with --cross-prefix=<prefix> then the appropriate prefix gets set in config.mak. However, when running "make" the prefix doesn't actually get used.

If building for the same target as the host machine this isn't immediately obvious because it uses the host compiler. However, if you run "make V=1" it will show which compiler is being used.

Chris

Signature · 5 lines
Chris Friesen
Software Developer
GENBAND
[email protected]
www.genband.com
#3 lore raw
In reply to Chris Friesen
Quoted 41 lines · Chris Friesen

The variables being written to config.mak by configure need to be exported in order to take effect when building the package.

The following patch fixes this in our environment.

Index: kvm-kmod-3.0b/configure
===================================================================

configure +8 -12
@@ -168,24 +168,24 @@ fi
 rm -f include/asm include-compat/asm
 mkdir -p include
 ln -sf asm-"$karch" include/asm
 ln -sf asm-"$karch" include-compat/asm
 
 cat <<EOF > config.mak
-ARCH=$arch
-PROCESSOR=$processor
-PREFIX=$prefix
-KERNELDIR=$kerneldir
-KERNELSOURCEDIR=$kernelsourcedir
-KERNELVERSION=$kernel_version_str
-CROSS_COMPILE=$cross_prefix
-CC=$cross_prefix$cc
-LD=$cross_prefix$ld
-OBJCOPY=$cross_prefix$objcopy
-AR=$cross_prefix$ar
-KVM_VERSION=$(kvm_version)
+export ARCH=$arch
+export PROCESSOR=$processor
+export PREFIX=$prefix
+export KERNELDIR=$kerneldir
+export KERNELSOURCEDIR=$kernelsourcedir
+export KERNELVERSION=$kernel_version_str
+export CROSS_COMPILE=$cross_prefix
+export CC=$cross_prefix$cc

configure fi · line 191

Quoted 10 lines
configure +4 -0
+export LD=$cross_prefix$ld
+export OBJCOPY=$cross_prefix$objcopy
+export AR=$cross_prefix$ar
+export KVM_VERSION=$(kvm_version)
 EOF
 
 cat <<EOF > kvm-kmod-config.h
 #define KERNEL_EXTRAVERSION $kernel_extraversion
 $config_fedora_kernel
 EOF

Thanks, merged. I just dropped the export from those variables that are kvm-kmod-only.

Jan