StackThreads/MP: version 0.77 User's Guide
Once you successfully patch gcc sources and rebuild gcc, you setup
things so that stgcc
exploits it.
ST_GCC_IS_PATCHED
. The value does
not matter. When stgcc
finds that this variable is defined, it
gives necessary options when it calls gcc
and g++
(we
hereafter only mention gcc, but the following statements also apply to
g++).
path
variable so that you run the patched gcc by just
typing gcc
(g++
), you are done.
Recall that the patched gcc produces the exactly same output as the
original does, unless explicit options are given, so replacing the
original gcc is almost always practical. You may still want to call
patched gcc
only from stgcc
and use the original gcc
for other cases. If you are such a skeptical person, put the patched
gcc to anywhere and tell stgcc
the location of them by setting
environment variable ST_COMPILER_PATH
. For example, you may write
the following line in your .cshrc
.
setenv ST_COMPILER_PATH /home/nomo/my_gcc/bin
Then, stgcc
calls /home/nomo/my_gcc/bin/gcc
and
/home/nomo/my_gcc/bin/g++
instead of gcc
and g++
.
ex/nestcall
. On SPARC, compile and run
ex/strpass
. Supply -O4
option to enable optimization. When
you run it with no arguments, if it says OK
, the patched gcc is
working. Before gcc is not patched, these programs do not say OK
and will produce the following outputs:
strpass
on SPARC:
@ harp:1014% ./strpass @ 1 : st_main forks foo @ 2 : foo blocks @ 3 : foo blocked, restart foo @ 4 : foo restarted and finishes @ ************************************************************* @ Structure argument to ST_THREAD_CREATE(foo(p)) is corrupted. @ This is a known problem on SPARC. @ You may either patch gcc to fix this problem (see manual), @ or just avoid passing struct args to procedure calls with @ ST_THREAD_CRREATE @ *************************************************************
nestcall
on i386: