Bug#592009: clang -fstack-protector fails to link (undefined reference to `__stack_chk_guard')
Anders Kaseorg
andersk at MIT.EDU
Fri Aug 6 21:20:02 UTC 2010
Package: llvm-2.7
Version: 2.7-4
Tags: fixed-upstream patch
$ echo 'int main(){char s[80];}' > test.c
$ gcc -fstack-protector test.c -o test
$ ./test
$ clang -fstack-protector test.c -o test
/usr/bin/ld: /tmp/cc-0Rbhby.o: in function main:test.c(.text+0xc): error:
undefined reference to '__stack_chk_guard'
/usr/bin/ld: /tmp/cc-0Rbhby.o: in function main:test.c(.text+0x22): error:
undefined reference to '__stack_chk_guard'
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
This was fixed in LLVM r106031 and r107640. A debdiff for llvm-2.7 with
these patches is available at
https://bugs.launchpad.net/ubuntu/+source/llvm-2.7/+bug/610992 .
Anders
More information about the Pkg-llvm-team
mailing list