Page 3 of 3

Re: Some compilation info

Posted: Mon Aug 06, 2018 11:09 am
by jpstewart
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.

Re: Some compilation info

Posted: Tue Aug 07, 2018 9:43 am
by gijoe77
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

Re: Some compilation info

Posted: Tue Aug 07, 2018 9:47 am
by gijoe77
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$ 


Re: Some compilation info

Posted: Fri Aug 10, 2018 1:23 am
by LarBob
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

Re: Some compilation info

Posted: Fri Aug 10, 2018 11:51 am
by gijoe77
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.