<div dir="ltr"><div>When -fstack-protector is turned on, linker fails to find the symbol "<span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">__stack_chk_guard" because at least for powerpc64le, glibc doesn't provide this symbol. Instead, they put the stack guard into TCB.</span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">x86 fixed this issue by injecting a special address space (which is later translated to TCB register access) and hard code the offset of stack_guard, but I don't see a easy way to handle address spaces in ppc.</span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">A cleaner solution could be adding an IR intrinsic llvm.get_tcb_address() and hard code the offset of stack_guard member, since they aren't supposed to change.</span></div><div><br></div>Details are in the bug: <a href="https://llvm.org/bugs/show_bug.cgi?id=26226">https://llvm.org/bugs/show_bug.cgi?id=26226</a><br><div><br></div><div>Any ideas?</div><div><br></div><div>Thanks!</div></div>