From 5dfd199a1d3eadeaf069790b94d2830e2465d909 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Sat, 7 Jan 2017 14:05:15 +0000 Subject: [PATCH] Add -fno-stack-protector to CFLAGS When compiling ebpf programs on Alpine Linux the compiler throws the following error: LLVM ERROR: Cannot select: 0x56049b79dcb0: ch,glue = BPFISD::CALL 0x56049a93ad60, TargetExternalSymbol:i64'__stack_chk_fail' 0x56049b391500: i64 = TargetExternalSymbol'__stack_chk_fail' In function: waker Disabling the stack protector explicitly with '-fno-stack-protector' fixes this error. clang version 3.8.1 (tags/RELEASE_381/final) Target: x86_64-alpine-linux-musl Thread model: posix InstalledDir: /usr/bin Signed-off-by: Rolf Neugebauer --- src/cc/frontends/clang/kbuild_helper.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cc/frontends/clang/kbuild_helper.cc b/src/cc/frontends/clang/kbuild_helper.cc index 8fbefd22beac..0c0f58d7ca7e 100644 --- a/src/cc/frontends/clang/kbuild_helper.cc +++ b/src/cc/frontends/clang/kbuild_helper.cc @@ -89,6 +89,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector *cflags) { cflags->push_back("-D__HAVE_BUILTIN_BSWAP64__"); cflags->push_back("-Wno-unused-value"); cflags->push_back("-Wno-pointer-sign"); + cflags->push_back("-fno-stack-protector"); return 0; }