切换GCC编译器版本

当前版本信息
root@ubuntu:runninglinuxkernel_4.0# aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/7/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v
.............................
gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)


切换GCC版本为5.5
查看gcc信息
root@ubuntu:runninglinuxkernel_4.0# update-alternatives --query  aarch64-linux-gnu-gcc
Name: aarch64-linux-gnu-gcc
Link: /usr/bin/aarch64-linux-gnu-gcc
Status: auto
Best: /usr/bin/aarch64-linux-gnu-gcc-5
Value: /usr/bin/aarch64-linux-gnu-gcc-5

Alternative: /usr/bin/aarch64-linux-gnu-gcc-5
Priority: 5



切换版本
root@ubuntu:runninglinuxkernel_4.0# update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc  aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-5 100


验证版本是否切换成功
root@ubuntu:runninglinuxkernel_4.0# aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/5/lto-wrapper
Target: aarch64-linux-gnu
..................................
gcc version 5.5.0 20171010 (Ubuntu/Linaro 5.5.0-12ubuntu1)

posted @ 2019-08-29 16:34  MKY-门可意  阅读(1828)  评论(0编辑  收藏  举报