Combien de temps encore 2022-04-03 23:13 采纳率: 0%
浏览 310

edk2 UDK2018 build -p edk2/EmulatorPkg/EmulatorPkg.dsc -t GCC48 -a X64 出现报错

问题遇到的现象和发生背景

环境配置完成 运行build -p edk2/EmulatorPkg/EmulatorPkg.dsc -t GCC48 -a X64

问题相关代码,请勿粘贴截图
运行结果及报错内容
Build environment: Linux-5.13.0-39-generic-x86_64-with-Ubuntu-20.04-focal
Build start time: 23:09:02, Apr.03 2022

WORKSPACE        = /opt
PACKAGES_PATH    = /opt/edk2:/opt/edk2-libc
ECP_SOURCE       = /opt/edk2/EdkCompatibilityPkg
EDK_SOURCE       = /opt/edk2/EdkCompatibilityPkg
EFI_SOURCE       = /opt/edk2/EdkCompatibilityPkg
EDK_TOOLS_PATH   = /opt/edk2/BaseTools
CONF_PATH        = /opt/edk2/Conf


Architecture(s)  = X64
Build target     = DEBUG
Toolchain        = GCC5

Active Platform          = /opt/edk2/EmulatorPkg/EmulatorPkg.dsc
Flash Image Definition   = /opt/edk2/EmulatorPkg/EmulatorPkg.fdf

Processing meta-data .. done!
Building ... /opt/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf [X64]
Building ... /opt/edk2/MdePkg/Library/BaseLib/BaseLib.inf [X64]
make: 对“tbuild”无需做任何事。
Building ... /opt/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf [X64]
Trim --asm-file -o /opt/Build/Emulator/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.i -i /opt/Build/Emulator/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/inc.lst /opt/edk2/MdePkg/Library/BaseLib/X64/Thunk16.nasm
Building ... /opt/edk2/EmulatorPkg/Library/SecPpiListLib/SecPpiListLib.inf [X64]
Usage: Trim.py [-s|-r|-a|--Vfr-Uni-Offset] [-c] [-v|-d <debug_level>|-q] [-i <include_path_file>] [-o <output_file>] [--ModuleName <ModuleName>] [--DebugDir <DebugDir>] [<input_file>]

Trim.py: error: no such option: --asm-file
Building ... /opt/edk2/EmulatorPkg/Library/SecPeiServicesLib/SecPeiServicesLib.inf [X64]
make: *** [GNUmakefile:412/opt/Build/Emulator/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.obj] 错误 2
make: 对“tbuild”无需做任何事。


build.py...
 : error 7000: Failed to execute command
        make tbuild [/opt/Build/Emulator/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib]


build.py...
 : error F002: Failed to build module
        /opt/edk2/MdePkg/Library/BaseLib/BaseLib.inf [X64, GCC5, DEBUG]

- Failed -
Build end time: 23:09:04, Apr.03 2022
Build total time: 00:00:02

我的解答思路和尝试过的方法

pip install brotli
sudo apt install build-essential uuid-dev
sudo apt install acpica-tools
环境都按照了,网上说出现这个错误需要下载这些,但是依然报错

我想要达到的结果
  • 写回答

