From nobody Mon Feb 9 01:01:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81723+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81723+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1633801533; cv=none; d=zohomail.com; s=zohoarc; b=MrwQWQzVJ1V+IwYFnfrkBBMMqiNtZ7L+7ejeojlFyDO5Ij1oZknDeOykmJKSZC7ty1ErmQpxO7utECMByS356xQY1kN7x7qj22DR9+VqAp2Mp8Nkj8DUb8ubjfVNwL/jcSDpbHfyd24q7QdR7rIP6ImhqQrku7eIsK4xm2bzBvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633801533; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=MSGBE61xUJV70Sto+tQmVneheUz8z23ERebsX2XgSVM=; b=MYpJQJnwaN0yVZCvJIUj9LySxyVtj8CIw5QLgC0YVxWN1ughCBz1deorPz0ZTVslgSfoK9MoUUewalTfuweBm6l2GsurAOTwtCysiqfz/XaNv+GVQOAQRNh2PoB+mRtLNXHZDJFFXVqeynIefH8Xu5pATDO1pyBckMq2y3JUUmY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81723+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633801533127243.49949254596345; Sat, 9 Oct 2021 10:45:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id q0ggYY1788612xrRfY1UWgt0; Sat, 09 Oct 2021 10:45:32 -0700 X-Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web12.8267.1633794642684585043 for ; Sat, 09 Oct 2021 08:50:42 -0700 X-Received: by mail-pl1-f178.google.com with SMTP id v20so1071581plo.7 for ; Sat, 09 Oct 2021 08:50:42 -0700 (PDT) X-Gm-Message-State: lFwCCaV9EoaqKZ8q59DFrrnPx1787277AA= X-Google-Smtp-Source: ABdhPJwMBDPOzU2V+e52lgkJMP2LM6yXzT8dEfCbRNnHyP0GQdy0q5BFHl8fwbH/KP8p9lLfHTcABw== X-Received: by 2002:a17:90a:9d81:: with SMTP id k1mr10612582pjp.153.1633794642299; Sat, 09 Oct 2021 08:50:42 -0700 (PDT) X-Received: from localhost.localdomain ([240d:1a:ada:4400:d496:915d:ba15:739a]) by smtp.gmail.com with ESMTPSA id z2sm2633255pfe.210.2021.10.09.08.50.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Oct 2021 08:50:41 -0700 (PDT) From: "Akira Moroo" To: devel@edk2.groups.io Cc: afish@apple.com, ray.ni@intel.com, Akira Moroo Subject: [edk2-devel] [RFC PATCH 4/4] EmulatorPkg: Add AArch64 Unix host build support Date: Sun, 10 Oct 2021 00:49:18 +0900 Message-Id: <7d717f2a0250a073f8738a200f1a95970e9ea1fd.1633789833.git.retrage01@gmail.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,retrage01@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633801532; bh=FN8hBUwqI/97wJcuClFhVIwbwx0/8gULiO34Az5QoXo=; h=Cc:Date:From:Reply-To:Subject:To; b=vCsxJQiwvJQwzzOlIEFfccv2e8TelQGnZLAgKaQ1YlwjuAX34ggDsfWbxKPT3euCZOw yy8ldjFOavOakj5+93a4wujU9OboqHgkuIssWvOhjqJD/qsuUKLRRnnkhXPVbexkUOegM r5FS3vSJzFUFcRSEKBQCTdgNk44Jv8iTMSM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633801535184100015 Content-Type: text/plain; charset="utf-8" This commit adds AArch64 Unix host build support for EmulatorPkg. Signed-off-by: Akira Moroo --- EmulatorPkg/EmulatorPkg.dsc | 15 ++++++++++++--- EmulatorPkg/Readme.md | 8 ++++++++ EmulatorPkg/Unix/Host/Host.inf | 5 +++++ EmulatorPkg/build.sh | 8 ++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 554c13ddb5..91d0176fc7 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -19,7 +19,7 @@ DSC_SPECIFICATION =3D 0x00010005 OUTPUT_DIRECTORY =3D Build/Emulator$(ARCH) =20 - SUPPORTED_ARCHITECTURES =3D X64|IA32 + SUPPORTED_ARCHITECTURES =3D X64|IA32|AARCH64 BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER =3D DEFAULT FLASH_DEFINITION =3D EmulatorPkg/EmulatorPkg.fdf @@ -138,6 +138,13 @@ AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib= Null.inf !endif =20 +[LibraryClasses.AARCH64] + ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf + ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf + CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMainte= nanceLib.inf + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + [LibraryClasses.common.SEC] PeiServicesLib|EmulatorPkg/Library/SecPeiServicesLib/SecPeiServicesLib.i= nf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf @@ -209,8 +216,10 @@ TimerLib|EmulatorPkg/Library/DxeTimerLib/DxeTimerLib.inf =20 [PcdsFeatureFlag] - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst= |FALSE + +[PcdsFeatureFlag.IA32,PcdsFeatureFlag.X64] + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildPageTables|FALSE =20 [PcdsFixedAtBuild] @@ -288,7 +297,7 @@ gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVar= iableGuid|0x0|10 =20 [Components] -!if "IA32" in $(ARCH) || "X64" in $(ARCH) +!if "IA32" in $(ARCH) || "X64" in $(ARCH) || "AARCH64" in $(ARCH) !if "MSFT" in $(FAMILY) || $(WIN_HOST_BUILD) =3D=3D TRUE ## # Emulator, OS WIN application diff --git a/EmulatorPkg/Readme.md b/EmulatorPkg/Readme.md index 0c2eea6a9a..e3d0b58578 100644 --- a/EmulatorPkg/Readme.md +++ b/EmulatorPkg/Readme.md @@ -35,6 +35,10 @@ https://github.com/tianocore/tianocore.github.io/wiki/Em= ulatorPkg =20 `build -p EmulatorPkg\EmulatorPkg.dsc -t GCC5 -a X64` =20 + * AArch64 emulator in Linux: + + `build -p EmulatorPkg\EmulatorPkg.dsc -t GCC5 -a AARCH64` + **You can start/run the emulator using the following command:** * 32bit emulator in Windows: =20 @@ -52,6 +56,10 @@ https://github.com/tianocore/tianocore.github.io/wiki/Em= ulatorPkg =20 `cd Build/EmulatorX64/DEBUG_GCC5/X64/ && ./Host` =20 + * AArch64 emulator in Linux: + + `cd Build/EmulatorAARCH64/DEBUG_GCC5/AARCH64/ && ./Host` + **On posix-like environment with the bash shell you can use EmulatorPkg/bu= ild.sh to simplify building and running emulator.** =20 diff --git a/EmulatorPkg/Unix/Host/Host.inf b/EmulatorPkg/Unix/Host/Host.inf index 43cb55aa21..fe4c6d511c 100644 --- a/EmulatorPkg/Unix/Host/Host.inf +++ b/EmulatorPkg/Unix/Host/Host.inf @@ -129,6 +129,11 @@ GCC:*_*_X64_PP_FLAGS =3D=3D -m64 -E -x assembler-with-cpp -include $(DE= ST_DIR_DEBUG)/AutoGen.h GCC:*_*_X64_ASM_FLAGS =3D=3D -m64 -c -x assembler -imacros $(DEST_DIR_D= EBUG)/AutoGen.h =20 + GCC:*_*_AARCH64_DLINK_FLAGS =3D=3D -fPIC -flto -o $(BIN_DIR)/Host -L/us= r/X11R6/lib + GCC:*_*_AARCH64_ASM_FLAGS =3D=3D -g -c -x assembler -imacros $(DEST_DIR= _DEBUG)/AutoGen.h + GCC:*_*_AARCH64_PP_FLAGS =3D=3D -E -x assembler-with-cpp -include $(DES= T_DIR_DEBUG)/AutoGen.h + GCC:*_*_AARCH64_CC_FLAGS =3D=3D -c -O0 -g -fPIC -fshort-wchar -fno-stri= ct-aliasing -idirafter/usr/include -include $(DEST_DIR_DEBUG)/AutoGen.h -DU= SING_LTO -DSTRING_ARRAY_NAME=3D$(BASE_NAME)Strings + GCC:*_*_*_DLINK2_FLAGS =3D=3D -lpthread -ldl -lXext -lX11 =20 # diff --git a/EmulatorPkg/build.sh b/EmulatorPkg/build.sh index 76c22dfaf8..e2ce1b8e18 100755 --- a/EmulatorPkg/build.sh +++ b/EmulatorPkg/build.sh @@ -83,6 +83,9 @@ case `uname` in x86_64) HOST_PROCESSOR=3DX64 ;; + aarch64) + HOST_PROCESSOR=3DAARCH64 + ;; esac =20 gcc_version=3D$(gcc -v 2>&1 | tail -1 | awk '{print $3}') @@ -174,6 +177,11 @@ case $PROCESSOR in LIB_NAMES=3D"ld-linux-x86-64.so.2 libdl.so.2 crt1.o crti.o crtn.o" LIB_SEARCH_PATHS=3D"/usr/lib/x86_64-linux-gnu /usr/lib64 /lib64 /usr/l= ib /lib" ;; + AARCH64) + ARCH_SIZE=3D64 + LIB_NAMES=3D"ld-linux-aarch64.so.1 libdl.so.2 crt1.o crti.o crtn.o" + LIB_SEARCH_PATHS=3D"/usr/lib/aarch64-linux-gnu /usr/lib /lib" + ;; esac =20 for libname in $LIB_NAMES --=20 2.33.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81723): https://edk2.groups.io/g/devel/message/81723 Mute This Topic: https://groups.io/mt/86198796/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-