Hello, Does the -fstack-protector option work on CLANG 3.1 and 3.2? There is thread on FreeBSD forums about the stack protector and ports and I'm wondering if it's possible to use the -fstack-protector option with CLANG. http://forums.freebsd.org/showthread.php?t=36927 -Kimmo
On 2013-02-07 20:42, Kimmo Paasiala wrote:> Does the -fstack-protector option work on CLANG 3.1 and 3.2?Yes, it works with both clang and gcc.> There is thread on FreeBSD forums about the stack protector and ports > and I'm wondering if it's possible to use the -fstack-protector option > with CLANG. > > http://forums.freebsd.org/showthread.php?t=36927That thread seems to be full of confusion. :-) The base system is mostly built with -fstack-protector, except for the ia64, arm and mips arches, and for some specific cases where it is not necessary, or unwanted. Ports are largely independent of the base system, and their compilation flags are different from port to port. You could set -fstack-protector for your ports in either make.conf or ports.conf, if you wanted.
* Kimmo Paasiala (kpaasial at gmail.com) wrote:> Does the -fstack-protector option work on CLANG 3.1 and 3.2? > > There is thread on FreeBSD forums about the stack protector and ports > and I'm wondering if it's possible to use the -fstack-protector option > with CLANG. > > http://forums.freebsd.org/showthread.php?t=36927You might be interested in this patch: https://github.com/AMDmi3/freebsd-ports-mk/compare/master...stack-protector afaik, in prior discussion some years ago an issue was mentioned that some ports don't build with stack-protector, so I suggested to introduce STACK_PROTECTOR_SAFE/_UNSAFE knobs similar to what we have for MAKE_JOBS_SAFE_/_UNSAFE (we might actually only need STACK_PROTECTOR_UNSAFE, as unlike MAKE_JOBS, build errors caused by enabling stack protector are not transient, so we can have an exp-run to just mark all uncompatible ports and consider all others compatible). If there's interest in this, I can refresh the patch and submit it. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3 at amdmi3.ru ..: jabber: amdmi3 at jabber.ru http://www.amdmi3.ru