third_party: Use PIC `Scrt1.o` When linking code using PIC, `Scrt1.o` is needed instead of `crt1.o`. This this change uses `Scrt1.o` for all linking. This appears to work for both PIC and non-PIC code. Verified by runing all of Pigweed upstream's Bazel tests.
diff --git a/third_party/debian_stretch_amd64_sysroot.BUILD b/third_party/debian_stretch_amd64_sysroot.BUILD index 3dd94fa..0f00dda 100644 --- a/third_party/debian_stretch_amd64_sysroot.BUILD +++ b/third_party/debian_stretch_amd64_sysroot.BUILD
@@ -19,9 +19,10 @@ ] CRT_OBJECTS = [ - "crt1", "crti", "crtn", + # Use PIC Scrt1.o instead of crt1.o to keep PIC code from segfaulting. + "Scrt1", ] [