SGI: Development

Creating Tardists

It seems compiling various apps using GCC can be an extremely difficult task (bordering on impossible, in some cases).

After reviewing some of the tips and tricks out there on the 'net, however, it seems a neglected subject.. :(

Anyone out there have any useful tips/tricks for getting things compiled under gcc??
Well it really depends on what you're trying to compile. I've found that compiling open source isn't too difficult as long as it doesn't call Linux specific features that IRIX simply can't handle without code rewrite.

Depending on the specific build errors I've found that defining BSD_TYPES or BSD_COMPAT helps in many cases (as example, compiling Icecast). This makes IRIX a bit more BSD-like to many packages.

Have an example of something you're trying to build?

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
Nothing specific off the top of my head...I was toying with egd for awhile, and just about anything from CPAN that requires actual compilation bombs, etc.

Biggest thing I've run into is environment vars. Setting CC, LD, and a few others properly seems to help quite a bit during makefile generation, but 9 times out of 10, I end up with a Makefile, calling gcc, and passing MIPSPro options to it, like -woff, -n32, etc. Cleaning up makefiles is trivial, but highly annoying. find . -name Makefile -exec vi {} \; speeds the process up, but...

:)

Unfortunately, I just moved, and haven't gotten my net connection nor my computers back up yet, so I can't offer any /real/ examples of my compilation failures.. :) I have gotten sendmail, apache, php, and mysql to compile and run quite happily...oh well.. :?

Cheers!
Not sure how many of you are using gcc-3.2.1 from SGI's Freeware (as it requires IRIX 6.5.18+ due to the header changes), but his may help some.

I discovered a nasty bug with g++ which made it useless for even those using 6.5.18. Yes, once again an issue with the new header structure ... a compile time option was left off by SGI that generates unresolvable errors during g++ compiles.

gcc-3.2.2 was released a couple of days ago so I decided to take advantage of the situation and repair the botched gcc-3.2.1 SGI Freeware version. It was pretty easy to get going.

Untar and change to gcc-3.2.2/:

Code:
./configure --prefix=/usr/freeware --enable-version-specific-runtime-libs --enable-threads --enable-haifa --disable-c-mbchar --disable-shared

gmake bootstrap
gmake install

[Mika:~] neko 105% gcc -v
Reading specs from /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.2.2/specs
Configured with: ./configure --prefix=/usr/freeware --enable-version-specific-runtime-libs --enable-threads --enable-haifa --disable-c-mbchar --disable-shared
Thread model: single
gcc version 3.2.2


That's it!

I just tried it on code that was killing me under 3.2.1 and I'm now getting clean compiles :)

BTW, you can use the same method to install 3.2.2 on IRIX 6.5.17 and below, just leave off the --disable-c-mbchar switch on the configure line.

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
/me needs to figure out how to get ahold of 6.5.19f some how... :cry:
Shtoink wrote:
/me needs to figure out how to get ahold of 6.5.19f some how... :cry:


You don't need 6.5.19 to compile 3.2.2, 6.5.19 just needs an extra switch to do so is all.

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
Shtoink wrote:
/me needs to figure out how to get ahold of 6.5.19f some how... :cry:


why do you want a feature release? it only contains unsupported software for sgi customers who want to live dangerously ;)
Hmm, egd is sort of obsolete now that we have /dev/random in 6.5.19, but I'll take a look at it when I can :)

I've found CPAN works fine, but because SGI Freeware Perl was compiled with MIPSPro you're likely to run into problems using gcc with their build (that's why you get those MIPSPro options going to gcc, Perl is just attempting to use the same flags it was compiled with originally). One solution would be to build Perl yourself using gcc or simply switch to MIPSPro for module compiles. Many of the modules that run the Movable Type portion of the site I compiled myself (with MIPSPro).

Anyway, it's not as bad as all that :)

And yeah, I waited to reply to this in hopes your net connection was back up :D

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
ian wrote:
Shtoink wrote:
/me needs to figure out how to get ahold of 6.5.19f some how... :cry:

why do you want a feature release? it only contains unsupported software for sgi customers who want to live dangerously ;)


