Hi Haojian,
Normally this is caused by large structure variable copy operation, and compiler will change the code to memcpy. As there is no such function in your build, it will complain "undefined reference".
There are two ways to fix this:
1. Add compiler intrinsic library to your dsc file:
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
2. Find the code which does structure copy and modify it with explicit EDK2 CopyMem function.
Please have a try.
Regards,
Gary (Heyi Guo)
在 5/20/2017 11:15 AM, Haojian Zhuang 写道:
Hi all,
Do you meet this issue when build edk2? If I just build edk2 with DEBUG mode, it's fine. If I build edk2 with RELEASE mode, I'll meet the issue in below.
"aarch64-linux-gnu-gcc" -o /opt/workspace/boot/uefi/hikey960/edk2/Build/HiKey960/RELEASE_GCC5/AARCH64/MdeModulePkg/Universal/CapsuleRuntimeD xe/CapsuleRuntimeDxe/DEBUG/CapsuleRuntimeDxe.dll -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u _ModuleEntryPoint -Wl,-e,_ModuleEntryPoint ,-Map,/opt/workspace/boot/uefi/hikey960/edk2/Build/HiKey960/RELEASE_GCC5/AARCH64/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/
DEBUG/CapsuleRuntimeDxe.map -z common-page-size=0x20 -flto -Os -L/opt/workspace/boot/uefi/hikey960/edk2/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -z common-page-size=0x10000 -Wl,--start-group,@/opt/workspace/boot/uefi/hikey960/edk2/Build/HiK$y960/RELEASE_GCC5/AARCH64/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/OUTPUT/static_library_files.lst,--end-group -I/opt/wo$kspace/boot/uefi/hikey960/edk2/OpenPlatformPkg/Include -I/opt/workspace/boot/uefi/hikey960/edk2/OpenPlatformPkg/Platforms/Hisilicon/HiKey96$/Include -I/opt/workspace/boot/uefi/hikey960/edk2/EmbeddedPkg/Include -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=CapsuleRuntimeDxeStrings -g -Os -fshort-wchar -fno-s$rict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -fno-builtin -Wno-address -fno-asynchronous-unwind-tables -save-temps -flto -Wno-unused-but-set-variabl$ -mcmodel=tiny -fomit-frame-pointer -Wl,--script=/opt/workspace/boot/uefi/hikey960/edk2/BaseTools/Scripts/GccBase.lds -Wl,--defsym=PECOFF_H$ADER_SIZE=0x228 -Wno-error ArmPlatformPrePiUniCore.dll.ltrans0.ltrans.o: In function `ExtractGuidedSectionLibConstructor': /opt/workspace/boot/uefi/hikey960/edk2/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c:219: undefined refer$ nce to `memcpy' ArmPlatformPrePiUniCore.dll.ltrans6.ltrans.o: In function `GetSavedData': /opt/workspace/boot/uefi/hikey960/edk2/EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.c:37: undefined refere$ce to `memcpy' collect2: error: ld returned 1 exit status GNUmakefile:416: recipe for target '/opt/workspace/boot/uefi/hikey960/edk2/Build/HiKey960/RELEASE_GCC5/AARCH64/ArmPlatformPkg/PrePi/PeiUniC$re/DEBUG/ArmPlatformPrePiUniCore.dll' failed make: *** [/opt/workspace/boot/uefi/hikey960/edk2/Build/HiKey960/RELEASE_GCC5/AARCH64/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPreP$UniCore.dll] Error 1
build.py... : error 7000: Failed to execute command make tbuild [/opt/workspace/boot/uefi/hikey960/edk2/Build/HiKey960/RELEASE_GCC5/AARCH64/ArmPlatformPkg/PrePi/PeiUniCore]
build.py... : error 7000: Failed to execute command make tbuild [/opt/workspace/boot/uefi/hikey960/edk2/Build/HiKey960/RELEASE_GCC5/AARCH64/MdeModulePkg/Universal/SecurityStubDxe/Secu$ityStubDxe]
build.py... : error F002: Failed to build module
/opt/workspace/boot/uefi/hikey960/edk2/ArmPlatformPkg/PrePi/PeiUniCore.inf [AARCH64, GCC5, RELEASE]
Best Regards Haojian _______________________________________________ Linaro-uefi mailing list Linaro-uefi@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-uefi