What is the use of -fno-stack-protector?

前端 未结 5 1678
[愿得一人]
[愿得一人] 2020-12-29 04:08

I have written an application in C, and I\'m trying to understand what is the purpose of the -fno-stack-protector command when compiling. For my specific applic

5条回答
  •  醉话见心
    2020-12-29 04:28

    In the standard/stock GCC, stack protector is off by default. However, some Linux distributions have patched GCC to turn it on by default. In my opinion, this is rather harmful, as it breaks the ability to compile anything that's not linked against the standard userspace libraries unless the Makefile specifically disables stack protector. It would even break the Linux kernel build except that the distributions with this hack added additional hacks to GCC to detect that the kernel is being built and disable it.

提交回复
热议问题