heimu 2020-08-02
Ubuntu20.04+GCC9.3.0(自带Python3.8.2)
git clone https://github.com/tianocore/edk2.git EDKIITest cd EDKIITest git checkout edk2-stable202005 git submodule update --init git submodule update
其中#git submodule update --init 命令执行可能会非常慢。
可以考虑编辑.gitmodules 文件如下边,使url改为gitee上的镜像仓库。
我拉的时候oniguruma上卡住,按了一下回车就顺利了,也不知道为什么。
[submodule "CryptoPkg/Library/OpensslLib/openssl"] path = CryptoPkg/Library/OpensslLib/openssl url = https://gitee.com/mirrors/openssl # url = https://github.com/openssl/openssl [submodule "SoftFloat"] path = ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 url = https://github.com/ucb-bar/berkeley-softfloat-3.git [submodule "UnitTestFrameworkPkg/Library/CmockaLib/cmocka"] path = UnitTestFrameworkPkg/Library/CmockaLib/cmocka url = https://git.cryptomilk.org/projects/cmocka.git [submodule "MdeModulePkg/Universal/RegularExpressionDxe/oniguruma"] path = MdeModulePkg/Universal/RegularExpressionDxe/oniguruma url = https://github.com/kkos/oniguruma.git [submodule "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli"] path = MdeModulePkg/Library/BrotliCustomDecompressLib/brotli url = https://gitee.com/mirrors/brotli # url = https://github.com/google/brotli [submodule "BaseTools/Source/C/BrotliCompress/brotli"] path = BaseTools/Source/C/BrotliCompress/brotli # url = https://github.com/google/brotli url = https://gitee.com/mirrors/brotli ignore = untracked
sudo apt install nasm build-essential uuid-dev iasl libghc-xll-dev gcc-multilib
libghc-x11-dev对应x11的报错
gcc-multilib 对应一个库缺失的报错
make -C BaseTools/ nano ./Conf/target.txt
将里边的TOOL_CHAIN_TAG值改为GCC5,保存,退出
source edksetup.sh build
build成功你的环境就是OK的啦
与python环境有关的,应该是make阶段遇到的,环境里没有python这个命令,直接建个软链接就好了
sudo ln -s /usr/bin/python3 /usr/bin/python
环境没有相应的库文件, fatal error: bits/libc-header-start.h: No such file or directory
安装gcc-multilib
cannot find -lxxx
寻找对应的库安装就好了
apt-cache search xxx-dev //然后安装
/usr/bin/ld: skipping incompatible..... 有二进制文件但是不匹配
参考了https://blog.csdn.net/wkq0825/article/details/80401603的文章,怀疑同样是32或者64位的问题,执行了下(第一次用要安装)
locate libXext.so |egrep ^/usr | xargs file
显示如下,果然是这个问题
/usr/lib/i386-linux-gnu/libXext.so.6: symbolic link to libXext.so.6.4.0 /usr/lib/i386-linux-gnu/libXext.so.6.4.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=72f269fa90172e6a7dfd454f3fe78410ebfc4308, stripped /usr/lib/x86_64-linux-gnu/libXext.so: symbolic link to libXext.so.6.4.0 /usr/lib/x86_64-linux-gnu/libXext.so.6: symbolic link to libXext.so.6.4.0 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=83a35a5a77775ed2b60b0ceae291841d7bedd28b, stripped
你可以看到libXext.so是指向x86_64的,而默认的build命令参数是IA32,所以新建个同名软链接指向i386就好了
如下
ln -s /usr/lib/i386-linux-gnu/libXext.so.6.4.0 /usr/lib/i386-linux-gnu/libXext.so
apt-cache madison nginx //查看仓库中可用的软件版本