|
From: | Bill Northcott |
Subject: | Re: [Swarm-Support] Re: Swarm 2.2 on Intel (and PPC) Mac OSX Tiger |
Date: | Mon, 24 Jul 2006 17:51:50 +1000 |
On 24/07/2006, at 2:26 AM, Scott Christley wrote:
GCC isn't deprecating nested functions as far as I know. Apple just disables their use within Xcode by passing a flag to the compiler, this started with Xcode 2.2. Supposedly you can re- enable support with an additional compiler flag; however they discourage it. They mention some security feature but don't say exactly what.
On Jul 23, 2006, at 12:15 AM, Marcus G. Daniels wrote:What compilers usually do to get an executable stack is to arrange to get it on a case by case basis using mprotect(2). E.g. see these messages:http://gcc.gnu.org/ml/gcc-help/2005-12/msg00174.html http://gcc.gnu.org/ml/gcc-help/2005-12/msg00177.htmlI was under the impression that this problem was just a regression in GCC. Is there a later archived discussion and/or Bugzilla documentation of this deprecation?
I had seen the messages Marcus mentioned and chased it around a bit more. As I understand it, this is a feature not a bug. As explained in the messages, the operation of nested functions requires execution of code from the stack. Allowing this is the sort of thing that hoary old mainframe types regard with horror as a nasty security vulnerability. I think the intention is that somewhere down the track, it will be disabled at a very low level, possibly in hardware.
Apple decided to take a hard line to help ensure that code did not break on future hardware, the FSF decided to remain more permissive for now and did not accept Apple's default. Having said this, it seems to me to be a good idea to eradicate them now from the Swarm code base rather than wait until something breaks.
Bill Northcott
[Prev in Thread] | Current Thread | [Next in Thread] |