Some compilation info

If you're coding on or porting to IRIX, this is the forum for discussion.
jpstewart
Posts: 27
Joined: Wed May 23, 2018 11:19 am
Location: Southwestern Ontario, Canada

Re: Some compilation info

Post by jpstewart » Mon Aug 06, 2018 11:09 am

dexter1 wrote:
Mon Aug 06, 2018 7:46 am
The symbol '__sgi' (not '__sgi__') is defined when compiling c code under IRIX. I'm not sure if gcc will set that define
Yes, GCC does define it too. It's my preferred way of identifying IRIX-specific code.
gijoe77 wrote:
Mon Aug 06, 2018 8:37 am
so lets say I have "__sig__" in my code, can i "trigger" this code by doing a "-D__sgi__" in CPPFLAGS?
Yes. (Once you correct the small typo!) But if you use __sgi, you don't need to add anything to CPPFLAGS, since that's predefined by both of the commonly used compilers. (And, IIRC, the __ prefix is supposed to be reserved for use by compiler vendors, and not used in user-written code according to the C standards.)
gijoe77 wrote:
Mon Aug 06, 2018 8:37 am
Are there certain "-D" strings you use for porting stuff to IRIX? my notes from long ago have "-DIP32 -DIRIX" but I figure those are not very helpful in most software packages
Well, it looks to me like __sgi was intended to be used for that purpose. But plenty of packages will have their own ideas about what to define to identify different OSes. My recommendation is to use __sgi for code you write. For third-party code you work with, don't expect any sort of standardization at all.
SGI: Indigo, Indigo2, Octane, Origin 300
Sun: SPARCstation 20, Ultra 2, Blade 2500, T5240
HP: 9000/380, 425e, C8000
Digital: DECstation 5000/125

User avatar
gijoe77
Posts: 217
Joined: Fri Jun 22, 2018 9:17 pm

Re: Some compilation info

Post by gijoe77 » Tue Aug 07, 2018 9:43 am

