Amends 1cb9f37a17ab restricting the logic to PPC64 as it introduces regression of FreeBSD/amd64 binaries compiled in freestanding mode (as kernel and modules) as discussed in https://reviews.llvm.org/D109090.
Bug report https://bugs.llvm.org/show_bug.cgi?id=51590
Whether it's in libc.so or not should not matter, if TM.getRelocationModel() == Reloc::Static you are linking libc.a which means __stack_chk_guard is indeed dso_local. The ideal solution IMO would be to remove the FreeBSD special case completelty.
That said, I'm fine with having a ppc64 workaround here seeing as it is needed to use LLVM for PPC64 FreeBSD. However, the comment should be updated to say this is a workaround for PPC64 stack protector codegen not being correct rather than mentioning libc.so which is not relevant.