UEFI的编译原理

整个UEFI的开发和编译是在x86的服务器下安装centeros的系统下进行的。

所需要的工具:

(1)UEFI源代码,以及添加了自己平台架构下的代码,UEFI的代码可以到UEFI官网下载

(2)编译工具,我们采用的是交叉编译,编译工具是使用的是龙芯平台MIPS架构的编译工具(gcc-4.4.0-pmon)安装在系统的opt目录下

(3)运行二进制文件的宿主机,这里是龙芯自己的机器3a300+7a平台

编译UEFI的代码主要分为以下三个阶段:

(1)编译编译代码的编译工具

(2)配置编译环境

(3)运行编译命令开始编译代码

(1)编译编译代码所使用的编译工具:

下载完代码之后,进入BaseTool目录,目前官网还不支持对MIPS分之的支持,我们在编译工具的源码中添加了MIPS分之的支持,这里面很复杂,涉及到C和Python的代码,这些代码主要位于BaseTools/Source文件夹下,如何添加这里不做详细的介绍,只需要懂得在编译工具的代码上添加了MIPS的分之之后,编译出来的编译工具,就可以编译MIPS架构的代码了。

如何编译编译工具:

进入BaseTool目录下,使用 make 命令开始编译,编译log如下

make -C Source/C
Attempting to detect HOST_ARCH from 'uname -m': x86_64
Detected HOST_ARCH of X64 using uname.
make[1]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C”
mkdir -p .
mkdir ./libs 
make -C Common
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/Common”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 BasePeCoff.c -o BasePeCoff.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 BinderFuncs.c -o BinderFuncs.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 CommonLib.c -o CommonLib.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Crc32.c -o Crc32.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Decompress.c -o Decompress.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 EfiCompress.c -o EfiCompress.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 EfiUtilityMsgs.c -o EfiUtilityMsgs.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 FirmwareVolumeBuffer.c -o FirmwareVolumeBuffer.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 FvLib.c -o FvLib.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 MemoryFile.c -o MemoryFile.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 MyAlloc.c -o MyAlloc.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 OsPath.c -o OsPath.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 ParseGuidedSectionTools.c -o ParseGuidedSectionTools.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 ParseInf.c -o ParseInf.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 PeCoffLoaderEx.c -o PeCoffLoaderEx.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 SimpleFileParsing.c -o SimpleFileParsing.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 StringFuncs.c -o StringFuncs.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 TianoCompress.c -o TianoCompress.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 PcdValueCommon.c -o PcdValueCommon.o
ar crs ../libs/libCommon.a BasePeCoff.o BinderFuncs.o CommonLib.o Crc32.o Decompress.o EfiCompress.o EfiUtilityMsgs.o FirmwareVolumeBuffer.o FvLib.o MemoryFile.o MyAlloc.o OsPath.o ParseGuidedSectionTools.o ParseInf.o PeCoffLoaderEx.o SimpleFileParsing.o StringFuncs.o TianoCompress.o PcdValueCommon.o
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/Common”
mkdir ./bin
make -C VfrCompile VfrLexer.h
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile”
BIN_DIR='.' make -C Pccts/dlg
make[3]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile/Pccts/dlg”
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -c dlg_p.c
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -c dlg_a.c
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -c main.c
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  err.c -o err.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 ../support/set/set.c
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  support.c -o support.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  output.c -o output.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  relabel.c -o relabel.o
cc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536  automata.c -o automata.o
cc -O -I. -I../support/set -I../h -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -o ./dlg dlg_p.o dlg_a.o main.o err.o set.o support.o output.o relabel.o automata.o
make[3]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile/Pccts/dlg”
BIN_DIR='.' make -C Pccts/antlr
make[3]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile/Pccts/antlr”
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  antlr.c -o antlr.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  scan.c -o scan.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  err.c -o err.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  bits.c -o bits.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  build.c -o build.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  fset2.c -o fset2.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  fset.c -o fset.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  gen.c -o gen.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  globals.c -o globals.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  hash.c -o hash.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  lex.c -o lex.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  main.c -o main.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  misc.c -o misc.o
gcc -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536 -c -o set.o ../support/set/set.c
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  pred.c -o pred.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  egman.c -o egman.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  mrhoist.c -o mrhoist.o
gcc -c -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536  fcache.c -o fcache.o
gcc -O -I. -I../support/set -I../h -DUSER_ZZSYN  -DZZLEXBUFSIZE=65536 -o ./antlr antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o
make[3]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile/Pccts/antlr”
Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
Antlr parser generator   Version 1.33MR33   1989-2001
VfrSyntax.g, line 2018: warning: predicate: LT(i) missing, bad, or with i=0; assuming i=1
VfrSyntax.g, line 2023: warning: predicate: LT(i) missing, bad, or with i=0; assuming i=1
VfrSyntax.g, line 3651: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3660: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3669: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3679: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3709: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
VfrSyntax.g, line 3718: warning: alts 1 and 2 of {..} ambiguous upon ( ";" RefreshGuid GuidOp Locked Image EndIf InconsistentIf DisableIf SuppressIf Default GrayOutIf )
Pccts/dlg/dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
dlg  Version 1.33MR33   1989-2001

