Compiler flag -fcf-protection sets control-flow integrity measures
that improve security, and sometimes defaults to enabled on distro
compilers. Some aspects of this feature are implemented in the compiler
header <cet.h> for e.g., stack unwinders. If this header is missing some
programs fail to compile.
Since we don't (yet) support pulling compiler headers into unikraft
build, this change disables cf-protection globally.
Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #881
ifneq ($(HAVE_STACKPROTECTOR),y)
COMPFLAGS += -fno-stack-protector
endif
+COMPFLAGS += -fcf-protection=none
+
COMPFLAGS += -Wall -Wextra
COMPFLAGS-$(call have_clang) += -Wdocumentation -Wdocumentation-pedantic