Also take note that this is 6. 5 .19 - and as we all linux users know - this is the unstable version. Better stick with 6.4 :twisted:
Just my 2 cents for this matter:

gcc can be troublesome at times, so if you're fortunate enough to have the MIPSpro compilers, i usually try them before resorting to GNU. Typical make problems are incorrect environment flags like CC CFLAGS CXX CXXFLAGS, sometimes CPPFLAGS. Setting them to
CC=cc
CXX=c++
CFLAGS="-I/usr/freeware/include -L/usr/freeware/lib"
CXXFLAGS same as for CFLAGS
Also some compiles break on national language support so a --disable-nls will fix that. Check also the LD_LIBRARY_PATH : mine is /usr/local/lib:/usr/freeware/lib:/usr/freeware/lib32

Beware however the tricky pointer arithmetic which is allowed in gcc, but MIPSpro barfs loudly with messages like:
cc-1133 cc: ERROR File = barf.c, Line = 751
Expression must be a modifiable lvalue.

(UINT32*)dst2 += 3;
^
so i changed it into dst2=(UINT32*)dst1 + 3;

That was my trick to compile Xmame :)

see ya
In addition, some good general tips:

http://freeware.sgi.com/howto.html

_________________
私のホバークラフト は鰻が一杯です。
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.
dexter1 wrote:
cc-1133 cc: ERROR File = barf.c, Line = 751
Expression must be a modifiable lvalue.

(UINT32*)dst2 += 3;
^
so i changed it into dst2=(UINT32*)dst1 + 3;


That should have been dst2=(UINT32*)dst2 + 3;

wuh, my first post and already a typo...
Hah! CXXFLAGS. I'd been setting CPPFLAGS. I finally got my net connection back, oh, two weeks ago now...and just now have I found the time to sit down and put some thought back into getting my stuff running..

Thanks for all the tips.. :) I'll tweak my environment and give things a go...

Cheers!
Something else which complicates things (which Neko told me about) -

It seems one of the SGI packages installs gcc in /usr/sbin (Ada4 I believe it is puts it there)

And, it's an old version 2.8.1, which conflicts with everything else. This is made even worse if you're using c++ because g++, which will be in /usr/freeware/bin will be the correct version, but it'll go to the copy of gcc in /usr/sbin, and with conflicting versions (and types, 1 puts out o32, one n32 binaries) you'll get all kinds of strange errors, so after installing gcc from freeware (or compiling it yourself or whatever I guess) I HIGHLY recommend getting rid of /usr/sbin/gcc (or atleast renaming it)
I like the little disclaimer about gcc 3.2.1 on the freeware site.

Quote:
NOTE: fw_gcc/3.2.1 should only be used on systems running IRIX 6.5.18 or later. It accidentally picked up some version-specific headers. Older system can still run fw_gcc/3.0.4


Accidentally, eh?
nekonoko,

I noticed that you had some nice tardists on your site :) I was wondering how hard it was to make these, and how I would go about it. This is because I would like to make and put up some tardists on my website http://www.x41.net . Things like Fluxbox for example, on the download site they have all the usual packages, and even a Sparc and Slackware version, but no irix one. Wouldent it be nice to get some more going?

This could be done by many, going so far to start a .tardist marathon, in which a few people see how many working tardists they can make or popular software.

The good thing about x41.net is that I dont pay for or do the hosting, and the amount thats downloaded off it per month is not an issue :)

Do you think this is a good or bad idea, input from all apprieciated :D

Gareth
Creating tardists is pretty easy; create the package using the 'swpkg' program and then tar up the result. I'd love to create a tutorial but since it is a GUI application it would require a bit more time than I have to give at the moment. The manpage for swpkg is pretty good though.

_________________
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.