[Bug 233707] www/firefox: fails to build with -fstack-protector-{strong,all} + -Wl,-z,nocopyreloc

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Dec 30 15:04:28 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233707

--- Comment #8 from Tijl Coosemans <tijl at FreeBSD.org> ---
(In reply to Shawn Webb from comment #7)
Firefox is already compiled with -fPIE on FreeBSD and this works fine even with
-Wl,-z,nocopyreloc and -fstack-protector-strong.  The problem is only in the
configure test for clock_gettime which is *not* compiled with -fPIE but *is*
compiled with -Wl,-z,nocopyreloc and -fstack-protector-strong which enables
stack protection in this test program while -fstack-protector is a no-op. 
Stack protection uses a variable named __stack_chk_guard which is defined in
libc on FreeBSD.  When compiled without -fPIE, variables in dynamic libraries
accessed by the executable are copied to the executable's data segment so it
can be accessed directly (without GOT lookup).  This is called a
copy-relocation, which is why compiling with -Wl,-z,nocopyreloc gives an error.
 So either Firefox should compile configure tests with -fPIE or FreeBSD should
do what Linux does and make __stack_chk_guard a thread local variable (or
both).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-toolchain mailing list