C++ cross compiler issues

mkirby

New member
Oct 11, 2019
8
3
3
Hi all,

Just getting back in to my SGI's now i have room to have them running again. I have hit a bit of a snag getting a C++ cross compiler working and im hoping somoene can tell me where i have gone wrong.

The C compiler works and i have compiled quite a bit of working code that is now running merrily on my Octane.

Here's the output of trying to compile a hello world

Code:
Using built-in specs.
COLLECT_GCC=../bin/mips-sgi-irix6.5-g++
COLLECT_LTO_WRAPPER=/home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/lto-wrapper
Target: mips-sgi-irix6.5
Configured with: /nfs/programming/ruby/cross/factory/src/gcc-9.2.0/configure --enable-obsolete --disable-multilib --prefix=/home/pi/irix/cross --target=mips-sgi-irix6.5 --disable-nls --enable-languages=c,c++,lto --disable-libstdcxx --with-build-sysroot=/home/pi/irix/sysroot --enable-lto --enable-tls=no --with-sysroot=/home/pi/irix/sysroot
Thread model: posix
gcc version 9.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mabi=n32'
 /home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/cc1plus -quiet -v hello.cc -quiet -dumpbase hello.cc -mabi=n32 -auxbase hello -version -o /tmp/cc2t8TXO.s
GNU C++14 (GCC) version 9.2.0 (mips-sgi-irix6.5)
    compiled by GNU C version 8.3.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include/c++/9.2.0"
ignoring nonexistent directory "/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include/c++/9.2.0/mips-sgi-irix6.5"
ignoring nonexistent directory "/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include/c++/9.2.0/backward"
ignoring nonexistent directory "/home/pi/irix/sysroot/usr/local/include"
ignoring duplicate directory "/home/pi/irix/sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/include
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/include-fixed
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include
End of search list.
GNU C++14 (GCC) version 9.2.0 (mips-sgi-irix6.5)
    compiled by GNU C version 8.3.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: bc2199acf5726b5260672b3fca93fc90
hello.cc:1:13: fatal error: iostream: No such file or directory
    1 |    #include <iostream>
      |             ^~~~~~~~~~
compilation terminated.
Its obviously something to do with the missing directory but i dont have the brains to work out what i have done wrong.

any ideas?
 

bplaa.yai

New member
Aug 6, 2020
2
0
1
Not sure how you cross compilation environment was setup, but this line
Code:
Configured with: /nfs/programming/ruby/cross/factory/src/gcc-9.2.0/configure ... --disable-libstdcxx ...
might give a clue
 

mkirby

New member
Oct 11, 2019
8
3
3
Thanks both.

I fixed the issue. In gcc-9.2.0/libstdc++-v3/configure comment out line 78630. This stops configure bailing and allows it to build the library. g++ now works correctly.

Code:
pi@raspberrypi:~/irix/cross/tests $ ../bin/mips-sgi-irix6.5-g++ -v -o hello-c++ hello.cc
Using built-in specs.
COLLECT_GCC=../bin/mips-sgi-irix6.5-g++
COLLECT_LTO_WRAPPER=/home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/lto-wrapper
Target: mips-sgi-irix6.5
Configured with: ../src/gcc-9.2.0/configure --enable-obsolete --disable-multilib --prefix=/home/pi/irix/cross --target=mips-sgi-irix6.5 --disable-nls --enable-languages=c,c++,lto --with-build-sysroot=/home/pi/irix/sysroot --enable-lto --enable-tls=no --with-sysroot=/home/pi/irix/sysroot : (reconfigured) ../src/gcc-9.2.0/configure --enable-obsolete --disable-multilib --prefix=/home/pi/irix/cross --target=mips-sgi-irix6.5 --disable-nls --enable-languages=c,c++,lto --with-build-sysroot=/home/pi/irix/sysroot --enable-lto --enable-tls=no --with-sysroot=/home/pi/irix/sysroot
Thread model: posix
gcc version 9.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'helo-c++' '-shared-libgcc' '-mabi=n32'
 /home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/cc1plus -quiet -v hello.cc -quiet -dumpbase hello.cc -mabi=n32 -auxbase hello -version -o /tmp/ccTQ2Jaw.s
GNU C++14 (GCC) version 9.2.0 (mips-sgi-irix6.5)
    compiled by GNU C version 8.3.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/pi/irix/sysroot/usr/local/include"
ignoring duplicate directory "/home/pi/irix/sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include/c++/9.2.0
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include/c++/9.2.0/mips-sgi-irix6.5
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include/c++/9.2.0/backward
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/include
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/include-fixed
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/include
End of search list.
GNU C++14 (GCC) version 9.2.0 (mips-sgi-irix6.5)
    compiled by GNU C version 8.3.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1920c796620aa43e9300245af0b035b3
COLLECT_GCC_OPTIONS='-v' '-o' 'helo-c++' '-shared-libgcc' '-mabi=n32'
 /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/bin/as -EB -O1 -mabi=n32 -o /tmp/ccX0YuKK.o /tmp/ccTQ2Jaw.s
COMPILER_PATH=/home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/:/home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/:/home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/:/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/:/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/:/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/bin/
LIBRARY_PATH=/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/:/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/lib/../lib32/:/home/pi/irix/sysroot/lib32/../lib32/:/home/pi/irix/sysroot/usr/lib32/../lib32/:/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/lib/:/home/pi/irix/sysroot/lib32/:/home/pi/irix/sysroot/usr/lib32/
COLLECT_GCC_OPTIONS='-v' '-o' 'helo-c++' '-shared-libgcc' '-mabi=n32'
 /home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/collect2 -plugin /home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/liblto_plugin.so -plugin-opt=/home/pi/irix/cross/libexec/gcc/mips-sgi-irix6.5/9.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc9Uar91.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lm --sysroot=/home/pi/irix/sysroot -call_shared -init __gcc_init -fini __gcc_fini -melf32bmipn32 -o helo-c++ /usr/lib32/mips3/crt1.o /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/irix-crti.o /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/crtbegin.o -L/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0 -L/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/lib/../lib32 -L/home/pi/irix/sysroot/lib32/../lib32 -L/home/pi/irix/sysroot/usr/lib32/../lib32 -L/home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/../../../../mips-sgi-irix6.5/lib -L/home/pi/irix/sysroot/lib32 -L/home/pi/irix/sysroot/usr/lib32 /tmp/ccX0YuKK.o -lstdc++ -lm -lgcc_s -lgcc -lm -L/usr/lib32/mips3 -L/usr/lib32 -lc -lgcc_s -lgcc -lm /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/crtend.o /home/pi/irix/cross/lib/gcc/mips-sgi-irix6.5/9.2.0/irix-crtn.o /usr/lib32/mips3/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'helo-c++' '-shared-libgcc' '-mabi=n32'
Hopefully thats of use to other people.
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu