build gcc 5.4.0

1081 ワード

To enable KASAN, we must use gcc 5.
# wget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2
# tar jxf gcc-5.4.0.tar.bz2
# cd gcc-5.4.0
# ./contrib/download_prerequisites
# mkdir gcc-build
# cd gcc-build
# ../configure --prefix=/usr/local        \
             --disable-multilib         \
             --enable-languages=c,c++   \
             --enable-libstdcxx-threads \
             --enable-libstdcxx-time    \
             --enable-shared            \
             --enable-__cxa_atexit      \
             --disable-libunwind-exceptions     \
             --disable-libada                   \
             --host x86_64-redhat-linux-gnu     \
             --build x86_64-redhat-linux-gnu    \
             --with-default-libstdcxx-abi=gcc4-compatible
# make -j 32
# make install
# which gcc
/usr/local/bin/gcc
# gcc --version
gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.