Skip to content

Commit

Permalink
Add -fno-stack-protector to CFLAGS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rn committed Jan 7, 2017
1 parent 9a174ab commit 5dfd199
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cc/frontends/clang/kbuild_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector<string> *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;
}
Expand Down

0 comments on commit 5dfd199

Please sign in to comment.