OK, I ran the script as it was, and got the following error:
Code:
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/home/schol-r-lea/Deployments/cross-dev-utils/gcc/build/x86_64-w64-mingw32/x86_64-w64-mingw32/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make: *** [Makefile:13779: configure-target-libgcc] Error 1
This is the first time this error has come up so far, but it does indicate that it is at least trying to build libgcc, even if there is some problem with the C pre-processor.
I have composed a simplified version of the install script to speed up the testing, having it compile only for the single target triplet, and only for C:
Code:
#!/bin/bash
GCC_SRC="/home/schol-r-lea/Deployments/cross-dev-utils/gcc"
GCC_BUILD="$GCC_SRC/build"
DEST="/home/schol-r-lea/opt/cross"
cd $GCC_SRC
# git pull origin master
cd $GCC_BUILD
TARGET="x86_64-w64-mingw32"
TARGET_DIR="$GCC_BUILD/$TARGET"
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
cd $TARGET_DIR
$GCC_SRC/configure --target=$TARGET --prefix=$DEST --disable-nls \
--enable-languages=c \
--disable-shared \
--without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
Running this gives the following error message:
Code:
/usr/bin/install -c -m 644 b-header-vars /home/schol-r-lea/opt/cross/lib/gcc/x86_64-w64-mingw32/11.0.0/plugin/include/b-header-vars
make[1]: Leaving directory '/home/schol-r-lea/Deployments/common/gcc/build/x86_64-w64-mingw32/gcc'
/bin/sh /home/schol-r-lea/Deployments/cross-dev-utils/gcc/mkinstalldirs /home/schol-r-lea/opt/cross /home/schol-r-lea/opt/cross
make[1]: Entering directory '/home/schol-r-lea/Deployments/common/gcc/build/x86_64-w64-mingw32/x86_64-w64-mingw32/libgcc'
make[1]: *** No rule to make target 'install'. Stop.
make[1]: Leaving directory '/home/schol-r-lea/Deployments/common/gcc/build/x86_64-w64-mingw32/x86_64-w64-mingw32/libgcc'
make: *** [Makefile:13221: install-target-libgcc] Error 2
What I don't understand about this error is the reference to a
common/ directory in the directory
above the one I am invoking the script from (
/home/schol-r-lea/Deployments/cross-dev-utils). I would expect that, if anything, it would use a
common/ directory in
/home/schol-r-lea/Deployments/cross-dev-utils/gcc, rather than going two directories up the path.
EDIT: While the
/home/schol-r-lea/Deployments/common/ directory does exist, which is where all of the actual source code is kept (the directories in
cross-dev-utils/ are all symbolic links to same, something I'd forgotten about) there is no
libgcc/ directory there.
I know I am building from the bleeding-edge versions of the GCC source tree, but I am hesitant to assume that there is a fault in the GCC build scripts. I can only assume something is wrong with my own script, but I am unsure what it would be.