3条回答 默认 最新

  • luobing4365 2022-04-09 16:14
    关注

    1 我一直是在ubuntu 16上搭建x86环境,因为用得比较少。更多的时候,是在windows10上用VS搭建的。Ubuntu 20我没有去试过,因为不想被各种编译器版本的问题缠着;

    2 tianocore社区这块,写搭建环境的部分,不是特别好。我现在开发arm的环境,是在ubuntu 18上的,可以参考:
    https://developer.arm.com/tools-and-software/open-source-software/firmware/edkii-uefi-firmware/building-edkii-uefi-firmware-for-arm-platforms
    对在ubuntu 20上搭建可能会有所帮助(主要看前面工具部分);
    brotli通过git更新submodules实现的,不用安装;acpi工具需要重新编译。

    3 拷贝我之前的笔记,看看是否有帮助(ubuntu 16上安装的)

    1.2 准备EDK2,edk2-libc,edk-platform
     准备工具:bash$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm python3-distutils
     实际上还缺一些:sudo apt install bison build-essential flex git uuid-dev  python3-distutils
    ( python3-distutils-extra)
      git clone git@gitee.com:luobing4365/edk2-libc.git
      git clone git@gitee.com:luobing4365/acpica.git
      git clone --branch edk2-stable202108 git@gitee.com:luobing4365/edk2.git
    
    1.2.1 edk2的submodule处理
      修改地址为自己的(.gitmodule):
    [submodule "CryptoPkg/Library/OpensslLib/openssl"]
            path = CryptoPkg/Library/OpensslLib/openssl
            url = https://gitee.com/luobing4365/openssl.git
    [submodule "SoftFloat"]
            path = ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
            url = https://gitee.com/luobing4365/berkeley-softfloat-3.git
    [submodule "UnitTestFrameworkPkg/Library/CmockaLib/cmocka"]
            path = UnitTestFrameworkPkg/Library/CmockaLib/cmocka
            url = https://gitee.com/luobing4365/cmocka.git
    [submodule "MdeModulePkg/Universal/RegularExpressionDxe/oniguruma"]
            path = MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
            url = https://gitee.com/luobing4365/oniguruma.git
    [submodule "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli"]
            path = MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
            url = https://gitee.com/luobing4365/brotli.git
    [submodule "BaseTools/Source/C/BrotliCompress/brotli"]
            path = BaseTools/Source/C/BrotliCompress/brotli
            url = https://gitee.com/luobing4365/brotli.git
            ignore = untracked
    [submodule "RedfishPkg/Library/JsonLib/jansson"]
            path = RedfishPkg/Library/JsonLib/jansson
            url = https://gitee.com/luobing4365/jansson.git
    进入edk2,git submodule update --init 
    
    1.2.2  编译acpica 
        export WORKSPACE=$PWD
        make -C $WORKSPACE/acpica 
    
    1.2.3 工作路径和平台路径
      新建myexport.sh,填入以下内容:
      export WORKSPACE=$PWD
      export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-libc
      export IASL_PREFIX=$PWD/acpica/generate/unix/bin/
      export PYTHON_COMMAND=/usr/bin/python3
    
    1.2.4 编译基本工具 
      
    robin@robin-VirtualBox:~/jmuefi$ source ./myexport.sh 
    robin@robin-VirtualBox:~/jmuefi$ cd edk2/
    robin@robin-VirtualBox:~/jmuefi/edk2$ make -C BaseTools/
    
    1.2.5 编译EmulatorPkg
    robin@robin-VirtualBox:~/jmuefi$ source ./myexport.sh
    robin@robin-VirtualBox:~/jmuefi$ cd edk2/
    robin@robin-VirtualBox:~/jmuefi/edk2$. edksetup.sh
    修改Conf/target.txt
    GCC5 X64
    robin@robin-VirtualBox:~/jmuefi/edk2$ build –D ADD_SHELL_STRING
    (stable201108的模拟器Host好像无法运行)
    
    1.2.6 一些可能的错误:
       A: 缺少sys/cdefs.h    sudo apt install libc6-dev-i386
       B 缺少X11/Xlib.h  $sudo apt-get install libx11-dev libx11-dev:i386
       C 缺少X11/extensions /XShm.h    sudo apt-get install libxext-dev libxext-dev:i386
    
    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 4月3日

悬赏问题

  • ¥15 根据会员信息表绘制堆积柱状图
  • ¥100 华为手机私有App后台保活
  • ¥20 有谁能看看我coe文件到底哪儿有问题吗?
  • ¥20 我的这个coe文件到底哪儿出问题了
  • ¥15 matlab使用自定义函数时一直报错输入参数过多
  • ¥15 设计一个温度闭环控制系统
  • ¥100 rtmpose姿态评估
  • ¥15 java 通过反射找路径下的类,打包后就找不到
  • ¥15 通联支付网上收银统一下单接口
  • ¥15 angular有偿编写,