Skip to content

Commit

Permalink
add VS2017 support for EDK2, including ARM and AARCH64 builds
Browse files Browse the repository at this point in the history
* That's the way you do it!
  • Loading branch information
pbatard committed Nov 8, 2017
1 parent 010832c commit 868503a
Show file tree
Hide file tree
Showing 7 changed files with 679 additions and 1 deletion.
4 changes: 4 additions & 0 deletions EfiFsPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf

[LibraryClasses.ARM, LibraryClasses.AARCH64]
!if $(TOOLCHAIN) != "VS2017" || $(ARCH) != "AARCH64"
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
!endif
!if $(TOOLCHAIN) != "VS2017"
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
!endif

###################################################################################################
#
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ For additional info as well as precompiled drivers, see http://efi.akeo.ie
* From a command prompt, set Grub to target the platform you are compiling for by invoking:
* (Windows) `set_grub_cpu.cmd <arch>`
* (Linux) `./set_grub_cpu.sh <arch>`
Where `<arch>` is one of `ia32`, `x64`, `arm` or `aa64`.
Where `<arch>` is one of `ia32`, `x64`, `arm` or `aarch64`.
Note that you __MUST__ invoke the `set_grub_cpu` script __every time you switch target__.
* After having invoked `Edk2Setup.bat` (Windows) or `edksetup.sh` (Linux) run something like:
```
Expand All @@ -55,6 +55,14 @@ For additional info as well as precompiled drivers, see http://efi.akeo.ie
```
build -a X64 -b RELEASE -t <toolchain> -p EfiFsPkg/EfiFsPkg.dsc -m EfiFsPkg/EfiFsPkg/Ntfs.inf
```
* Note that you __can__ invoke a `VS2017` toolchain for building with the EDK2, that includes
build support for both the `ARM` and `AARCH64` targets (which the default EDK2 still doesn't
provide for Visual Studio), by applying the patches from the `edk2` subdirectory.

For instance, after applying the patches, you will be able to issue the following on Windows:
```
build -a AARCH64 -b RELEASE -t VS2017 -p EfiFsPkg/EfiFsPkg.dsc
```

## Testing

Expand Down
32 changes: 32 additions & 0 deletions edk2/0001-EDK2-Add-BaseTools-Bin-Win32-as-a-git-module.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 7265f2b1701330b78aeb6799955bd1e5dfe7c67b Mon Sep 17 00:00:00 2001
From: Pete Batard <[email protected]>
Date: Tue, 7 Nov 2017 17:59:27 +0000
Subject: [PATCH 1/2] EDK2 - Add BaseTools/Bin/Win32 as a git module

* Makes things A LOT easier
---
.gitmodules | 3 +++
BaseTools/Bin/Win32 | 1 +
2 files changed, 4 insertions(+)
create mode 100644 .gitmodules
create mode 160000 BaseTools/Bin/Win32

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..c5f5c11
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "BaseTools/Bin/Win32"]
+ path = BaseTools/Bin/Win32
+ url = https://github.com/tianocore/edk2-BaseTools-win32
diff --git a/BaseTools/Bin/Win32 b/BaseTools/Bin/Win32
new file mode 160000
index 0000000..56e87e6
--- /dev/null
+++ b/BaseTools/Bin/Win32
@@ -0,0 +1 @@
+Subproject commit 56e87e680716323de849a10eb836cd3b299b844d
--
2.9.3.windows.2

Loading

0 comments on commit 868503a

Please sign in to comment.