Here are my notes on compiling gftp version 2.0.19 (Nekoware's version is 2.0.17)
edit: I looked this over again because I realized I compiled originally with R10k o2 optimizations, so I dug a little deeper into it for the Tezro optimizations. Certain CFLAGS and CPPFLAGS seem to break compilation
SpoilerShow

Code: Select all

export CC=/usr/bin/cc
export CFLAGS="-c99 -diag_suppress 3649 -diag_error 1035 -woff all -Ofast=ip35 -g0 -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:IEEE_ar=3:fast_sq=ON:div_split=ON:alias=typed -lfastm -lm -TARG:platform=IP35:proc=r16000 -IPA"
export CPPFLAGS=""

/usr/nekoware/bin/sed -i 's/#include <libintl.h>/#include \"..\/intl\/libintl.h\"/' ./lib/gftp.h

./configure --prefix=/usr/local

gmake
some notes:

also need to have "-woff all", otherwise get a compiler error

Code: Select all

cc WARNING:  -p is no longer supported, use speedshop(1) instead
cc ERROR parsing -pthread:  unknown flag
with CPPFLAGS="", need to change "#include <libintl.h>" to '#include "../intl/libintl.h"' in lib/gftp.h

if CPPFLAGS="-I/usr/nekoware/include -I/usr/local/include -L/usr/nekoware/lib -L/usr/local/lib"
and lib/gftp.h still has "#include <libintl.h>" (which is located in /usr/nekoware/include)
get this error:

Code: Select all

cc-1367 cc: ERROR File = sslcommon.c, Line = 152
  A pointer to an incomplete class type is not allowed.

                  ext_str = ASN1_item_d2i (NULL, (const unsigned char **) &ext->value->data, ext->value->length,
                                                                           ^
so path of least resistance for me was just doing CPPFLAGS=""


edit: original posting below

Code: Select all

export CC=/usr/bin/cc
export CXX=/usr/bin/CC
export CFLAGS="-c99 -diag_suppress 3649 -diag_error 1035 -woff all -g0 -Ofast=ip32_10k -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed -TARG:platform=ip32_10k:proc=r12000 -IPA"
export CXXFLAGS="-ptused -diag_suppress 3649 -woff all -g0 -Ofast=ip32_10k -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed -TARG:platform=ip32_10k:proc=r12000 -IPA"


had to change "#include <libintl.h>"   to  '#include "../intl/libintl.h"'   in ../../lib/gftp.h
once that was fixed it compiled fine

./configure
gmake
gmake install
Last edited by gijoe77 on Thu Aug 09, 2018 4:27 pm, edited 2 times in total.

User avatar
gijoe77
Posts: 217
Joined: Fri Jun 22, 2018 9:17 pm

Re: Some compilation info

Post by gijoe77 » Tue Aug 07, 2018 9:47 am

My failed attempt at compiling Filezilla 3.35.1 - GCC 4.7.3 is apparently unable to compile it also... I guess we need a newer GCC...
SpoilerShow

Code: Select all

export CC=/usr/bin/cc
export CXX=/usr/bin/CC
export CFLAGS="-c99 -diag_suppress 3649 -diag_error 1035 -woff all -g0 -Ofast=ip32_10k -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed -TARG:platform=ip32_10k:proc=r12000 -IPA"
export CXXFLAGS="-ptused -diag_suppress 3649 -woff all -g0 -Ofast=ip32_10k -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed -TARG:platform=ip32_10k:proc=r12000 -IPA"

./configure

checking whether /usr/bin/CC supports C++14 features by default... no
checking whether /usr/bin/CC supports C++14 features with -std=gnu++14... no
checking whether /usr/bin/CC supports C++14 features with -std=gnu++1y... no
checking whether /usr/bin/CC supports C++14 features with -std=c++14... no
checking whether /usr/bin/CC supports C++14 features with -std=c++1y... no
configure: error: *** A compiler with support for C++14 language features is required.



#########################################
Try with GCC

export CC=/usr/nekoware/gcc-4.7/bin/gcc
export CXX=/usr/nekoware/gcc-4.7/bin/g++
export CFLAGS="-std=gnu99 -g0 -O0 -mips4"
export CXXFLAGS="-g0 -O0 -mips4"

./configure
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features by default... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=gnu++14... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=gnu++1y... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=c++14... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=c++1y... no
configure: error: *** A compiler with support for C++14 language features is required.
configure: WARNING: cache variable ac_cv_env_CXXFLAGS_value contains a newline
-bash-4.3$ 


User avatar
LarBob
Posts: 62
Joined: Mon Dec 25, 2017 4:08 pm
Location: Kentucky, United States
Contact:

Re: Some compilation info

Post by LarBob » Fri Aug 10, 2018 1:23 am

gijoe77 wrote:
Tue Aug 07, 2018 9:47 am
My failed attempt at compiling Filezilla 3.35.1 - GCC 4.7.3 is apparently unable to compile it also... I guess we need a newer GCC...
SpoilerShow

Code: Select all

export CC=/usr/bin/cc
export CXX=/usr/bin/CC
export CFLAGS="-c99 -diag_suppress 3649 -diag_error 1035 -woff all -g0 -Ofast=ip32_10k -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed -TARG:platform=ip32_10k:proc=r12000 -IPA"
export CXXFLAGS="-ptused -diag_suppress 3649 -woff all -g0 -Ofast=ip32_10k -O3 -n32 -mips4 -OPT:Olimit=0:roundoff=3:div_split=ON:alias=typed -TARG:platform=ip32_10k:proc=r12000 -IPA"

./configure

checking whether /usr/bin/CC supports C++14 features by default... no
checking whether /usr/bin/CC supports C++14 features with -std=gnu++14... no
checking whether /usr/bin/CC supports C++14 features with -std=gnu++1y... no
checking whether /usr/bin/CC supports C++14 features with -std=c++14... no
checking whether /usr/bin/CC supports C++14 features with -std=c++1y... no
configure: error: *** A compiler with support for C++14 language features is required.



#########################################
Try with GCC

export CC=/usr/nekoware/gcc-4.7/bin/gcc
export CXX=/usr/nekoware/gcc-4.7/bin/g++
export CFLAGS="-std=gnu99 -g0 -O0 -mips4"
export CXXFLAGS="-g0 -O0 -mips4"

./configure
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features by default... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=gnu++14... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=gnu++1y... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=c++14... no
checking whether /usr/nekoware/gcc-4.7/bin/g++ supports C++14 features with -std=c++1y... no
configure: error: *** A compiler with support for C++14 language features is required.
configure: WARNING: cache variable ac_cv_env_CXXFLAGS_value contains a newline
-bash-4.3$ 

Not happening any time soon. IRIX ABI support was removed in GCCs after 4.7.x. IRIX headers also definitely do not support C++14, haha. Also, weird that it requires C++14. FileZilla isn't great anyway I guess. :P
:Octane: Aezora - Octane - 2xR10k 250 MHz - SI Graphics - 1 GB RAM - 6.5.30f
:O2: Kiki - O2 - R5k 180 MHz - 192 MB RAM - Currently dead
:O3x0-2: Calcifer - Origin 300 - 4xR14k 500 MHz - 2 GB RAM - 6.5.30m
:O3x0-2: Tohru - Origin 350 - 4xR16k 800 MHz - 4 GB RAM - 6.5.30m - on loan from Raion
Mirrors

User avatar
gijoe77
Posts: 217
Joined: Fri Jun 22, 2018 9:17 pm

Re: Some compilation info

Post by gijoe77 » Fri Aug 10, 2018 11:51 am

LarBob wrote:
Fri Aug 10, 2018 1:23 am
Not happening any time soon. IRIX ABI support was removed in GCCs after 4.7.x. IRIX headers also definitely do not support C++14, haha. Also, weird that it requires C++14. FileZilla isn't great anyway I guess. :P
oh that's pretty crappy, thanks for the info - good to know.

Post Reply