make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile”
make -C BrotliCompress
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/BrotliCompress”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 tools/bro.c -o tools/bro.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 common/dictionary.c -o common/dictionary.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 dec/bit_reader.c -o dec/bit_reader.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 dec/decode.c -o dec/decode.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 dec/huffman.c -o dec/huffman.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 dec/state.c -o dec/state.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/backward_references.c -o enc/backward_references.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/bit_cost.c -o enc/bit_cost.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/block_splitter.c -o enc/block_splitter.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/brotli_bit_stream.c -o enc/brotli_bit_stream.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/cluster.c -o enc/cluster.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/compress_fragment.c -o enc/compress_fragment.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/compress_fragment_two_pass.c -o enc/compress_fragment_two_pass.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/encode.c -o enc/encode.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/entropy_encode.c -o enc/entropy_encode.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/histogram.c -o enc/histogram.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/literal_cost.c -o enc/literal_cost.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/memory.c -o enc/memory.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/metablock.c -o enc/metablock.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/static_dict.c -o enc/static_dict.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 enc/utf8_util.c -o enc/utf8_util.o
gcc -o ../bin/Brotli  tools/bro.o common/dictionary.o dec/bit_reader.o dec/decode.o dec/huffman.o dec/state.o enc/backward_references.o enc/bit_cost.o enc/block_splitter.o enc/brotli_bit_stream.o enc/cluster.o enc/compress_fragment.o enc/compress_fragment_two_pass.o enc/encode.o enc/entropy_encode.o enc/histogram.o enc/literal_cost.o enc/memory.o enc/metablock.o enc/static_dict.o enc/utf8_util.o -L../libs -lm
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/BrotliCompress”
make -C VfrCompile
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile”
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2  Pccts/h/AParser.cpp -o AParser.o
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2  Pccts/h/DLexerBase.cpp -o DLexerBase.o
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2  Pccts/h/ATokenBuffer.cpp -o ATokenBuffer.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 -Wno-unused-result EfiVfrParser.cpp -o EfiVfrParser.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 -Wno-unused-result VfrLexer.cpp -o VfrLexer.o
g++ -c -DPCCTS_USE_NAMESPACE_STD -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2  VfrSyntax.cpp -o VfrSyntax.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 -Wno-unused-result VfrFormPkg.cpp -o VfrFormPkg.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 -Wno-unused-result VfrError.cpp -o VfrError.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 -Wno-unused-result VfrUtilityLib.cpp -o VfrUtilityLib.o
g++ -c -I Pccts/h -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 -Wno-unused-result VfrCompiler.cpp -o VfrCompiler.o
g++ -o ../bin/VfrCompile  AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VfrCompile”
make -C GnuGenBootSector
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GnuGenBootSector”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GnuGenBootSector.c -o GnuGenBootSector.o
gcc -o ../bin/GnuGenBootSector  GnuGenBootSector.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GnuGenBootSector”
make -C BootSectImage
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/BootSectImage”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 bootsectimage.c -o bootsectimage.o
gcc -o ../bin/BootSectImage  bootsectimage.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/BootSectImage”
make -C EfiLdrImage
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/EfiLdrImage”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 EfiLdrImage.c -o EfiLdrImage.o
gcc -o ../bin/EfiLdrImage  EfiLdrImage.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/EfiLdrImage”
make -C EfiRom
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/EfiRom”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 EfiRom.c -o EfiRom.o
gcc -o ../bin/EfiRom  EfiRom.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/EfiRom”
make -C GenFfs
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenFfs”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenFfs.c -o GenFfs.o
gcc -o ../bin/GenFfs  GenFfs.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenFfs”
make -C GenFv
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenFv”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenFv.c -o GenFv.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenFvInternalLib.c -o GenFvInternalLib.o
gcc -o ../bin/GenFv  GenFv.o GenFvInternalLib.o -L../libs -lCommon -luuid
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenFv”
make -C GenFw
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenFw”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenFw.c -o GenFw.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 ElfConvert.c -o ElfConvert.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Elf32Convert.c -o Elf32Convert.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Elf64Convert.c -o Elf64Convert.o
gcc -o ../bin/GenFw  GenFw.o ElfConvert.o Elf32Convert.o Elf64Convert.o -L../libs -lCommon -luuid
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenFw”
make -C GenPage
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenPage”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenPage.c -o GenPage.o
gcc -o ../bin/GenPage  GenPage.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenPage”
make -C GenSec
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenSec”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenSec.c -o GenSec.o
gcc -o ../bin/GenSec  GenSec.o -L../libs -lCommon -luuid
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenSec”
make -C GenCrc32
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenCrc32”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenCrc32.c -o GenCrc32.o
gcc -o ../bin/GenCrc32  GenCrc32.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenCrc32”
make -C GenVtf
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenVtf”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 GenVtf.c -o GenVtf.o
gcc -o ../bin/GenVtf  GenVtf.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/GenVtf”
make -C LzmaCompress
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/LzmaCompress”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 LzmaCompress.c -o LzmaCompress.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/Alloc.c -o Sdk/C/Alloc.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/LzFind.c -o Sdk/C/LzFind.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/LzmaDec.c -o Sdk/C/LzmaDec.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/LzmaEnc.c -o Sdk/C/LzmaEnc.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/7zFile.c -o Sdk/C/7zFile.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/7zStream.c -o Sdk/C/7zStream.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g -D_7ZIP_ST  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Sdk/C/Bra86.c -o Sdk/C/Bra86.o
gcc -o ../bin/LzmaCompress  LzmaCompress.o Sdk/C/Alloc.o Sdk/C/LzFind.o Sdk/C/LzmaDec.o Sdk/C/LzmaEnc.o Sdk/C/7zFile.o Sdk/C/7zStream.o Sdk/C/Bra86.o -L../libs 
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/LzmaCompress”
make -C Split
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/Split”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 Split.c -o Split.o
gcc -o ../bin/Split  Split.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/Split”
make -C TianoCompress
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/TianoCompress”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 TianoCompress.c -o TianoCompress.o
gcc -o ../bin/TianoCompress  TianoCompress.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/TianoCompress”
make -C VolInfo
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VolInfo”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 VolInfo.c -o VolInfo.o
gcc -o ../bin/VolInfo  VolInfo.o -L../libs -lCommon
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/VolInfo”
make -C DevicePath
make[2]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/DevicePath”
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 DevicePath.c -o DevicePath.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 UefiDevicePathLib.c -o UefiDevicePathLib.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 DevicePathFromText.c -o DevicePathFromText.o
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 DevicePathUtilities.c -o DevicePathUtilities.o
gcc -o ../bin/DevicePath  DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtilities.o -L../libs -lCommon -luuid
make[2]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C/DevicePath”
Finished building BaseTools C Tools with HOST_ARCH=X64
make[1]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/C”
make -C Source/Python
make[1]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/Python”
make[1]: 对“all”无需做任何事。
make[1]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Source/Python”
make -C Tests
make[1]: 进入目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Tests”
testHelp (TianoCompress.Tests) ... ok
testRandomDataCycles (TianoCompress.Tests) ... ok
test_AutoGen_AutoGen (CheckPythonSyntax.Tests) ... ok
test_AutoGen_BuildEngine (CheckPythonSyntax.Tests) ... ok
test_AutoGen_GenC (CheckPythonSyntax.Tests) ... ok
test_AutoGen_GenDepex (CheckPythonSyntax.Tests) ... ok
test_AutoGen_GenMake (CheckPythonSyntax.Tests) ... ok
test_AutoGen_GenPcdDb (CheckPythonSyntax.Tests) ... ok
test_AutoGen_GenVar (CheckPythonSyntax.Tests) ... ok
test_AutoGen_IdfClassObject (CheckPythonSyntax.Tests) ... ok
test_AutoGen_InfSectionParser (CheckPythonSyntax.Tests) ... ok
test_AutoGen_StrGather (CheckPythonSyntax.Tests) ... ok
test_AutoGen_UniClassObject (CheckPythonSyntax.Tests) ... ok
test_AutoGen_ValidCheckingInfoObject (CheckPythonSyntax.Tests) ... ok
test_AutoGen___init__ (CheckPythonSyntax.Tests) ... ok
test_BPDG_BPDG (CheckPythonSyntax.Tests) ... ok
test_BPDG_GenVpd (CheckPythonSyntax.Tests) ... ok
test_BPDG_StringTable (CheckPythonSyntax.Tests) ... ok
test_BPDG___init__ (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_CommonClass (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_DataClass (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_Exceptions (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_FdfClass (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_ModuleClass (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_PackageClass (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass_PlatformClass (CheckPythonSyntax.Tests) ... ok
test_CommonDataClass___init__ (CheckPythonSyntax.Tests) ... ok
test_Common_BuildToolError (CheckPythonSyntax.Tests) ... ok
test_Common_BuildVersion (CheckPythonSyntax.Tests) ... ok
test_Common_DataType (CheckPythonSyntax.Tests) ... ok
test_Common_Database (CheckPythonSyntax.Tests) ... ok
test_Common_DecClassObject (CheckPythonSyntax.Tests) ... ok
test_Common_Dictionary (CheckPythonSyntax.Tests) ... ok
test_Common_DscClassObject (CheckPythonSyntax.Tests) ... ok
test_Common_EdkIIWorkspace (CheckPythonSyntax.Tests) ... ok
test_Common_EdkIIWorkspaceBuild (CheckPythonSyntax.Tests) ... ok
test_Common_EdkLogger (CheckPythonSyntax.Tests) ... ok
test_Common_Expression (CheckPythonSyntax.Tests) ... ok
test_Common_FdfClassObject (CheckPythonSyntax.Tests) ... ok
test_Common_FdfParserLite (CheckPythonSyntax.Tests) ... ok
test_Common_GlobalData (CheckPythonSyntax.Tests) ... ok
test_Common_Identification (CheckPythonSyntax.Tests) ... ok
test_Common_InfClassObject (CheckPythonSyntax.Tests) ... ok
test_Common_LongFilePathOs (CheckPythonSyntax.Tests) ... ok
test_Common_LongFilePathOsPath (CheckPythonSyntax.Tests) ... ok
test_Common_LongFilePathSupport (CheckPythonSyntax.Tests) ... ok
test_Common_MigrationUtilities (CheckPythonSyntax.Tests) ... ok
test_Common_Misc (CheckPythonSyntax.Tests) ... ok
test_Common_MultipleWorkspace (CheckPythonSyntax.Tests) ... ok
test_Common_Parsing (CheckPythonSyntax.Tests) ... ok
test_Common_RangeExpression (CheckPythonSyntax.Tests) ... ok
test_Common_String (CheckPythonSyntax.Tests) ... ok
test_Common_TargetTxtClassObject (CheckPythonSyntax.Tests) ... ok
test_Common_ToolDefClassObject (CheckPythonSyntax.Tests) ... ok
test_Common_VariableAttributes (CheckPythonSyntax.Tests) ... ok
test_Common_VpdInfoFile (CheckPythonSyntax.Tests) ... ok
test_Common___init__ (CheckPythonSyntax.Tests) ... ok
test_Ecc_CLexer (CheckPythonSyntax.Tests) ... ok
test_Ecc_CParser (CheckPythonSyntax.Tests) ... ok
test_Ecc_Check (CheckPythonSyntax.Tests) ... ok
test_Ecc_CodeFragment (CheckPythonSyntax.Tests) ... ok
test_Ecc_CodeFragmentCollector (CheckPythonSyntax.Tests) ... ok
test_Ecc_Configuration (CheckPythonSyntax.Tests) ... ok
test_Ecc_Database (CheckPythonSyntax.Tests) ... ok
test_Ecc_Ecc (CheckPythonSyntax.Tests) ... ok
test_Ecc_EccGlobalData (CheckPythonSyntax.Tests) ... ok
test_Ecc_EccToolError (CheckPythonSyntax.Tests) ... ok
test_Ecc_Exception (CheckPythonSyntax.Tests) ... ok
test_Ecc_FileProfile (CheckPythonSyntax.Tests) ... ok
test_Ecc_MetaDataParser (CheckPythonSyntax.Tests) ... ok
test_Ecc_MetaFileWorkspace_MetaDataTable (CheckPythonSyntax.Tests) ... ok
test_Ecc_MetaFileWorkspace_MetaFileParser (CheckPythonSyntax.Tests) ... ok
test_Ecc_MetaFileWorkspace_MetaFileTable (CheckPythonSyntax.Tests) ... ok
test_Ecc_MetaFileWorkspace___init__ (CheckPythonSyntax.Tests) ... ok
test_Ecc_ParserWarning (CheckPythonSyntax.Tests) ... ok
test_Ecc_Xml_XmlRoutines (CheckPythonSyntax.Tests) ... ok
test_Ecc_Xml___init__ (CheckPythonSyntax.Tests) ... ok
test_Ecc___init__ (CheckPythonSyntax.Tests) ... ok
test_Ecc_c (CheckPythonSyntax.Tests) ... ok
test_Eot_CLexer (CheckPythonSyntax.Tests) ... ok
test_Eot_CParser (CheckPythonSyntax.Tests) ... ok
test_Eot_CodeFragment (CheckPythonSyntax.Tests) ... ok
test_Eot_CodeFragmentCollector (CheckPythonSyntax.Tests) ... ok
test_Eot_Database (CheckPythonSyntax.Tests) ... ok
test_Eot_Eot (CheckPythonSyntax.Tests) ... ok
test_Eot_EotGlobalData (CheckPythonSyntax.Tests) ... ok
test_Eot_EotToolError (CheckPythonSyntax.Tests) ... ok
test_Eot_FileProfile (CheckPythonSyntax.Tests) ... ok
test_Eot_FvImage (CheckPythonSyntax.Tests) ... ok
test_Eot_InfParserLite (CheckPythonSyntax.Tests) ... ok
test_Eot_Parser (CheckPythonSyntax.Tests) ... ok
test_Eot_ParserWarning (CheckPythonSyntax.Tests) ... ok
test_Eot_Report (CheckPythonSyntax.Tests) ... ok
test_Eot___init__ (CheckPythonSyntax.Tests) ... ok
test_Eot_c (CheckPythonSyntax.Tests) ... ok
test_GenFds_AprioriSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_Attribute (CheckPythonSyntax.Tests) ... ok
test_GenFds_Capsule (CheckPythonSyntax.Tests) ... ok
test_GenFds_CapsuleData (CheckPythonSyntax.Tests) ... ok
test_GenFds_ComponentStatement (CheckPythonSyntax.Tests) ... ok
test_GenFds_CompressSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_DataSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_DepexSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_EfiSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_Fd (CheckPythonSyntax.Tests) ... ok
test_GenFds_FdfParser (CheckPythonSyntax.Tests) ... ok
test_GenFds_Ffs (CheckPythonSyntax.Tests) ... ok
test_GenFds_FfsFileStatement (CheckPythonSyntax.Tests) ... ok
test_GenFds_FfsInfStatement (CheckPythonSyntax.Tests) ... ok
test_GenFds_Fv (CheckPythonSyntax.Tests) ... ok
test_GenFds_FvImageSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_GenFds (CheckPythonSyntax.Tests) ... ok
test_GenFds_GenFdsGlobalVariable (CheckPythonSyntax.Tests) ... ok
test_GenFds_GuidSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_OptRomFileStatement (CheckPythonSyntax.Tests) ... ok
test_GenFds_OptRomInfStatement (CheckPythonSyntax.Tests) ... ok
test_GenFds_OptionRom (CheckPythonSyntax.Tests) ... ok
test_GenFds_Region (CheckPythonSyntax.Tests) ... ok
test_GenFds_Rule (CheckPythonSyntax.Tests) ... ok
test_GenFds_RuleComplexFile (CheckPythonSyntax.Tests) ... ok
test_GenFds_RuleSimpleFile (CheckPythonSyntax.Tests) ... ok
test_GenFds_Section (CheckPythonSyntax.Tests) ... ok
test_GenFds_UiSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_VerSection (CheckPythonSyntax.Tests) ... ok
test_GenFds_Vtf (CheckPythonSyntax.Tests) ... ok
test_GenFds___init__ (CheckPythonSyntax.Tests) ... ok
test_GenPatchPcdTable_GenPatchPcdTable (CheckPythonSyntax.Tests) ... ok
test_GenPatchPcdTable___init__ (CheckPythonSyntax.Tests) ... ok
test_PatchPcdValue_PatchPcdValue (CheckPythonSyntax.Tests) ... ok
test_PatchPcdValue___init__ (CheckPythonSyntax.Tests) ... ok
test_Pkcs7Sign_Pkcs7Sign (CheckPythonSyntax.Tests) ... ok
test_Rsa2048Sha256Sign_Rsa2048Sha256GenerateKeys (CheckPythonSyntax.Tests) ... ok
test_Rsa2048Sha256Sign_Rsa2048Sha256Sign (CheckPythonSyntax.Tests) ... ok
test_Table_Table (CheckPythonSyntax.Tests) ... ok
test_Table_TableDataModel (CheckPythonSyntax.Tests) ... ok
test_Table_TableDec (CheckPythonSyntax.Tests) ... ok
test_Table_TableDsc (CheckPythonSyntax.Tests) ... ok
test_Table_TableEotReport (CheckPythonSyntax.Tests) ... ok
test_Table_TableFdf (CheckPythonSyntax.Tests) ... ok
test_Table_TableFile (CheckPythonSyntax.Tests) ... ok
test_Table_TableFunction (CheckPythonSyntax.Tests) ... ok
test_Table_TableIdentifier (CheckPythonSyntax.Tests) ... ok
test_Table_TableInf (CheckPythonSyntax.Tests) ... ok
test_Table_TablePcd (CheckPythonSyntax.Tests) ... ok
test_Table_TableQuery (CheckPythonSyntax.Tests) ... ok
test_Table_TableReport (CheckPythonSyntax.Tests) ... ok
test_Table___init__ (CheckPythonSyntax.Tests) ... ok
test_TargetTool_TargetTool (CheckPythonSyntax.Tests) ... ok
test_TargetTool___init__ (CheckPythonSyntax.Tests) ... ok
test_Trim_Trim (CheckPythonSyntax.Tests) ... ok
test_UPT_BuildVersion (CheckPythonSyntax.Tests) ... ok
test_UPT_Core_DependencyRules (CheckPythonSyntax.Tests) ... ok
test_UPT_Core_DistributionPackageClass (CheckPythonSyntax.Tests) ... ok
test_UPT_Core_FileHook (CheckPythonSyntax.Tests) ... ok
test_UPT_Core_IpiDb (CheckPythonSyntax.Tests) ... ok
test_UPT_Core_PackageFile (CheckPythonSyntax.Tests) ... ok
test_UPT_Core___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_GenMetaFile_GenDecFile (CheckPythonSyntax.Tests) ... ok
test_UPT_GenMetaFile_GenInfFile (CheckPythonSyntax.Tests) ... ok
test_UPT_GenMetaFile_GenMetaFileMisc (CheckPythonSyntax.Tests) ... ok
test_UPT_GenMetaFile_GenXmlFile (CheckPythonSyntax.Tests) ... ok
test_UPT_GenMetaFile___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_InstallPkg (CheckPythonSyntax.Tests) ... ok
test_UPT_InventoryWs (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_CommentGenerating (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_CommentParsing (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_DataType (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_ExpressionValidate (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_GlobalData (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_Misc (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_ParserValidate (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_Parsing (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_String (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_UniClassObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_Xml_XmlRoutines (CheckPythonSyntax.Tests) ... ok
test_UPT_Library_Xml___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_Library___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_Logger_Log (CheckPythonSyntax.Tests) ... ok
test_UPT_Logger_StringTable (CheckPythonSyntax.Tests) ... ok
test_UPT_Logger_ToolError (CheckPythonSyntax.Tests) ... ok
test_UPT_Logger___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_MkPkg (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_POM_CommonObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_POM_ModuleObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_POM_PackageObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_POM___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_DecObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfBinaryObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfBuildOptionObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfCommonObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfDefineCommonObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfDefineObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfDepexObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfGuidObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfHeaderObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfLibraryClassesObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfMisc (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfPackagesObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfPcdObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfPpiObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfProtocolObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfSoucesObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser_InfUserExtensionObject (CheckPythonSyntax.Tests) ... ok
test_UPT_Object_Parser___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_Object___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_DecParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_DecParserMisc (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfAsBuiltProcess (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfBinarySectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfBuildOptionSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfDefineSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfDepexSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfGuidPpiProtocolSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfLibrarySectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfPackageSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfParserMisc (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfPcdSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser_InfSourceSectionParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Parser___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_PomAdapter_DecPomAlignment (CheckPythonSyntax.Tests) ... ok
test_UPT_PomAdapter_InfPomAlignment (CheckPythonSyntax.Tests) ... ok
test_UPT_PomAdapter_InfPomAlignmentMisc (CheckPythonSyntax.Tests) ... ok
test_UPT_PomAdapter___init__ (CheckPythonSyntax.Tests) ... ok
test_UPT_ReplacePkg (CheckPythonSyntax.Tests) ... ok
test_UPT_RmPkg (CheckPythonSyntax.Tests) ... ok
test_UPT_TestInstall (CheckPythonSyntax.Tests) ... ok
test_UPT_UPT (CheckPythonSyntax.Tests) ... ok
test_UPT_UnitTest_CommentGeneratingUnitTest (CheckPythonSyntax.Tests) ... ok
test_UPT_UnitTest_CommentParsingUnitTest (CheckPythonSyntax.Tests) ... ok
test_UPT_UnitTest_DecParserTest (CheckPythonSyntax.Tests) ... ok
test_UPT_UnitTest_DecParserUnitTest (CheckPythonSyntax.Tests) ... ok
test_UPT_UnitTest_InfBinarySectionTest (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_CommonXml (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_GuidProtocolPpiXml (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_IniToXml (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_ModuleSurfaceAreaXml (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_PackageSurfaceAreaXml (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_PcdXml (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_XmlParser (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml_XmlParserMisc (CheckPythonSyntax.Tests) ... ok
test_UPT_Xml___init__ (CheckPythonSyntax.Tests) ... ok
test_Workspace_BuildClassObject (CheckPythonSyntax.Tests) ... ok
test_Workspace_DecBuildData (CheckPythonSyntax.Tests) ... ok
test_Workspace_DscBuildData (CheckPythonSyntax.Tests) ... ok
test_Workspace_InfBuildData (CheckPythonSyntax.Tests) ... ok
test_Workspace_MetaDataTable (CheckPythonSyntax.Tests) ... ok
test_Workspace_MetaFileCommentParser (CheckPythonSyntax.Tests) ... ok
test_Workspace_MetaFileParser (CheckPythonSyntax.Tests) ... ok
test_Workspace_MetaFileTable (CheckPythonSyntax.Tests) ... ok
test_Workspace_WorkspaceCommon (CheckPythonSyntax.Tests) ... ok
test_Workspace_WorkspaceDatabase (CheckPythonSyntax.Tests) ... ok
test_Workspace___init__ (CheckPythonSyntax.Tests) ... ok
test_build_BuildReport (CheckPythonSyntax.Tests) ... ok
test_build___init__ (CheckPythonSyntax.Tests) ... ok
test_build_build (CheckPythonSyntax.Tests) ... ok
test_sitecustomize (CheckPythonSyntax.Tests) ... ok
test32bitUnicodeCharInUtf8Comment (CheckUnicodeSourceFiles.Tests) ... ok
test32bitUnicodeCharInUtf8File (CheckUnicodeSourceFiles.Tests) ... ok
testSupplementaryPlaneUnicodeCharInUtf16File (CheckUnicodeSourceFiles.Tests) ... ok
testSurrogatePairUnicodeCharInUtf16File (CheckUnicodeSourceFiles.Tests) ... ok
testSurrogatePairUnicodeCharInUtf8File (CheckUnicodeSourceFiles.Tests) ... ok
testSurrogatePairUnicodeCharInUtf8FileWithBom (CheckUnicodeSourceFiles.Tests) ... ok
testUtf16InUniFile (CheckUnicodeSourceFiles.Tests) ... ok
testValidUtf8File (CheckUnicodeSourceFiles.Tests) ... ok
testValidUtf8FileWithBom (CheckUnicodeSourceFiles.Tests) ... ok

----------------------------------------------------------------------
Ran 267 tests in 2.148s

OK
make[1]: 离开目录“/home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/Tests”

编译工具就编好了,后续我们就可以使用里面的build命令了,否则不能使用build命令来编译代码。

build命令的使用如下:

build命令几个主要参数     

 -a        arch       

 -p        PlatformFile         

-m        ModuleFile         

-t        ToolChain         

-n        ThreadNumber         

-f        FdfFile         

-j        LogFile         

-s        SilentMode         

-q        quiet 

后续如何使用这个命令来编译代码会在编译脚本中详细说明。

(2)配置编译环境

退出到根目录下,也就是BaseTool目录外的一级目录,运行命令source edksetup.sh

这个命令主要是设置环境变量,打印如下

source edksetup.sh
Loading previous configuration from /home/liqiang/s3/vUDK2018-loongson-gen/Conf/BuildEnv.sh
WORKSPACE: /home/liqiang/s3/vUDK2018-loongson-gen
EDK_TOOLS_PATH: /home/liqiang/s3/vUDK2018-loongson-gen/BaseTools/
CONF_PATH: /home/liqiang/s3/vUDK2018-loongson-gen/Conf

这里面CONF_PATH这个环境变量很重要,在编译的时候需要使用这个目录中的三个文件,分别为

build_rule.txt   target.txt  tools_def.txt,这三个文件是在开始执行build命令的时候从BaseTool/Conf目录下面拷贝过来的,这三个文件对应的是BaseTool/Conf目录下的build_rule.template target.template  tools_def.template 这三个文件,我们在编译前要根据自己的编译器要修改的。

其中build_rule.txt文件是编译器需要使用的编译规则定义的文件,每个平台使用的编译器不同当然规则也不同,这里面需要自己平台自己添加,这个文件决定每个efi文件是如何编译出来的,是采用静态链接还是动态链接,都是在这里决定的,当然UEFI在所有平台下都采用的是静态链接的方法。以及如何编译C文件如何编译汇编文件,以及UEFI的每个阶段如何编译都是在这个文件中定义的。

tools_def.txt这个文件也是编译器需要使用的,决定编译参数,主要是gcc使用的编译参数,使用哪些参数都是在这里定义的。

target.txt 文件是根据这两个文件生成的,在编译的时候使用的。

这些准备工作做好之后,我们就可以在根目录下执行build命令开始编译代码了,我们这里为了每次编译方便,已经将整个环境配置和编译命令写在了脚本里面,每次只需要执行脚本就可以了。

(3)编译代码

我们这里编译代码的脚本如下:

  1 #/usr/bin                                                                        
  2 
  3 #######################################################################
  4 #
  5 # 1: make BaseTools and copy BuildEnv.sh build_rule.txt tools_def.txt to
  6 #   Conf directory
  7 # 2: set environment path
  8 # 3: source edksetup.sh BaseTools
  9 # 4: make souce code
 10 # 5: generate *efi file
 11 # 6: generate *fd file
 12 #
 13 #######################################################################
 14 cd ../../
 15 export WORKSPACE=$PWD
 16 export EDK_TOOLS_PATH=$PWD/BaseTools/
 17 export GCC44_MIPS_PREFIX=/opt/gcc-4.4.0-pmon/bin/mipsel-linux-
 18 
 19 COMPILE_DIR=$PWD/LoongsonPlatFormPkg/Script
 20 COMPILE_FILE=Loongson
 21 PROJECT_IMAGE_NAME=Loongson.fd
 22 PROJECT_PLATFORM_NAME=LOONGSON
 23 PROJECT_BUILD_DIR=$WORKSPACE/Build/$PROJECT_PLATFORM_NAME/$VERSON
 24 
 25 if [ "$1" == "clean" ]
 26 then
 27   rm -rf $WORKSPACE/Build/
 28   #echo rm -rf $WORKSPACE/Build/ Success...
 29   exit 0
 30 elif [ "$1" == "release" ]
 31 then
 32   VERSON=RELEASE
 33 else
 34   VERSON=DEBUG
 35 fi
 36 
 37 echo WORKSPACE:${WORKSPACE}
 38 echo EDK_TOOLS_PATH:${EDK_TOOLS_PATH}
 39 echo GCC44_MIPS_PREFIX:${GCC44_MIPS_PREFIX}
 40 source edksetup.sh BaseTools
 41 echo PROJECT_BUILD_DIR:${PROJECT_BUILD_DIR}
 42 
 43 #
 44 # Build By GenFv
 45 #
 46 if  [[ ! -f `which build` || ! -f `which GenFv` ]];
 47 then
 48   echo Make BaseTools....
 49   make -C $WORKSPACE/BaseTools
 50 elif [[ ( -f `which build` ||  -f `which GenFv` )  && ! -d  $EDK_TOOLS_PATH/Source/C/bin ]];
 51 then
 52   echo Building tools no $EDK_TOOLS_PATH/Source/C/bin directory
 53   make -C $WORKSPACE/BaseTools
 54 else
 55   echo Tools already exiting
 56 fi
 57 
 58 
 59 if [ -z "$PLATFORMFILE" ]
 60 then
 61 PLATFORMFILE=${COMPILE_DIR}/${COMPILE_FILE}.dsc
 62 fi
 63 
 64 echo Runing Edk2 Build for LoongSon...
 65 build -a MIPS -p  $PLATFORMFILE -t GCC44 -b $VERSON -j log.txt
 66 #build -a MIPS -p  $PLATFORMFILE -t GCC44 -j log.txt
 67 
 68 exit $?

这里其实编译代码的命令主要就是build -a MIPS -p  $PLATFORMFILE -t GCC44 -b $VERSON -j log.txt这个命令。在编译的过程中会在根目录下生成一个log.txt文件,就是整个编译的过程。里面会想写的打印每个.efi文件是如何编译出来的。

根据log.txt文件总结编译过程如下:

根据log文件下面我们看看拿其中的一个SmbiosDxe.efi文件的编译过程为例,看看它是如何编译出来的编译过程主要如下:

"/opt/gcc-4.4.0-pmon/bin/mipsel-linux-gcc" -g -Os 等一些参数将这个驱动中要包含的.c文件和所依赖的库和模块中的.c文件都编译成.obj文件,存放在Build目录下面对应的OUTPUT文件中,同时生成object_file.lst文件和static_library_file.lst文件,这里面的.obj文件其实就是elf格式的可执行的二进制文件

"/opt/gcc-4.4.0-pmon/bin/mipsel-linux-ar" cr 命令使用object_file.lst在Build目录下面对应的OUTPUT文件中生成对应的SmbiosDxe.lib文件,这个.lib文件就是将多个obj文件链接到一起生成的文件。同时生成.map文件。

"/opt/gcc-4.4.0-pmon/bin/mipsel-linux-ld" -o 使用这个命令再加上一下参数,用到上面的.map文件和static_library_file.lst生成.dll文件,这个文件在DEBUG文件夹下,同时将这个文件拷贝到DEBUG和OUTPUT目录下重命名为.debug文件,这时这个文件已经添加了PE头的ELF文件

"/opt/gcc-4.4.0-pmon/bin/mipsel-linux-objcopy" --strip-unneeded -R .eh_frame -R .rel.dyn 命令在DEBUG目录生成.dll文件这里,这里和上面生成的同一个文件,但是这里具体对这个文件又做了什么操作还不清楚。

/opt/gcc-4.4.0-pmon/bin/mipsel-linux-objcopy --add-gnu-debuglink命令将DEBUG目录下的.debug文件生成了.dll文件,具体又添加了什么信息还是不太清楚,有了解和可以在下面评论指点,非常感谢各位读者。

"GenFw" -e DXE_DRIVER -o 用这个命令将DEBUG目录下面的.dll文件生成对应的.efi文件,此时这个文件格式已经发生了改变,不再是ELF文件,而是PE格式或者PE32的格式。

最后将.efi文件拷贝到OUTPUT下和对应该有.efi文件的目录下。这样每个.efi文件都是这样编译出来的。

最后使用Genfd命令根据fdf规定的region的信息,生成fd文件,也就是我们bios真正跑的二进制文件。

猜你喜欢

转载自blog.csdn.net/Lq19880521/article/details/82788367
今日推荐