In file included from /home/chen-docker/bin/boot/boot_images/edk2/MdePkg/Include/Uefi.h:18: In file included from /home/chen-docker/bin/boot/boot_images/edk2/MdePkg/Include/Uefi/UefiSpec.h:2222: /home/chen-docker/bin/boot/boot_images/edk2/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h +1755:12: error: field Guid within 'EFI_HII_KEYBOARD_LAYOUT' is less aligned than 'EFI_GUID' (aka 'GUID') and is usually due to 'EFI_HII_KEYBOARD_LAYOUT' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] EFI_GUID Guid; ^ 1 error generated. In file included from /home/chen-docker/bin/boot/boot_images/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c:1: In file included from <built-in>:1: In file included from /home/chen-docker/bin/boot/boot_images/Build/LeMansAU/Core/RELEASE_CLANG140LINUX/AARCH64/MdeModulePkg/Library/UefiHiiLib/UefiHiiLib/DEBUG/AutoGen.h:16: In file included from /home/chen-docker/bin/boot/boot_images/edk2/MdePkg/Include/Uefi.h:18: In file included from /home/chen-docker/bin/boot/boot_images/edk2/MdePkg/Include/Uefi/UefiSpec.h:2222: /home/chen-docker/bin/boot/boot_images/edk2/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h +1755:12: error: field Guid within 'EFI_HII_KEYBOARD_LAYOUT' is less aligned than 'EFI_GUID' (aka 'GUID') and is usually due to 'EFI_HII_KEYBOARD_LAYOUT' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] EFI_GUID Guid; ^ GNUmakefile:366: recipe for target '/home/chen-docker/bin/boot/boot_images/Build/LeMansAU/Core/RELEASE_CLANG140LINUX/AARCH64/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib/OUTPUT/UefiHiiServicesLib.obj' failed make: *** [/home/chen-docker/bin/boot/boot_images/Build/LeMansAU/Core/RELEASE_CLANG140LINUX/AARCH64/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib/OUTPUT/UefiHiiServicesLib.obj] Error 1 什么错误?
时间: 2023-07-27 09:08:08 浏览: 223
这个错误是由于字段 `Guid` 在结构体 `EFI_HII_KEYBOARD_LAYOUT` 中的对齐方式不符合预期导致的。编译器提示该字段比 `EFI_GUID`(也称为 `GUID`)的对齐方式低,并且通常是由于 `EFI_HII_KEYBOARD_LAYOUT` 被设置为紧凑(packed)导致的。这可能会导致未对齐的访问,从而产生错误。
在 GNUmakefile 的第 366 行,目标路径为 `/home/chen-docker/bin/boot/boot_images/Build/LeMansAU/Core/RELEASE_CLANG140LINUX/AARCH64/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib/OUTPUT/UefiHiiServicesLib.obj` 的生成失败。make 命令返回错误码 1。
需要检查代码中关于 `EFI_HII_KEYBOARD_LAYOUT` 结构体的定义和使用,以确保对齐方式正确,或者根据编译器的警告信息调整结构体的对齐方式,以解决此错误。
阅读全文