Skip to content

create our own gcc toolchain for compiling spc-gnu-docker #686

Open
@henderkes

Description

@henderkes

To allow statically linking against libgomp, libstdc++ and so on in -static-pie builds.

Luckily this was super easy to do inside the spc-gnu-docker image itself:

yum install -y wget
wget https://ftp.gwdg.de/pub/misc/gcc/releases/gcc-14.2.0/gcc-14.2.0.tar.gz
tar xzf gcc-14.2.0.tar.gz
cd gcc-14.2.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-14.2.0/configure   --prefix=$HOME/GCC-14   --enable-languages=c,c++,go   --enable-default-pie   --enable-default-ssp   --enable-shared   --enable-static   --enable-threads=posix   CFLAGS="-O2 -fPIC -fPIE -g0 -static-libgcc"   CXXFLAGS="-O2 -fPIC -fPIE -g0 -static-libgcc -static-libstdc++" --disable-multilib
make -j4
make install

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions