Ubuntu18.04编译安装gcc6.3
系统: deepin V20.6
平台: x86_64
gcc
编译器版本:gcc version 8.3.0 (Uos 8.3.0.3-3+rebuild)
wget http://mirror.hust.edu.cn/gnu/gcc/gcc-6.5.0/gcc-6.5.0.tar.gz
sudo apt update
sudo apt dist-upgrade
sudo apt install libmpc-dev libgmp-dev libmpfr-dev gcc-multilib g++-multilib libisl-0.18-dev texi2html
tar -xf gcc-6.5.0.tar.gz
cd gcc-6.5.0
mkdir build
cd build
../configure --prefix=/opt/App/gcc-6.5.0
make -j4
make install
tar -xf gcc-6.3.0.tar.gz
cd gcc-6.3.0
mkdir build
cd build
../configure --enable-languages=c,c++ --prefix=/opt/App/gcc-6.3.0 --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
make -j4
make install
见Ubuntu16.04下安装gcc5.4.0过程及报错汇总
./md-unwind-support.h: In function ‘x86_64_fallback_frame_state’:
./md-unwind-support.h:65:47: error: dereferencing pointer to incomplete type ‘struct ucontext’
sc = (struct sigcontext *) (void *) &uc_->uc_mcontext;
处理 修改文件 md-unwind-support.h
第61行
struct ucontext *uc_ = context->cfa;
修改为
struct ucontext_t *uc_ = context->cfa;
./include/java-signal.h:32:26: error: invalid use of incomplete type ‘struct _Jv_catch_fpe(int, siginfo_t*, void*)::ucontext’
gregset_t &_gregs = _uc->uc_mcontext.gregs;
处理 修改文件 java-signal.h
第31行
struct ucontext *_uc = (struct ucontext *)_p;;
修改为
struct ucontext_t *_uc = (struct ucontext_t *)_p;
../../../../libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:270:22: error: aggregate ‘sigaltstack handler_stack’ has incomplete type and cannot be defined
struct sigaltstack handler_stack;
处理见Ubuntu18.04编译安装gcc6.3
../../../../libsanitizer/tsan/tsan_platform_linux.cc: In function ‘int __tsan::ExtractResolvFDs(void*, int*, int)’:
../../../../libsanitizer/tsan/tsan_platform_linux.cc:294:16: error: ‘statp’ was not declared in this scope
__res_state *statp = (__res_state*)state;
^~~~~
../../../../libsanitizer/tsan/tsan_platform_linux.cc:294:37: error: expected primary-expression before ‘)’ token
__res_state *statp = (__res_state*)state;
处理见 Ubuntu18.04编译安装gcc6.3
../../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:158:23: fatal error: sys/ustat.h: 没有那个文件或目录
#include
处理见 Linux下gcc编译报错:fatal error: sys/ustat.h: No such file or directory 解决办法