SGI: Development

Pascal - Page 2

Trekiej wrote: I am interested in Pascal for programming, but I do not know why. :)
What can I do with it on a SGI machine?

about the same as with fortran which is the basics plus gl. you also might need an older system because the pascal compiler didn't make it to 7.3. for freeware alternatives you might wanna check the other threads that just came up regarding pascal
r-a-c.de
Thanks.
ivelegacy wrote: The C source is in`rts/rts-write.c'. I can't se the RTS library in the IRIX dev CDs

and you never will :P
that's one of the source files of your compiler, not irix.

as for the missing symbols, i don't know what came with your compiler but in case there were some libs just make sure to link them
r-a-c.de
foetz wrote: that's one of the source files of your compiler, not irix.


i know the difference between a source and a binary, i want to know where is the RTS support which should be included into a library as the gpc compiler's objects are calling it. See the symbols list i have posted.

foetz wrote: as for the missing symbols, i don't know what came with your compiler but in case there were some libs just make sure to link them


everything comes from here , in the theory the gpc compiler should take things (e.g. the RTS) from /usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/, but it is not. Probably broken or missing parts.

edit:
In the theory

Code: Select all

/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2% nm libgpc.a | grep -w _p_write
000009a8 T _p_write
U _p_write
U _p_write
U _p_write


libgpc.a (which is an archive of objects) has the RTS, but nor it is damaged nor bad things happen

btw, in gpc-2.1 (which the IRIX binary is), the source is in rts-va.c, though it's a varargs C function, while in newer GPC versions _p_write doesn't exist anymore, as far as i have understood, It has been replaced with various other functions corresponding to the different types.

That's good, but that's also the reason why we can't mix versions, so if we want to compile only the RTS then we need the 2.1 version. If we build the whole GPC, you can use a newer version.

my conclusion is: as the fact i can't find the RTS nor in the binary repository nor the Irix dev-CDs, then i'd better
- try to recompile just the RTS v2.1 (which consists of C and pascal sources, the final result is a library)
- if that fail, try to recompile the whole GPC using a new version (which already includes such a library in its built up)
ivelegacy wrote: i know the difference between a source and a binary, i want to know where is the RTS support which should be included into a library as the gpc compiler's objects are calling it.

not the point. let's try a different approach:
the source file where your missing symbol is in is part of the compiler so looking for libs that have the missing symbols on irix cds might not be very successful

Code: Select all

/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2% nm libgpc.a | grep -w _p_write
000009a8 T _p_write
U _p_write
U _p_write
U _p_write

and there are your missing symbols. all good then :-)
r-a-c.de
ivelegacy wrote: how to make it to work under Irix ?
i got a lot of errors because crt1, crtbegin, etc are missing

(edit:
and things put into the wrong place)


OK, I had a look. Haven't looked at Pascal in 15 years or so, but hey ...

GNU Pascal, like Fortran, Ada and a couple of other languages is (was?) an add-on to GCC. you need(ed) the matching, and patched, GCC compiler version to build it, and to run it.

That's why there are two versions on the download page: one with the GCC version included, and one without. That's also where they screwed up . Neither of these two packages includes the CRT files you mention, crtbegin.o and crtend.o. GCC (and GPC) will not work without.

I copied them from a GCC 3.4.6 into the correct directory for GPC (where libcgcc.a is) and then it works. At least, it works enough to compile a working hello world program.

Now, normally copying binary code around between different compiler versions is considered evil. YMMV. You may also wonder how much of your time you want to invest in a compiler where the last version is based on GCC 2.something, incomplete and nobody bothered to fix that in 13 years.
Now this is a deep dark secret, so everybody keep it quiet :)
It turns out that when reset, the WD33C93 defaults to a SCSI ID of 0, and it was simpler to leave it that way... -- Dave Olson, in comp.sys.sgi

Currently in commercial service: Image :Onyx2: (2x) :O3x02L:
In the museum : almost every MIPS/IRIX system.
Wanted : GM1 board for Professional Series GT graphics (030-0076-003, 030-0076-004)
jan-jaap wrote: GNU Pascal, like Fortran, Ada and a couple of other languages is (was?) an add-on to GCC


well, yeah, they are front-ends and there are several more front ends for different languages that have been written for GCC but not yet integrated into the main distribution of the GNU Compiler Collection. Some of these may be integrated in future, others may not, for various reasons. Pascal seems to have an independent team which … seems not interested about integrating the language into updated version of Gcc, more specifically it seems related to v3.3, referring it as "alpha", which means "unstable".

jan-jaap wrote: Now, normally copying binary code around between different compiler versions is considered evil. YMMV. You may also wonder how much of your time you want to invest in a compiler where the last version is based on GCC 2.something, incomplete and nobody bothered to fix that in 13 years


Looking at Pascal in the gentoo portage every ebuilds are marked as "unsupported"

dev-lang/gpc/
gpc-20051104.ebuild
gpc-20070904.ebuild

the frontend uses gcc-core, gcc gnu org pub gcc releases gcc-${GCCVER} gcc-core-${GCCVER}
but, with GCCVER=">3.4.5" constraint, which means … everything modern is simply broken

that means: GNU Pascal is pretty dead , on modern linux box, it may be it can survive on old Unix box, like Irix but .. using old overlaid toolchain (e.g. gcc-v2.95, or gcc-v3.3.*)

jan-jaap wrote: That's why there are two versions on the download page: one with the GCC version included, and one without.


that's a wrong approach, if you tarball a toolchain like gcc you MUST include the crt files, so "with-gcc" MUST include also the basic libraries as they are specifically related to a gcc version.


* * * AA * * *
i'd like to have Gcc version 2.95.2 19991024, mips-sgi-irix6.5 full toolchain, does anyone have it somewhere ?


jan-jaap wrote: I copied them from a GCC 3.4.6 into the correct directory for GPC (where libcgcc.a is) and then it works. At least, it works enough to compile a working hello world program.


Code: Select all

cp /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtbegin.o /usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/
cp /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtend.o /usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/


Code: Select all

gpc -v --big-endian hallo.pas


Code: Select all

Reading specs from /usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/specs
gpc version 2.1 (20020510), based on 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/gpcpp -lang-pascal -v -famtmpfile=/var/tmp/cca00Dqq -fbig-endian -fdelphi-comments -D__GNU_PASCAL__ -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=1 -D__GPC_VERSION__=2.1 -D__GPC_RELEASE__=20020510 -D__BITS_BIG_ENDIAN__=1 -D__BYTES_BIG_ENDIAN__=1 -D__WORDS_BIG_ENDIAN__=1 -D__NEED_ALIGNMENT__=1 -Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 -D_LONGLONG -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D__unix__ -D__mips__ -D__sgi__ -D__host_mips__ -D__MIPSEB__ -D_MIPSEB -D__SYSTYPE_SVR4__ -D_LONGLONG -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D__unix -D__mips -D__sgi -D__host_mips -D__MIPSEB -D__SYSTYPE_SVR4 -Asystem(unix) -Asystem(svr4) -Acpu(mips) -Amachine(sgi) -D__CHAR_UNSIGNED__ -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__EXTENSIONS__ -D_SGI_SOURCE -D_MIPS_FPSET=32 -D_MIPS_ISA=_MIPS_ISA_MIPS3 -D_ABIN32=2 -D_MIPS_SIM=_ABIN32 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 -D_COMPILER_VERSION=601 -U__mips -D__mips=3 -D__mips64 hallo.pas /var/tmp/cca00Dqq.i
GNU Pascal Compiler PreProcessor version 2.1 (20020510), based on gcc-2.95.2 19991024 (release) [AL 1.1, MM 40] SGI running IRIX 6.x
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/mips-sgi-irix6.5/include
/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/gpc1 /var/tmp/cca00Dqq.i -quiet -dumpbase hallo.pas -version -famtmpfile=/var/tmp/cca00Dqq -fbig-endian -o /var/tmp/cca00Dqq.s
GNU Pascal version 2.95.2 19991024 (release) (mips-sgi-irix6.5) compiled by GNU C version 2.95.2 19991024 (release).
GNU Pascal version is actually 2.1 (20020510), based on gcc-2.95.2 19991024 (release)
/usr/bin/as -g0 -nocpp -show -G 0 -w -n32 -o /var/tmp/cca00Dqq1.o /var/tmp/cca00Dqq.s
/usr/bin/../../usr/lib32/cmplrs/as -DEFAULT:abi=n32:isa=mips4:proc=r10k -g0 -nocpp -show -G 0 -w -n32 -o /var/tmp/cca00Dqq1.o /var/tmp/cca00Dqq.s
/usr/lib32/cmplrs/asm -t5_ll_sc_bug -pic2 -elf -EB -g0 -G0 -w -mips4 -n32 -O0 /var/tmp/cca00Dqq.s -o /var/tmp/cca00Dqq1.o
/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/collect2 -call_shared -no_unresolved -init __do_global_ctors -fini __do_global_dtors -_SYSTYPE_SVR4 -woff 131 -n32 /usr/lib32/mips3/crt1.o /usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/crtbegin.o -L/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2 -L/usr/bin -L/usr/local/lib /var/tmp/cca00Dqq1.o -lgpc -lm -dont_warn_unused -lgcc -warn_unused -L/usr/lib32/mips3 -L/usr/lib32 -dont_warn_unused -lc -warn_unused -dont_warn_unused -lgcc -warn_unused /usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/crtend.o /usr/lib32/mips3/crtn.o