This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/65953] New: [5/6 Regression] undefined reference to static __thread variable
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Apr 2015 17:46:53 +0000
- Subject: [Bug tree-optimization/65953] New: [5/6 Regression] undefined reference to static __thread variable
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65953
Bug ID: 65953
Summary: [5/6 Regression] undefined reference to static
__thread variable
Product: gcc
Version: 5.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
A Gentoo user pointed me to a Mono build failure with gcc-5:
markus@x4 /tmp % cat mini.i
static __thread int *mono_jit_tls;
long mono_get_jit_tls_offset_foo;
int* mono_set_jit_tls_jit_tls;
void
fn1 ()
{
__asm("movq $mono_jit_tls@TPOFF, %0" : "=r"(mono_get_jit_tls_offset_foo));
}
void
fn2 () { mono_jit_tls = mono_set_jit_tls_jit_tls; }
markus@x4 /tmp % gcc -nostdlib -O2 mini.i
/tmp/ccuc43K9.o:mini.i:function fn1: error: undefined reference to
'mono_jit_tls'
collect2: error: ld returned 1 exit status
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4/gcc -nostdlib -O2
mini.i
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2/gcc -nostdlib -O2
mini.i
markus@x4 /tmp % clang -nostdlib -O2 mini.i
markus@x4 /tmp % icc -nostdlib -O2 mini.i
markus@x4 /tmp %