# cannot compile any version of openvz-sources

## youvnor

i have tryied quite every possible configuration of apic and watchdog but nothing to do.

This is the error i get:

```
  CC      arch/x86/kernel/apic/apic.o

arch/x86/kernel/apic/apic.c: In function 'setup_boot_APIC_clock':

arch/x86/kernel/apic/apic.c:819: error: 'nmi_watchdog' undeclared (first use in this function)

arch/x86/kernel/apic/apic.c:819: error: (Each undeclared identifier is reported only once

arch/x86/kernel/apic/apic.c:819: error: for each function it appears in.)

arch/x86/kernel/apic/apic.c:819: error: 'NMI_IO_APIC' undeclared (first use in this function)

arch/x86/kernel/apic/apic.c: In function 'end_local_APIC_setup':

arch/x86/kernel/apic/apic.c:1407: error: implicit declaration of function 'nmi_watchdog_default'

arch/x86/kernel/apic/apic.c:1408: error: implicit declaration of function 'setup_apic_nmi_watchdog'

arch/x86/kernel/apic/apic.c: In function 'APIC_init_uniprocessor':

arch/x86/kernel/apic/apic.c:1784: error: implicit declaration of function 'localise_nmi_watchdog'

arch/x86/kernel/apic/apic.c:1792: error: implicit declaration of function 'check_nmi_watchdog'

```

googling around gave me no solutions

----------

## wcg

Look at the kernel source. The error is being reported in this file:

```

arch/x86/kernel/apic/apic.c

```

What file in the kernel is

```

nmi_watchdog

```

declared in? Is that a variable or a function name? Either way,

there should be a C header file that apic.c needs to include

to declare/define it.

----------

## jormartr

What openvz kernel version are you compiling, and what config are you using?

----------

## youvnor

 *jormartr wrote:*   

> What openvz kernel version are you compiling, and what config are you using?

 

I want to compile linux-2.6.32-openvz-053.5 but the problem persist with linux-2.6.32-openvz-049.6 and linux-2.6.32-openvz-062.2

I tryed removing (or building everything) all possible config from acpi and removing watchdog with no success.

my last 2.6.32.53.5 .config: http://test.dmep.it/kernel_config

----------

## youvnor

 *wcg wrote:*   

> Look at the kernel source. The error is being reported in this file:
> 
> ```
> 
> arch/x86/kernel/apic/apic.c
> ...

 

i looked in it, commenting or changing but i cannot solve the problem.

----------

## jormartr

Are you using the config from openvz.org site?

amd64 config 042stab.53.5

----------

## wcg

Have you used earlier versions of openvz kernels before?

If you have an earlier version that compiles ok, look in

/usr/src/linux/arch/x86/apic/apic.c. Are the #includes the

same as they are in the openvz kernel version with

the error? If they are, then the missing #include is in

some other header (you can have #includes that include

other .h files that include other .h files, etc; the missing

one could be down the chain somewhere).

Then compare the kernel .config files between the version

that compiles ok and the one that does not. Do they match?

If not, what options are enabled in the .config file for the

kernel that compiles that are not enabled in the kernel

that fails to compile?

----------

## youvnor

 *jormartr wrote:*   

> Are you using the config from openvz.org site?
> 
> amd64 config 042stab.53.5

 

this config work

tks

----------

## youvnor

 *wcg wrote:*   

> Have you used earlier versions of openvz kernels before?
> 
> If you have an earlier version that compiles ok, look in
> 
> /usr/src/linux/arch/x86/apic/apic.c. Are the #includes the
> ...

 

i tried looking in to it but my old kernel is really old (2.6.27) and i got a little lost

----------

## wcg

You could try stepping forward 1 openvz kernel version at a time

from 2.6.27 and use the last one that compiles before the one that

does not compile. Then compare the apic.c #includes from the

one that compiles with the apic.c #includes from the one with

the error (and likewise for the kernel .config options).

----------

## bonyiii

 *youvnor wrote:*   

>  *jormartr wrote:*   Are you using the config from openvz.org site?
> 
> amd64 config 042stab.53.5 
> 
> this config work
> ...

 

This config really better but now i got this error, any idea how to solve it?

  VDSO    arch/x86/vdso/vdso.so.dbg

gcc: error: elf_x86_64: No such file or directory

make[2]: *** [arch/x86/vdso/vdso.so.dbg] Error 1

make[1]: *** [arch/x86/vdso] Error 2

make: *** [arch/x86] Error 2

After spending a whole afternoon here are my finding so far

The magical kernel option that is needed to be turned on can be found here: https://bugs.gentoo.org/show_bug.cgi?id=405957#c12 but still no success 

kernel hacking -> Detect Hard Lookups (nested under Detect Hard and Soft Lookups)

According this thread: http://bugs.funtoo.org/browse/FL-379 older kernels are building with gcc-4.4.5. 

But current gentoo shiped with gcc 4.6.3 so unmask sys-kernel/openvz-sources-2.6.32.74.10 by adding it to package.keywords

After looking inside of ebuild file i see this: K_EXTRAEWARN="This kernel is stable only when built with gcc-4.4.x and is known

to oops in random places if built with newer compilers."

Trying to compile:

include/linux/percpu-rwsem.h: In function ‘percpu_free_rwsem’:

include/linux/percpu-rwsem.h:95:2: error: implicit declaration of function ‘free_percpu’ [-Werror=implicit-function-declaration]

In file included from include/linux/sched.h:77:0,

                 from include/linux/kmod.h:28,

                 from include/linux/module.h:13,

                 from include/linux/crypto.h:21,

                 from arch/x86/kernel/asm-offsets_64.c:8,

                 from arch/x86/kernel/asm-offsets.c:4:

include/linux/percpu.h: At top level:

include/linux/percpu.h:168:13: warning: conflicting types for ‘free_percpu’ [enabled by default]

include/linux/percpu-rwsem.h:95:2: note: previous implicit declaration of ‘free_percpu’ was here

cc1: some warnings being treated as errors

make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1

make: *** [prepare0] Error 2

----------

