Instructions for installing DGUX-R420MU07-DEVTOOLS to a DG/UX Unix clean system. Takis Psarogiannakopoulos University of Cambridge Centre for Mathematical Sciences In general getting DEVTOOLS is not the solution to everything in DG/UX. Try read below to install DEV Tools *correctly*. It is very important to know how they are made to integrated inside a native DG/UX system. PLEASE READ BELOW: I suposse somehow you have obtained the file "DGUX-R420MU07-DEVTOOLS.tar.gz". If not try: ftp ftp.xfree86.org login: ftp password: your email address bin (set binary data transfers) cd pub/XFree86/4.2.0/binaries/DGUX-ix86/DEVTOOLS-R420MU07/ ls -al get DGUX-R420MU07-DEVTOOLS.tar.gz get README-DGUX-R420MU07-DEVTOOLS (this file) quit OR ftp ftp.dpmms.cam.ac.uk (University of Cambridge, Department of Pure Mathematics) login: ftp password: your email address bin (set binary data transfers) cd pub/takis/ ls -al get DGUX-R420MU07-DEVTOOLS.tar.gz get README-DGUX-R420MU07-DEVTOOLS (this file) quit I also suppose you are running DG/UX version R4.20MU07. If you are NOT please ask EMC and upgrade to the latest R4.20MU07 OS. First you should use "sysadm" tool and make a new virtual disk mounted under /usr/local. Then copy the file DGUX-R420MU07-DEVTOOLS.tar.gz to /usr and untarred using the command: gzip -d < DGUX-R420MU07-DEVTOOLS.tar.gz | tar xvf - It will put its contents to the new virtual disk that you mount under the directory /usr/local. (/usr/local is an empty dir under any stock DG/UX system). To install the the DEVTool files you need to do some things first: Replace the ld in /usr/sde/ix86dgux/usr/bin with the ld inside local. Data General linker of MU04/MU05/MU06/MU07 is buggy. DG sent me a replacement linker binary that I am including in the local dir. First always backup the files you replacing! Do: cd /usr/sde/ix86dgux/usr/bin cp ld ld.ORIG-MU07 cd /usr/local cp ld.MU07-REPLACEMENT /usr/sde/ix86dgux/usr/bin/ld (ld.ORIG-MU07 is now your old linker). Then: cd /usr/bin: cp as as.ORIG cp ld ld.ORIG (backup the files as, ld in /usr/bin). Then: cd /usr/local There are some headers to replace in your MU07 for C++ to work. cd /usr/local/HEADERS-INCLUDE-C++-MU07-REPLACE cp -r * /usr/include (Try diff with your original /usr/include/files to see what is the changes inside the headers) After replacing the ld and the headers and backup as,ld in /usr/bin, you are ready to install the main gcc-2.95.3. First make crt1,i,n.o files relative to the active gcc: cd /usr/sde/ix86dgux/usr/lib cp crt1.o gcc-2 cp crti.o gcc-2 cp crtn.o gcc-2 (observe now that there is a link gcc -> gcc-2) rm crt1.o crti.o crtn.o ln -s gcc/crt1.o crt1.o ln -s gcc/crti.o crti.o ln -s gcc/crtn.o crtn.o (2.95.3 rev (DG/UX), has its own such files, that is why we did the above). cd /usr/local cp -r gcc-dgux-2953 /usr/sde/ix86dgux/usr/lib cp -r gcc-dgux-2953 /usr/opt/sdk/sde/ix86dgux/usr/lib cd /usr/sde/ix86dgux/usr/lib rm gcc ln -s gcc-dgux-2953 gcc cd /usr/opt/sdk/sde/ix86dgux/usr/lib rm gcc ln -s gcc-dgux-2953 gcc So the active gcc will now point to the new dir gcc-dgux-2953. It is *very* important to do that. You can not have a reliably working gcc-2.95.3 if you leave as active gcc in SDE the system gcc-2.7.2.9. Even if you going to run gcc-2.95.3 mainly from /usr/local/bin YOU NEED TO DO THE ABOVE. To go back to your old compiler just replace the links gcc->gcc-dgux-2953 with the gcc->gcc-2 (in both dirs above, and of cource dont have /usr/local/bin in your path!). Lastly add /usr/local/bin to your path and /usr/local/lib to your LD_LIBRARY_PATH and *re-login* . gcc -v should report the new compiler. (I mean modify your .profile) Now if you want to link a shared libstdc++ go to /usr/local/lib and make a link ln -s libstdc++.so.2.10.0 libstdc++.so Then remove the static link (so no libstdc++.a link) But then, you need to supply this shared libstdc++ with your programs in order to work. So prefer the static libstdc++. Linking the library "-lthread" in DG/UX: The -lthread in DG/UX must be linked in a special way. We have two gcc 2.95.3 switches : -pthread and -threads. NEVER use "-lthread" in the gcc compile/link line when you compile a program that needs it. Instead take it out of the compile/link line and add the switch -threads. Gcc-2.95.3 will see this switch and link the library -lthread correctly for you. Alternatively the -pthread switch will do the same but add also the flag -D_POSIX4A_DRAFT10_SOURCE needed when compiling threaded programs in DG/UX. So instead of adding in your CFLAGS -D_POSIX4A_DRAFT10_SOURCE use the switch -pthread. (not both -pthread -threads). Switch -mno-legend will cause the DG/UX assembler (when used) to not produce legends debug (DG/UX as). This is needed only if you debugging with mxdb. I have included gdb-5.1. I too have mxdb but never seriously use it. Gdb debug is more portable around the net from the unknown legends ...! To compile and debug programs written in C++ do: cd /usr/local/bin cp gas /usr/bin/as cp gnu-ld /usr/bin/ld Aka for C++ YOU NEED the linker gnu-ld. (that is whay you backed up initially these two files). Then use -gstabs+ as debug FLAG when compile in C++ and gdb to analyze. Always in C++ use gnu-ld but whatever "as" you want (remember -gstabs+ will not work with the DG/UX as; use instead "-g -mstandard" and possibly add -mno-legend). To go back to your old as, ld in /usr/bin do: cd /usr/bin cp as.ORIG as cp ld.ORIG ld Remember: when you *building* a DG/UX kernel you NEED the original DG/UX ld NOT the GNU one. So restore it before! (By doing cd /usr/bin cp ld.ORIG ld). For the assembler it doesnt matter really. You will normally need to use (for programs from the net) : -D_DGUX_SOURCE -mno-legend -O2 OR -gstabs+ -D_DGUX_SOURCE -mno-legend -O2 for debug. (In C you can use instead of -gstabs+ the -g -mstandard not only -g as ,say, in Linux. But C++ needs always -gstabs+ for debug). Finally, an important note: *Always* create shared libs in DG/UX with gcc-2.95.3 and the command gcc -shared -o libXXXX.so -h 'soname' files to link. All "files to link" they must have been compiled with whatever FLAGs required (eg the above ones) PLUS the GCC shared flag -fPIC !!! Never use (or let Makefile/scripts use) the command "ld -G" (i.e. directly use ld) to link relocatable files to a shared object. This is recipe for disaster. Especially in C++ where you have constructors and desctructors!!! Good luck, Takis Psarogiannakopoulos University of Cambridge Centre for Mathematical Sciences Department of Pure Mathematics Wilberforce Road Cambridge CB3 0WB ,UK , February 2003