tianocore / edk2

EDK II
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
Other
4.54k stars 2.45k forks source link

BaseTools: Update IA32/X64 cross-compilation to work like other archs #5998

Open bcran opened 1 month ago

bcran commented 1 month ago

Description

Cross-compilation to platforms other than IA32 and X64 work by setting an environment variable such as GCC__PREFIX that contains the path/name of the cross-compiler without the "gcc", "objcopy" etc. suffix.

On IA32 and X64 however, the environment variable GCC_BIN has been used instead. With fast AArch64 and other non-x86 platforms now being available, update IA32 and X64 to work the same as other platforms by using e.g. GCC_IA32_PREFIX and GCC_X64_PREFIX.

How This Was Tested

set GCC_IA32_PREFIX and GCC_X64_PREFIX and built OvmfPkg/OvmfPkgX64.dsc and OvmfPkg/OvmfPkgIa32.dsc on my AArch64 ALTRAD8UD-1L2T system.

Integration Instructions

N/A

bcran commented 1 month ago

I have no idea why the Analyze (ArmPkg,IA32,X64) CodeQL job is failing. I'll try and recreate the error locally, because the CI here shows no details whatsoever.

lgao4 commented 1 month ago

This change will require the platform to configure new environment varibles. It may impact current platform build script.

leiflindholm commented 1 month ago

I am very strongly in favour of unifying the cross-compilation across architectures. But given the platforms affected by this change are not the ones I maintain, I'll restrict my feedback at this point to the thumbs-up reaction.

bcran commented 1 month ago

This change will require the platform to configure new environment varibles. It may impact current platform build script.

@lgao4 I understand this will be a disruptive change for many platforms. Is it something we can note in the next release notes to have people update their scripts? I think it's a worthwhile change despite the disruption.

bcran commented 1 month ago

@lgao4 ping? Could you comment on whether this can be committed if we add it to the release notes please?

lgao4 commented 1 month ago

@lgao4 ping? Could you comment on whether this can be committed if we add it to the release notes please?

I suggest to first raise this change in edk2 mail list first and collect the feedback. If no more feedback, this change can be merged after this stable tag is created, then, give the enough time for the platform developer to update their build environment.