在 Ubuntu 18.04 上从源代码构建 GCC 6.3.0 时出错

在 Ubuntu 18.04 上从源代码构建 GCC 6.3.0 时出错

我尝试按照官方指南从源代码构建 GCC-6.3.0。我需要这个版本,因为这是 Matlab 编译器所需的版本。我可以安装 GCC 7.4(Ubuntu 18.04 的默认版本)、8.2、6.5 和 5.5,但不能安装 6.3。我尝试构建 6.3,也尝试构建 6.2,但没有成功。我总是收到以下错误提示

In file included from ../../../gcc-6.3.0/libgcc/unwind-dw2.c:401: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;
                                               ^~
/home/luis/src/build-gcc63/./gcc/xgcc -B/home/luis/src/build-gcc63/./gcc/ -B/usr/local/gcc-6.3.0/x86_64-pc-linux-gnu/bin/ -B/usr/local/gcc-6.3.0/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/gcc-6.3.0/x86_64-pc-linux-gnu/include -isystem /usr/local/gcc-6.3.0/x86_64-pc-linux-gnu/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I../../../gcc-6.3.0/libgcc -I../../../gcc-6.3.0/libgcc/. -I../../../gcc-6.3.0/libgcc/../gcc -I../../../gcc-6.3.0/libgcc/../include -I../../../gcc-6.3.0/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS  -DUSE_TLS -o _muldi3_s.o -MT _muldi3_s.o -MD -MP -MF _muldi3_s.dep -DSHARED -DL_muldi3 -c ../../../gcc-6.3.0/libgcc/libgcc2.c
../../../gcc-6.3.0/libgcc/shared-object.mk:14: recipe for target 'unwind-dw2.o' failed
make[3]: *** [unwind-dw2.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/luis/src/build-gcc63/x86_64-pc-linux-gnu/libgcc'
Makefile:19428: recipe for target 'all-stage1-target-libgcc' failed
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/home/luis/src/build-gcc63'
Makefile:23320: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/home/luis/src/build-gcc63'
Makefile:921: recipe for target 'all' failed
make: *** [all] Error 2

有人知道该怎么解决吗?谢谢。

相关内容