ps3dev / ps3toolchain

A script to autobuild an open source toolchain for the PS3.
BSD 2-Clause "Simplified" License
280 stars 92 forks source link

Header "debug/assertions.h" not found. #80

Open IngwiePhoenix opened 5 years ago

IngwiePhoenix commented 5 years ago

After I reported my previous issue and let this run for some, I came back to this:

/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/./gcc/xgcc -shared-libgcc -B/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/./gcc -nostdinc++ -L/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/src -L/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/src/.libs -L/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/libsupc++/.libs -nostdinc -B/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/newlib/ -isystem /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/newlib/targ-include -isystem /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/newlib/libc/include -B/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libgloss/spu -L/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libgloss/libnosys -L/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/libgloss/spu -B/usr/local/ps3dev/spu/spu/bin/ -B/usr/local/ps3dev/spu/spu/lib/ -isystem /usr/local/ps3dev/spu/spu/include -isystem /usr/local/ps3dev/spu/spu/sys-include    -x c++-header -nostdinc++ -g -O2  -I/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/spu -I/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include -I/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/libstdc++-v3/libsupc++  -O2 -g /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/libstdc++-v3/include/precompiled/stdc++.h -o spu/bits/stdc++.h.gch/O2g.gch
In file included from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/bits/stl_algobase.h:66:0,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/bits/char_traits.h:39,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/ios:40,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/istream:38,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/sstream:38,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/complex:45,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/ccomplex:39,
                 from /Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/libstdc++-v3/include/precompiled/stdc++.h:52:
/Users/Ingwie/Work/Git/ps3toolchain/build/gcc-7.2.0/build-spu/spu/libstdc++-v3/include/bits/stl_iterator_base_funcs.h:65:10: fatal error: debug/assertions.h: No such file or directory
 #include <debug/assertions.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [spu/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-target-libstdc++-v3] Error 2
make: *** [all] Error 2
../scripts/006-gcc-newlib-SPU.sh: Failed.
ERROR: Could not run the toolchain script.

Now, I am not too familiar with GCC's cross-compiling... so I don't know if it is trying to reference a native header, or not. Any advice?

zeldin commented 5 years ago

xgcc is the cross-compiler just built, so it is trying to build SPU code (or actually in this case precompiled headers, not code as such). Native headers should not be used.

debug/assertions.h is a header that is part of the std C++ library shipped with gcc. It will (eventually) get installed as /usr/local/ps3dev/spu/spu/include/c++/7.2.0/debug/assertions.h.

So what we have here is a case of gcc not finding its own headers. No ideas come immediately to mind I'm afraid.

bucanero commented 5 years ago

I came across a similar issue when building my ps3 toolchain on macOS. Try this fix:

once Xcode has been executed for the first time and everything is setup, just run the toolchain scripts again. Everything will run smoothly, with no missing gcc headers.