Can't Build AppPkg on ubuntu16.04?


robin
 

I developed UEFI app&driver with UDK2018&Win10. Recently I decided move to unbutu 16.04. Building EmulatorPkg and MdeMoudelPkg are good.
But I can't build AppPkg. The error message as below:

"gcc" -o /home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/WebServer/WebServer/DEBUG/WebServer.dll -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint -u _ModuleEntryPoint -Wl,-Map,/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/WebServer/WebServer/DEBUG/WebServer.map,--whole-archive -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 -Wl,--start-group,@/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/WebServer/WebServer/OUTPUT/static_library_files.lst,--end-group -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=WebServerStrings -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address -fno-pic -fno-pie -flto -Os -O0 -Wno-unused-variable -nostdinc -nostdlib -DUEFI_C_SOURCE -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 -Wl,--script=/home/robin/src/edk2/BaseTools/Scripts/GccBase.lds -Wno-error -no-pie
/usr/bin/ld: 并不支持从格式 pe-i386 (/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/StdLib/LibC/LibC/OUTPUT/LibC.lib(ftol2.obj)) 到格式 elf32-i386 (/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/SetHostName/SetHostName/DEBUG/SetHostName.dll) 的重寻址链结
collect2: error: ld returned 1 exit status
GNUmakefile:448: recipe for target '/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/SetHostName/SetHostName/DEBUG/SetHostName.dll' failed
make: *** [/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/SetHostName/SetHostName/DEBUG/SetHostName.dll] Error 1


build.py...
: error 7000: Failed to execute command
make tbuild [/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/SetHostName/SetHostName]


build.py...
: error 7000: Failed to execute command
make tbuild [/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/RecvDgram/RecvDgram]


build.py...
: error 7000: Failed to execute command
make tbuild [/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt]


build.py...
: error 7000: Failed to execute command
make tbuild [/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/WebServer/WebServer]


build.py...
: error 7000: Failed to execute command
make tbuild [/home/robin/src/edk2/Build/AppPkg/DEBUG_GCC5/IA32/AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx]


build.py...
: error F002: Failed to build module
/home/robin/src/edk2/AppPkg/Applications/Sockets/SetHostName/SetHostName.inf [IA32, GCC5, DEBUG]

- Failed -
Build end time: 11:23:27, Aug.08 2019
Build total time: 00:00:29