This is the mail archive of the
cygwin
mailing list for the Cygwin project.
-fstack-protector and -fstack-protector-all broken after updating to gcc-core-6.4.0-5
- From: DDoSolitary <ddosolitary at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 21 Jan 2018 16:30:07 +0800
- Subject: -fstack-protector and -fstack-protector-all broken after updating to gcc-core-6.4.0-5
- Authentication-results: sourceware.org; auth=none
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
The stack protector options are broken after updating gcc-core to 6.4.0-
5.
For example compiling the following C code with "gcc foo.cpp
- -fstack-protector-all" results in errors.
int main() {
return 0;
}
/tmp/ccrXUPvn.o:foo.c:(.text+0x33): undefined reference to
`__stack_chk_fail'
/tmp/ccrXUPvn.o:foo.c:(.text+0x33): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `__stack_chk_fail'
/tmp/ccrXUPvn.o:foo.c:(.rdata$.refptr.__stack_chk_guard[.refptr.__stack_
chk_guard]+0x0):
undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
Downgrading gcc-core to 6.4.0-4 fixes the problem.
After checking the content of the package, I found out that
libssp-related files (libssp.a, libssp.h, etc) are missing. So I
copied libssp.a from the 6.4.0-4 package to
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0 and tried to re-compile the code
above with "gcc foo.cpp -fstack-protector-all -lssp" and it worked well.
-----BEGIN PGP SIGNATURE-----
iIwEARYIADQWIQRojh0JPDY49YiJDURQJoMRx60/YgUCWmRPfRYcZGRvc29saXRh
cnlAZ21haWwuY29tAAoJEFAmgxHHrT9iSZMBAPQrHGnkmfBMMtxYq+FCeRZFmCB+
gRgtPp6g/V8TJ69fAP9gdARFxjaTb5j5qFN3LBHbjsNa2APSaqswwEpwFO07CQ==
=U2fd
-----END PGP SIGNATURE-----
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple