On 06/06/2011 11:17 AM, Rainer Orth wrote:
* Instead of __FreeBSD__, one could use HAVE_SYSCTLBYNAME instead, but
that would need a new libgcc config.h header. In addition, we might
have to check for kern.stackprot to make sure the code really works.
* Similarly, instead of testing __sun__&& __svr4__, one could check
_SC_STACK_PROT.
* Last, rather than checking __NetBSD__, one could go for HAVE___SYSCTL.
* __sysctl is currently declared manully. AFAICS there's no header for
that. At least the FreeBSD libc declares it itself in two places:
lib/libc/sys/stack_protector.c and lib/libc/gen/sysctl.c.
Given that this is closely tied to the various platforms, it seems
appropriate to continue to use the OS defines.
Agreed, it would be a worse can of worms when bootstrapping a target
(i.e. no target headers are available).
Parts I can approve are good. Thanks!
Paolo