<div dir="ltr">Hi everyone,<div><br></div><div>I was trying out the new <a href="https://reviews.llvm.org/D88631?id=295457">-mstack-protector-guard option</a> and I found when I tried to use it I would get the following error:</div><div><br></div><font face="monospace">/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/11.0.0/../../../../x86_64-linux-gnu/bin/ld: /tmp/example-370eec.o: in function `main':<br><br>/home/ce/<source>:1: undefined reference to `__stack_chk_guard'<br><br>/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/11.0.0/../../../../x86_64-linux-gnu/bin/ld: /home/ce/<source>:1: undefined reference to `__stack_chk_guard'</font><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">Here is a godbolt link to a small example which produces this error: <br></font><a href="https://godbolt.org/z/EYYfhM">https://godbolt.org/z/EYYfhM</a>.</div><div><br></div><div>I would appreciate any guidance on why I get this error on this small example. Where does the linker expect the symbol __stack_chk_guard to be defined? glibc? Another library? Is the flag -mstack-protector-guard supposed to work "out of the box" so to speak or are there accompanying upgrades to libraries or other things that I need or other flags I need to pass along with it? I checked the documentation here: <a href="https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mstack-protector-guard">https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mstack-protector-guard</a>, however I may be missing something obvious, so please feel free to give me any thoughts you may have.</div><div><br></div><div>Also thanks for working on the -mstack-protector-guard feature in the first place, Xiang!</div><div><br></div><div>Thank you!<br><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Zola Bridges</div></div></div></div></div></div>