Newer versions of gcc (such as shipped in Ubuntu 20.04) cannot build the ACRN PREEMPT-RT kernel following these instructions:
$ git checkout https://github.com/projectacrn/acrn-kernel
$ cd acrn-kernel
$ git checkout origin/4.19/preempt-rt
$ make mrproper
$ cp x86-64_defconfig .config
$ make olddefconfig
$ make targz-pkg
Error thrown (not the full log):
LD [M] arch/x86/crypto/morus1280-sse2.o
AS [M] arch/x86/crypto/cast5-avx-x86_64-asm_64.o
CC [M] arch/x86/crypto/cast5_avx_glue.o
LD [M] arch/x86/crypto/cast5-avx-x86_64.o
AS [M] arch/x86/crypto/cast6-avx-x86_64-asm_64.o
CC [M] arch/x86/crypto/cast6_avx_glue.o
LD [M] arch/x86/crypto/cast6-avx-x86_64.o
AS [M] arch/x86/crypto/morus1280-avx2-asm.o
CC [M] arch/x86/crypto/morus1280-avx2-glue.o
LD [M] arch/x86/crypto/morus1280-avx2.o
CC arch/x86/entry/vdso/vma.o
CC arch/x86/entry/vdso/vdso32-setup.o
LDS arch/x86/entry/vdso/vdso.lds
AS arch/x86/entry/vdso/vdso-note.o
CC arch/x86/entry/vdso/vclock_gettime.o
In file included from ./arch/x86/include/asm/vgtod.h:5,
from arch/x86/entry/vdso/vclock_gettime.c:15:
./include/linux/compiler.h: In function ‘__read_once_size’:
./include/linux/compiler.h:192:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
192 | {
| ^
./include/linux/compiler.h: In function ‘__read_once_size_nocheck’:
./include/linux/compiler.h:210:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
210 | {
| ^
./include/linux/compiler.h: In function ‘__write_once_size’:
./include/linux/compiler.h:215:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
215 | {
| ^
In file included from ./include/linux/compiler.h:250,
from ./arch/x86/include/asm/vgtod.h:5,
from arch/x86/entry/vdso/vclock_gettime.c:15:
./arch/x86/include/asm/barrier.h: In function ‘array_index_mask_nospec’:
./arch/x86/include/asm/barrier.h:38:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
38 | {
| ^
In file included from ./include/linux/compiler.h:251,
from ./arch/x86/include/asm/vgtod.h:5,
from arch/x86/entry/vdso/vclock_gettime.c:15:
./include/linux/kasan-checks.h: In function ‘kasan_check_read’:
./include/linux/kasan-checks.h:10:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
10 | { }
| ^
./include/linux/kasan-checks.h: In function ‘kasan_check_write’:
./include/linux/kasan-checks.h:12:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
12 | { }
| ^
In file included from ./arch/x86/include/asm/vgtod.h:5,
from arch/x86/entry/vdso/vclock_gettime.c:15:
./include/linux/compiler.h: In function ‘read_word_at_a_time’:
./include/linux/compiler.h:273:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
273 | {
| ^
./include/linux/compiler.h: In function ‘offset_to_ptr’:
./include/linux/compiler.h:303:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible
303 | {
| ^
Newer versions of
gcc
(such as shipped in Ubuntu 20.04) cannot build the ACRNPREEMPT-RT
kernel following these instructions:Error thrown (not the full log):