GCC Build Errors

FOSSilized_Daemon FOSSilized_Daemon@protonmail.com
Sat Jun 12 22:51:36 GMT 2021


Hello everyone,

I have been working on a project for the past few months (year(s)?) that requires me to build a cross-compiler toolchain which is to be used to build the actual base operating system (GNU toolchain, Linux kernel, init system, etc). The cross-compiler toolchain is nothing overly complicated just:

- binutils
- linux kernel headers
- glibc headers
- glibc
- gcc

This project is a long term investment on my part and is, essentially, a custom GNU/Linux distribution for myself. In the past few weeks I have been working on writing the steps for building the GNU cross-compiler toolchain (as described above), and recently ran into some trouble. While I have been able to get binutils, linux kernel headers, glibc headers (kinda) installing and working, I can't seep to get GCC pass I to build properly. After some debugging I was able to determine that is *seems* that GCC is failing on warnings, but building with `--disable-werror` doesn't seem to solve the problem. When I build GCC on pass I I use the following steps:

tar -xvf gcc-11.1.0.tar.xz
mkdir -p gcc-11.1.0/build-gcc/local-install
cd gcc-11.1.0/
export local_install="${ACID_BUILDS}"/gcc-11.1.0/build-gcc/local-install
./contrib/download_prerequisites

export CFLAGS="-I${ACID_TEMP_TOOLS}/usr/include -I${ACID_TEMP_TOOLS}/usr/x86_64-pc-linux-gnu/include"
export CXXFLAGS="-I${ACID_TEMP_TOOLS}/usr/include -I${ACID_TEMP_TOOLS}/usr/x86_64-pc-linux-gnu/include"

../configure --prefix="${local_install}" --with-sysroot="${ACID_TEMP_TOOLS}" --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --enable-languages=c --enable-multilib
make
make install

but for some reason GCC keeps throwing errors about functions not being defined and then ending complication on the initial make. I apologize for reaching out as I know you are all very busy, but I have been debugging this issue all week and can't seem to figure out the solution to getting GCC to build properly for pass I. I have reviewed the documentation and even reached out to some communities, but the diagnoses I get from other people seems to be that it is possibly some bug in the GCC build system, but I am not familiar enough with GCC to determine if that is correct. Has anyone here by chance experienced similar issues when compiling GCC pass I for a cross-compiler toolchain? I am not actively using any documentation to build this cross-compiler toolchain, aside from the official documentation and `--help` from GNU and random posts I find around the internet, I am documenting my steps for my personal project in case they are of any help in diagnosis; said steps can be found on my repository [here](https://gitlab.com/FOSSilized_Daemon/nexus/-/blob/master/doc/guides/nexus-for-pcs/sections/building-the-base-os-notes.md) (note that `--disable-werror` is not included in these steps and that I had to manually install the glibc headers as for some reason glibc installs said headers into `$ACID_TEMP_TOOLS/$PWD/usr/include` instead of `$ACID_TEMP_TOOLS/usr/include` this seems to be an issue with how I am specifying the installation location, but I am still trying to figure out how to fix that as well) and the GCC error.log and build.log can be found [here](https://gitlab.com/FOSSilized_Daemon/nexus/-/blob/master/doc/guides/nexus-for-pcs/sections/gcc-error.log) and [here](https://gitlab.com/FOSSilized_Daemon/nexus/-/blob/master/doc/guides/nexus-for-pcs/sections/gcc-build.log) (these are without --disable-werror). For clarification the values of the environment variables I am using in these steps are simply:

- ACID_ROOT=/home/user/.builds/acid-project/acid-root
- ACID_TEMP_TOOLS=/home/user/.builds/acid-project/acid-root/temporary-tools
-ACID_BUILDS=/home/user/.builds/software/building

Again, I apologize for taking up your time. Thank you for reading.


More information about the Gcc-help mailing list