puppy icon indicating copy to clipboard operation
puppy copied to clipboard

Compile GCC for Puppy

Open egranata opened this issue 7 years ago • 3 comments

In order to compile GCC, at least the following APIs are missing:

  • dup2
  • alarm
  • execvp

egranata avatar Nov 17 '18 06:11 egranata

In file included from ../../gcc-7.2.0/gcc/c/c-lang.c:22:0:
../../gcc-7.2.0/gcc/system.h:221:11: fatal error: algorithm: No such file or directory
 # include <algorithm>
           ^~~~~~~~~~~
compilation terminated.

Alas, while we do have the C++ header, it is part of EASTL and thus it is at <EASTL/algorithm.h>

egranata avatar Nov 17 '18 06:11 egranata

This problem is a fair bit more subtle than just make a custom include to point to <EASTL/algorithm.h>:

/bin/bash ../../gcc-7.2.0/gcc/mkconfig.sh bconfig.h
g++ -c -DIN_GCC     -DGENERATOR_FILE  -I. -Ibuild -I../../gcc-7.2.0/gcc -I../../gcc-7.2.0/gcc/build -I../../gcc-7.2.0/gcc/../include  -I../../gcc-7.2.0/gcc/../libcpp/include  \
	-o build/genmddeps.o ../../gcc-7.2.0/gcc/genmddeps.c
In file included from ../../gcc-7.2.0/gcc/genmddeps.c:19:
../../gcc-7.2.0/gcc/system.h:236:11: fatal error: EASTL/new: No such file or directory
 # include <EASTL/new>
           ^~~~~~~~~~~
compilation terminated.

For some reason, this part of the g++ build process is using the system's g++ and not build/g++.sh; which means one probably needs to point the build process at the system GCC but configured for 32-bit

egranata avatar Nov 17 '18 06:11 egranata

The technical part of this problem can be solved by bootstrapping - but doing that requires an intermediate step where one patches GCC to configure it to work for Puppy.

egranata avatar Nov 17 '18 19:11 egranata