编译环境 阿里云ubuntu20.04
编译步骤:
1 下载elfutils-0.170源码
2 解压
3 按照elfutils-0.170 (linuxfromscratch.org)
的描述,首先
./configure --prefix=/usr --program-prefix="eu-"
4 make
此时发生一个问题,报错:
error: ‘__elf64_msize’ specifies less restrictive attribute than its target ‘elf64_fsize’: ‘const’ [-Werror=missing-attributes]
5 根据linux - #pragma GCC diagnostic ignored "-Wmissing-attributes" does not work - Stack Overflow
的描述,执行以下命令:
sed -i 's/-Werror//g' $(find . -type f -exec egrep -l _no_Werror {} \;)
6 再执行一遍make
7 sudo make install 安装完毕