Summary: | [8 Regression] -fstack-protector generates invalid read to %fs:0x0 on mac | ||
---|---|---|---|
Product: | gcc | Reporter: | URABE, Shyouhei <shyouhei> |
Component: | target | Assignee: | Jakub Jelinek <jakub> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mark.hsj |
Priority: | P3 | Keywords: | wrong-code |
Version: | 9.0 | ||
Target Milestone: | 8.3 | ||
Host: | Target: | x86_64-darwin | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2018-08-13 00:00:00 | |
Bug Depends on: | |||
Bug Blocks: | 86832 | ||
Attachments: | gcc9-pr85644.patch |
Description
URABE, Shyouhei
2018-05-04 00:57:11 UTC
*** Bug 86762 has been marked as a duplicate of this bug. *** . Some of the dups of this mentioned thread-local storage (TLS), in which case bug 29838 and bug 52268 might be related Created attachment 45060 [details] gcc9-pr85644.patch Untested fix. I have no access to Darwin though. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86832#c7 for more details. Author: jakub Date: Thu Nov 22 09:48:43 2018 New Revision: 266370 URL: https://gcc.gnu.org/viewcvs?rev=266370&root=gcc&view=rev Log: PR target/85644 PR target/86832 * config/i386/i386.c (ix86_option_override_internal): Default ix86_stack_protector_guard to SSP_TLS only if TARGET_THREAD_SSP_OFFSET is defined. * config/i386/i386.md (stack_protect_set, stack_protect_set_<mode>, stack_protect_test, stack_protect_test_<mode>): Use empty condition instead of TARGET_SSP_TLS_GUARD. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/config/i386/i386.md Can somebody please test this on darwin (on the trunk)? Thanks. Thanks for fixing this. I can confirm that with gcc trunk, -fstack-protector, -fstack-protector-all, and -fstack-protector-strong are now working for me on macOS 10.12.6, for both -m64 and -m32. Author: jakub Date: Tue Jan 8 09:56:36 2019 New Revision: 267686 URL: https://gcc.gnu.org/viewcvs?rev=267686&root=gcc&view=rev Log: Backported from mainline 2018-11-22 Jakub Jelinek <jakub@redhat.com> PR target/85644 PR target/86832 * config/i386/i386.c (ix86_option_override_internal): Default ix86_stack_protector_guard to SSP_TLS only if TARGET_THREAD_SSP_OFFSET is defined. * config/i386/i386.md (stack_protect_set, stack_protect_set_<mode>, stack_protect_test, stack_protect_test_<mode>): Use empty condition instead of TARGET_SSP_TLS_GUARD. Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/config/i386/i386.c branches/gcc-8-branch/gcc/config/i386/i386.md Fixed for 8.3+ too. |