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2.0/8.3.0/9.1.0/9.2.0/9.3.0 |
SUSE SLES15.1 |
GCC 7.4.0/8.1.0/8.2.0/8.3.0/9.1.0/9.2.0/9.3.0 |
Ubuntu 18.04.x |
GCC 7.3.0/7.4.0/8.1.0/8.2.0/8.3.0/9.1.0/9.2.0/9.3.0 |
Ubuntu 20.04.x |
GCC 9.3.0 |
UOS 20 SP1 |
GCC 8.3.0/9.1.0/9.2.0/9.3.0 |
uosEuler 20 |
GCC 7.3.0/7.4.0/8.1.0/8.2.0/8.3.0/9.1.0/9.2.0/9.3.0 |
UOS 20-1020e |
GCC 7.3.0/7.4.0/8.1.0/8.2.0/8.3.0/9.1.0/9.2.0/9.3.0 |
使用该功能需要配置对应的环境,可以通过以下步骤进行:
1 | tar xf gcctool.tar.gz |
解压后确认“gcctool/bin”目录下有以下文件:
gcctool,gcctool-bin,libstdc++.so.6
如果提示“‘patch’command not found”,则请先安装:
Debian系列:
1 | apt install patch |
RHEL系列:
1 | yum install patch |
1 2 | cd /gcc/source/root/dir patch -p1 < /path/to/gcc/patch/file |
GCC源码编译操作请参考GCC官方文档,合入的patch对GCC编译依赖组件和编译过程没有影响,任何GCC编译问题可以询问GNU社区。
准备好环境之后再执行以下步骤使用工具:
1 | export HW_DEBUG=[ 0 | 1 | 2 ] |
编译组件支持通过环境变量配置修复优化模式,默认级别为0。
不设置该环境变量表示关闭内存一致性修复功能,不会做任何修复相关的操作。
若用户需使用内存一致性修复组件优化,请自行设置优化模式。
以下为允许列表的格式示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 | files: /path/to/file/a /path/to/./file/b /path/to/../file/c /path/to/file/d functions: func_a func_b() func_c(int xxx) int func_d() classA::func_e ns::classB::func_f() std::string nsA::nsB::classC::func_g(int xxx) |
“export AUTOFIXLIST=/path/to/allowlist”
用户可以编译软件,编译过程没有变化。
之前的编译过程中如果使用了-pipe编译选项,需要移除,不会影响原编译结果。