Skip to content

Commit

Permalink
Additional toolchain support for Windows ARM64 tools (#208)
Browse files Browse the repository at this point in the history
* Add OSARCH=ARM64
* Add additional toolchain details for native arm64 compilers
  • Loading branch information
stephenjust authored and grafikrobot committed Mar 11, 2023
1 parent 4e2bfec commit ccdc6cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/engine/jam.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,15 @@
#endif

#if defined( __arm__ ) || \
defined( __aarch64__ )
defined( _M_ARM )
#define OSPLAT "OSPLAT=ARM"
#endif

#if defined( __aarch64__ ) || \
defined( _M_ARM64 )
#define OSPLAT "OSPLAT=ARM64"
#endif

#ifdef __s390__
#define OSPLAT "OSPLAT=390"
#endif
Expand Down
12 changes: 12 additions & 0 deletions src/tools/msvc.jam
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ accepted only by AMD64 targeting compilers, cause the generated code to
be tuned to a specific flavor of 64-bit x86. B2 will make use
of those options depending on the value of the`instruction-set` feature.

Starting with version 14.0, Microsoft Visual Studio can generate binaries
using native arm64 tools to compile for x86, x86_64, and arm64.

[[bbv2.reference.tools.compiler.msvc.winrt]]
== Windows Runtime support

Expand Down Expand Up @@ -1510,6 +1513,14 @@ local rule configure-really ( version ? : options * )
{
default-global-setup-options-ia64 = ia64 ;
}
# When using ARM64 Windows, it is possible to use native compilers,
# selected by the parameters to vcvarsall.bat.
if [ MATCH ^(ARM64) : [ os.environ PROCESSOR_ARCHITECTURE ] ]
{
default-global-setup-options-arm64 = arm64 ;
default-global-setup-options-amd64 = arm64_x64 ;
default-global-setup-options-i386 = arm64_x86 ;
}

for local c in $(cpu)
{
Expand Down Expand Up @@ -2118,6 +2129,7 @@ switch $(.default-cpu-arch)
{
case x86 : .default-cpu-arch = i386 ;
case em64t : .default-cpu-arch = amd64 ;
case arm64 : .default-cpu-arch = arm64 ;
}

for local cpu in $(.cpus-on-$(.cpu-arch-info-$(.default-cpu-arch)[1]))
Expand Down

0 comments on commit ccdc6cd

Please sign in to comment.