Compiling using GCC..

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
Slide
Posts: 114
Joined: Thu Jan 23, 2003 5:10 am
Location: WI, US
Contact:

Compiling using GCC..

Unread postby Slide » Thu Jan 23, 2003 10:44 am

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??

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8145
Joined: Thu Jan 23, 2003 1:31 am
Location: Pleasanton, California
Contact:

BSD Types

Unread postby nekonoko » Thu Jan 23, 2003 10:53 am

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?
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
Slide
Posts: 114
Joined: Thu Jan 23, 2003 5:10 am
Location: WI, US
Contact:

Unread postby Slide » Fri Jan 24, 2003 5:22 am

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!

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8145
Joined: Thu Jan 23, 2003 1:31 am
Location: Pleasanton, California
Contact:

Unread postby nekonoko » Mon Feb 17, 2003 4:34 pm

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
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
dexter1
Moderator
Moderator
Posts: 2743
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Unread postby dexter1 » Fri Feb 21, 2003 5:34 am

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

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8145
Joined: Thu Jan 23, 2003 1:31 am
Location: Pleasanton, California
Contact:

Unread postby nekonoko » Fri Feb 21, 2003 11:12 am

In addition, some good general tips:

http://freeware.sgi.com/howto.html
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
dexter1
Moderator
Moderator
Posts: 2743
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Unread postby dexter1 » Fri Feb 21, 2003 12:57 pm

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...

User avatar
Slide
Posts: 114
Joined: Thu Jan 23, 2003 5:10 am
Location: WI, US
Contact:

Unread postby Slide » Fri Feb 28, 2003 6:56 am

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!

vegac
Posts: 745
Joined: Thu Jan 23, 2003 11:34 am
Contact:

Unread postby vegac » Fri Feb 28, 2003 8:15 am

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)


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 1 guest