
Hi Simon,
On Sun, Apr 30, 2023 at 9:30 AM Simon Glass sjg@chromium.org wrote:
Add instructions for building u-boot.exe to run on Windows.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2:
- Clearify the documentation to explain the environment better
doc/build/gcc.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/doc/build/gcc.rst b/doc/build/gcc.rst index a0650a51db4b..96861c2b3d90 100644 --- a/doc/build/gcc.rst +++ b/doc/build/gcc.rst @@ -184,8 +184,48 @@ Important ones are
- clean - remove most generated files but keep the configuration
- mrproper - remove all generated files + config + various backup files
+Building on/for Windows +-----------------------
+Limited support is available for Windows, including building sandbox in the +MSYS2 environment. This produces native applications, but they must have access +to the `msys-2.0.dll` file.
+Note that this is not the same as running Windows Subsystem for Linux (WSL), +which is designed to build Linux applications.
+It is best to use an out-of-tree build, so you can build multiple boards, +with the output in a temporary directory like `/tmp/b`.
+First enable Windows developer mode with `Developer Mode`_ so that symbolic +links can be used. Then run the MSYS2 shell and enable symbolic links::
- cd
- echo "export MSYS=winsymlinks:nativestrict" >>.bashrc
I think we should use winsymlinks:native as this is most similar to the behavior of ln -s on *nix.
+Close all MSYS2 shells so that the setting takes effect.
+To build sandbox, first install some required packages::
- pacman install bc bison diffutils flex gcc libgnutls-devel \
This should be 'pacman -S'
libutil-linux-devel make openssl-devel python python-setuptools swig
+then::
- make O=/tmp/b/sandbox -j$(nproc) sandbox_defconfig all
+Note that it currently only gets as far as running binman, since this doesn't +fully work on Windows.
+You can also build sandbox_spl::
- make O=/tmp/b/sandbox_spl -j$(nproc) sandbox_spl_defconfig all
Installation
The process for installing U-Boot on the target device is device specific. Please, refer to the board specific documentation :doc:`../board/index`.
+.. _`Developer Mode`: https://msdn.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-...
Regards, Bin