# Hardened kernel compilation fails on parse_vdso

## RickDeckard

Hi,

I'm using 3.17.7-hardened-r1 with the default hardened gcc-config, and trying to compile a new kernel (I've tried 3.18.9-hardened and 4.0.1-hardened) but the compilation throws a bunch of vDSO errors my way related to the __stack_chk_fail function in parse_vdso.c and vdso_standalone_test_x86.c.  It's telling me that it can't find any references, and I've practically been beating my head against a brick wall on this.  Disabling the stack protector doesn't help, nor do other answers to this kind of problem that suggest manually changing the makefile.  This is what I'm dealing with:

Sorry for the Japanese, I'll provide a reasonable translation in brackets.

```

HOSTCC  Documentation/ptp/testptp

HOSTCC  Documentation/vDSO/parse_vdso.o

HOSTLD  Documentation/vDSO/vdso_standalone_test_x86

HOSTCC  Documentation/spi/spidev_fdx

Documentation/vDSO/parse_vdso.o: 関数 `elf_hash' 内: (In function) 

parse_vdso.c:(.text+0xa4): `__stack_chk_fail' に対する定義されていない参照です (Undefined reference to '__stack_chk_fail')

Documentation/vDSO/parse_vdso.o: 関数 `vdso_init_from_sysinfo_ehdr' 内:

parse_vdso.c:(.text+0x445): `__stack_chk_fail' に対する定義されていない参照です

Documentation/vDSO/parse_vdso.o: 関数 `vdso_match_version' 内:

parse_vdso.c:(.text+0x545): `__stack_chk_fail' に対する定義されていない参照です

Documentation/vDSO/parse_vdso.o: 関数 `vdso_sym' 内:

parse_vdso.c:(.text+0x6f2): `__stack_chk_fail' に対する定義されていない参照です

Documentation/vDSO/parse_vdso.o: 関数 `vdso_init_from_auxv' 内:

parse_vdso.c:(.text+0x7ad): `__stack_chk_fail' に対する定義されていない参照です

collect2: エラー: ld はステータス 1 で終了しました (Error: ld completed with status 1)

scripts/Makefile.host:129: ターゲット 'Documentation/vDSO/vdso_standalone_test_x86' のレシピで失敗しました (compilation failed)

make[2]: *** [Documentation/vDSO/vdso_standalone_test_x86] エラー 1 

scripts/Makefile.build:403: ターゲット 'Documentation/vDSO' のレシピで失敗しました (Target compilation failed)

make[1]: *** [Documentation/vDSO] エラー 2

make[1]: *** 未完了のジョブを待っています.... (Waiting for incomplete jobs)

Makefile:990: ターゲット 'vmlinux' のレシピで失敗しました

make: *** [vmlinux] エラー 2

acidstar linux-4.0.1-hardened # 

```

I'd appreciate any help I can get because this is driving me nuts.  I've even tried defining __stack_chk_fail in the .c files themselves, and it still won't compile.  This has been my fourth failed attempt.

----------

## RickDeckard

Well, hell, I might have solved this just by taking CONFIG_BUILD_DOCSRC under "Kernel Hacking" and unchecking it.  Can't believe I missed that.

----------

## pepoluan

Hey, thanks for sharing that CONFIG!

I ran into the same trouble, searched a lot... and only your solution works.

It's amazing how much grief that one line can cause...   :Rolling Eyes: 

----------

## kakarot

I would like to thank you, too.

Now I run a hardened kernel...

Thanks.

----------

