I tried building Ada from a bootstrap binary found on the net. HP-UX 11.23 unlike 11.00 and 11i, doesn't allow executing code on the stack by default. To enable this for individual binaries: $ chatr +es enable [binary] To enable execution of code on the stack system-wide, the executable_stack kernel tunable needs to be 1 or 2. The default is 0 (disallow execution). While building 4.0.2, I encountered the following: ... stage1/xgcc -Bstage1/ -B/opt/TWWfsw/gcc402/hppa2.0-hp-hpux11.23/bin/ -c -g -O2 -mdisable-indexing -gnatpg -gnata -I- -I. -Iada -I/opt/build/gcc-4.0.2/gcc/ada /opt/build/gcc-4.0.2/gcc/ada/ada.ads -o ada/ada.o Execution of code located on a program's stack is not permitted. cmd: stage1/gnat1 -I- -I. -Iada -I/opt/build/gcc-4.0.2/gcc/ada -quiet -dumpbase ada.ads -O2 -g -mdisable-indexing -gnatpg -gnata -gn PID 24258 has been terminated. See the '+es enable' option of chatr(1). xgcc: Internal error: Killed (program gnat1) Please submit a full bug report. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
This also effects some C code too like: int f(int (*fptr)(void)) { return fptr(); } int main(void) { int t; int g(void){ return t; } t = 2; f(&g); } Compile at -O0 and you will see that it fails too.
There is no bug here, you found the solution which is to modify the settings of your OS. Arno