[Bug build/19816] New: [PATCH] Fix stack protector detection.
woutershep at gmail dot com
sourceware-bugzilla@sourceware.org
Sat Mar 12 22:10:00 GMT 2016
https://sourceware.org/bugzilla/show_bug.cgi?id=19816
Bug ID: 19816
Summary: [PATCH] Fix stack protector detection.
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: woutershep at gmail dot com
CC: carlos at redhat dot com
Target Milestone: ---
Created attachment 9092
--> https://sourceware.org/bugzilla/attachment.cgi?id=9092&action=edit
0001-Fix-stack-protector-detection.patch
I use a cross compiling gcc 6 (host amd64 -> target i686) that defaults
to -fstack-protector-strong and it is failing the configure check:
checking whether i686-pc-linux-gnu-gcc implicitly enables -fstack-protector...
no
The native version does it correctly:
checking whether x86_64-pc-linux-gnu-gcc implicitly enables
-fstack-protector... yes
So i looked into it and i found the following chunk in gcc
(gcc/config/i386/i386.c):
/* For 32-bit code we can save PIC register setup by using
__stack_chk_fail_local hidden function instead of calling
__stack_chk_fail directly. 64-bit code doesn't need to setup any PIC
register, so it is better to call __stack_chk_fail directly. */
So we need to check for __stack_chk_fail_local too, otherwise it causes
errors during the building of glibc like:
elf/librtld.os: In function `lookup_doit':
elf/rtld.c:509: undefined reference to `__stack_chk_fail_local'
(Attached is a patch to fix it with the same info in it)
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list