On 6 Dec 2005, at 02:59, Adriaan van Os wrote:
Waldek Hebisch wrote:
Adriaan van Os wrote:
It crashes with a bus error KERN_PROTECTION FAILURE (0x0002) at call *%eax. The eax register points to the stack, so I fear the stack is marked non-executable. Whether this is a problem in the kernel, gcc or the linker, I have to find out. There is a Darwin linker option -allow_stack_execute, but it causes a linker error (undefined symbols: _main), which is another thing to find out why ...
Wow, I think we have a workaround !
[Darwin:~/gpc/testgpc/tramp] adriaan% gp tramp.pas --no-pic -Wl,-stack_addr,c0000000 -Wl,-stack_size,4000000
This instructs the Darwin linker to create a segment __UNIXSTACK and apparently the stack segment has the correct priviliges set, because "tramp" no longer crashes !
Correct way is to define ENABLE_EXECUTE_STACK in gcc-3.4.x/gcc/config/i386/darwin.h. The definition should be similar to definitions in gcc-3.4.x/gcc/config/sol2.h and gcc-3.4.x/gcc/ config/netbsd.h
I now read that Apple has gone completely mad <http:// lists.apple.com/archives/Xcode-users/2005/Nov/msg00402.html>. Bad news.
Adriaan van Os
Very, very silly to disable all Pascal and Ada programs! I suggest we all file bug reports. I don't think this is Apple going mad, I think it's a low level decision by someone who doesn't know what nested routines are about).