TN2161 says that -fnested-functions can be passed to the compiler driver in a link command to send the "-allow_stack_execute" flag to the linker.
However, libtool seems to choke on it thus:
gcc -B ../../tools -dynamiclib -fnested-functions -o .libs/libswarm.0.0.0.dylib .libs/SwarmEnvironment.o .libs/classList.o .libs/libswarm.lax/libspace.a/Ca2d.o
*** lots of objects removed ****
.libs/libswarm.lax/libswarmobjc.a/thr.o -L/Library/Frameworks/Swarm.framework/Versions/Current/Resources/lib -L/Library/Frameworks/Tk.framework/Versions/8.4-X11/lib -L/usr/X11R6/lib -lpthread /Library/Frameworks/Swarm.framework/Versions/Current/Resources/lib/libffi.dylib -lBLT24 -lXpm /Library/Frameworks/Swarm.framework/Versions/Current/Resources/lib/libpng12.dylib /Library/Frameworks/Swarm.framework/Versions/Current/Resources/lib/libhdf5.dylib -lz -lX11 -lm -ldl -Wl,-search_paths_first -framework CoreFoundation -framework CoreFoundation -framework Tk -framework Tcl -install_name /Library/Frameworks/Swarm.framework/Versions/2.2/lib/libswarm.0.dylib -Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
/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]
make[4]: *** [libswarm.la] Error 1
Ho hum