GCC-14.2 Build Process
If you haven’t run the download_prerequisites
script, it may result in missing dependencies, which could affect the functionality of the GCC you are building. Here are the steps you can take to resolve this issue:
Step 1: Download Dependencies
-
Navigate to the top-level directory of the GCC source code:
Make sure you are in the top-level directory of the GCC source code.cd /path/to/gcc-X.X.X # Replace with your actual path
-
Run
download_prerequisites
:
Execute the following command in the top-level directory:./contrib/download_prerequisites
Step 2: Build GCC
-
Clean previous builds:
If there were issues with previous builds, it is recommended to clean the build directory:cd .. rm -rf build
-
Recreate the build directory:
Create a new build directory and navigate into it:mkdir build cd build
-
Reconfigure and build:
Run the configuration command, then compile:../configure --enable-languages=c,c++ --disable-multilib --prefix=/opt/gcc-14.2.0 make sudo make install
Step 3: Set Priority Levels
# Add gcc
sudo update-alternatives --install /usr/bin/gcc gcc /opt/gcc-14.2.0/bin/gcc 100
# Add g++
sudo update-alternatives --install /usr/bin/g++ g++ /opt/gcc-14.2.0/bin/g++ 100
Step 4: Update link library location
export LD_LIBRARY_PATH=/opt/gcc-14.2.0/lib64:$LD_LIBRARY_PATH