<< How to make gcc-pg2 >> If you have any trouble with Build.sh, please read the following. The source codes of gcc-pg2 are in a directory, gcc-pg2/gcc-2.95.2. When you use it on other platforms, move all files under the directory to your platform. To separate *.o files from source files, make new directory and do "configure; make; make install" there. In the following, OBJ is the directory for *.o files, SRC is the directory containing source files, and INST is the directory that gcc-pg2 will be installed. ( Many options of "make" in step 4 of the following sequence may not be necessary, because these options are for tracing gcc with gdb. But we don't yet make sure of it. ) 1. mkdir OBJ 2. cd OBJ 3. SRC/configure --prefix=INST --enable-languages= 4. make CFLAGS='-g' LIBCFLAGS='-g' LIBCXXFLAGS='-g' CXXFLAGS='-g' BOOT_CFLAGS='-g' MYCFLAGS='-g -Wpointer-arith -Wnested-externs' MYCXXFLAGS='-g -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long' OPTIMIZE='-O0' bootstrap 5. make install 6. cd SRC 7. INST/bin/gcc -g -c timestamp.c 8. cd INST/lib/gcc-lib//2.95.2 9. ln -s SRC/timestamp.o libpg2.a Now, you can the following instruction to get a.out with timestamp system: INST/bin/gcc -g -pg2 foobar.c In this version, a variable of timestamp is declared as "unsigned long long int". << How to work on unsupported platforms >> In SRC/gcc/config directory, there are header files for each platform. Add "%{pg2:-lpg2 -L.}" to a macro, LIB_SPEC in an associated header file. Infer the file name from a name of the platform. If you find more than one, you have to try them one by one (Jesus...). Note that the macro is in "ifdef" switches correspondent with LIBC version. I edited the following header files: i386-linux: linux.h sparc-sunos4: sparc/sparc.h sparc-sol2: sparc/sol2.h alpha-linux: alpha/linux-elf.h A syntax of the macro is explained in comments beginning at around line 233 of SRC/gcc/gcc.c. It seems difficult, but, since we only want to make a little change, all we have to know is the following syntax: %{pg2:-lpg2 -L.} If an option -pg2 is specified, "-lpg2 -L." should be added automatically in the linkage stage. %{!shared:...} If an option -shared is not specified, do as ....