https://llvm.org/bugs/show_bug.cgi?id=26226

            Bug ID: 26226
           Summary: -fstack-protector fails to link on powerpc64le linux
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedb...@nondot.org
          Reporter: timshe...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Example:
  // clang++ -target powerpc64le-unknown-linux-gnu -fstack-protector a.cc
  int main() {
    char arr[2048];
    arr[2048+15] = 0;

    return 0;
  }

Linker complains undefined reference to `__stack_chk_guard'.

In fact, glibc stores stack_guard not as a global/TLS variable, but a data
member in TCB:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/nptl/tls.h;h=0e889bc122c9bf91bae1adf43977e9e04c1e5595;hb=HEAD#l99

x86 suffered from the same issue, and then was fixed by:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20100705/103635.html

The fix specifies an address space (which finally turns into fs/gs access) and
hard code the offset to indicate the location of the stack guard.

How do we fix this? Do we use the same address space trick?

Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to