[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MacOS X Intel nested functions

From: Bill Northcott
Subject: MacOS X Intel nested functions
Date: Tue, 29 May 2007 23:44:17 +1000

I think I have reached a dead end on this.  See below:

void bar () {

int main(int argc, void * argv) {
return 0;

[MBP-OGN:Public/Swarm/libtest] billn% gcc -c -fnested-functions -o bar.o bar.c [MBP-OGN:Public/Swarm/libtest] billn% gcc -dynamiclib -fnested- functions -o libbar.dylib bar.o
/usr/bin/libtool: unknown option character `l' in: -allow_stack_execute
Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile [,dirname]] [-arch_only arch] [-sacLT] Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile [,dirname]] [-arch_only arch] [-o output] [-install_name name] [- compatibility_version #] [-current_version #] [-seg1addr 0x#] [- segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load] [MBP-OGN:Public/Swarm/libtest] billn% gcc -dynamiclib -o libbar.dylib bar.o [MBP-OGN:Public/Swarm/libtest] billn% gcc -fnested-functions -o foo - L./ -lbar foo.c
[MBP-OGN:Public/Swarm/libtest] billn%

-fnested-functions (-allow_stack_execute) only works as an option when linking an executable. It then means all code in that process can execute functions off the stack.

It is not acceptable as an option linking a dynamic library, because that uses Apple's libtool, which spits the dummy. Even if libtool did not barf, the option is meaningless in a library. The allow_stack_execute can only be set by the
OS as part of launching a new process.

This is not an issue for producing Objective-C Swarm programs. The - fnested-functions option when doing the final link will ensure that the program can run the nested functions.

However, I can see no way to get this to work for java, where the main executable is java which has not been linked with the -fnested- functions flag.

a.  I have this wrong
b. The only way to get JavaSwarm to run on MacOS X Intel is to get rid of the nested functions. :-((


reply via email to

[Prev in Thread] Current Thread [Next in Thread]