Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion .github/actions/merge-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
$conf32 = "`r`n""i[3-6]86-.*-windows-msvc"":" + $conf32.Substring($conf32.IndexOf("`r`ndefault:") + 10)
$conf32 = $conf32.Substring(0, $conf32.IndexOf("`r`n};`r`n") + 6)
$conf32 = $conf32.Replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib32')
Add-Content etc\ldc2.conf $conf32
Add-Content etc\ldc2.conf $conf32 -NoNewline
cat etc\ldc2.conf

- name: Generate hello.d
Expand Down Expand Up @@ -63,6 +63,49 @@ runs:
set PATH=%CD%\ldc2-multilib\lib32;%PATH%
ldc2-multilib\bin\ldc2 -link-defaultlib-shared -m32 -run hello.d || exit /b

# preliminary arm64 cross-compilation support
- name: Install ninja v1.12.1
uses: Ahajha/gha-setup-ninja@69595b0cf872acdad8ce599142fbdc88724b9a2b
- name: Set VSDIR env variable
shell: bash
run: echo "VSDIR=$(vswhere -latest -property installationPath)" >> $GITHUB_ENV
- name: Cross-compile arm64 libraries
shell: cmd
run: |
echo on
call "%VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x64 || exit /b
echo on
ldc2-multilib\bin\ldc-build-runtime --ninja ^
--buildDir=build-libs-arm64 ^
--dFlags=-mtriple=aarch64-windows-msvc ^
"--ldcSrcDir=%CD%" ^
BUILD_LTO_LIBS=ON
- name: Copy arm64 libraries
shell: bash
run: |
set -eux
cp -R build-libs-arm64/lib ldc2-multilib/libarm64
rm ldc2-multilib/libarm64/*.{exp,ilk}
rm ldc2-multilib/libarm64/{druntime,phobos2}-ldc-shared.pdb
- name: Add arm64 section to ldc2.conf
shell: pwsh
run: |
cd ldc2-multilib
$conf64 = cat etc\ldc2.conf -Raw
$conf64 = "`r`n""(aarch|arm)64-.*-windows-msvc"":" + $conf64.Substring($conf64.IndexOf("`r`ndefault:") + 10)
$conf64 = $conf64.Substring(0, $conf64.IndexOf("`r`n};`r`n") + 6)
$conf64 = $conf64.Replace('%%ldcbinarypath%%/../lib64', '%%ldcbinarypath%%/../libarm64')
Add-Content etc\ldc2.conf $conf64 -NoNewline
cat etc\ldc2.conf
- name: Run arm64 hello-world cross-compilation smoke tests
shell: cmd
run: |
echo on
call "%VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x64 || exit /b
echo on
ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc hello.d || exit /b
ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc -link-defaultlib-shared hello.d || exit /b

- name: Pack multilib package
shell: bash
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,14 @@ jobs:

merge-windows:
name: Windows multilib
runs-on: windows-latest
runs-on: windows-2022
timeout-minutes: 30
needs: build-native
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50
- name: Merge x64 & x86 packages to multilib one & build installer
uses: ./.github/actions/merge-windows

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#### Platform support
- Supports LLVM 15 - 19.
- Initial compiler and runtime support for ppc64 and ppc64le systems that use IEEE 754R 128-bit floating-point as the default 128-bit floating-point format. (#4833)
- Added support for building for Windows on ARM64. Use option '-march=arm64' to compile, 'ldc-build-runtime.exe --dFlags -march=arm64' to build the runtime libraries. (#4835)
- Initial support for Windows on ARM64. The prebuilt Windows multilib package/installer bundles prebuilt arm64 druntime and Phobos; cross-compiling works out of the box via `-mtriple=aarch64-windows-msvc`, but you currently need to set up a suited MSVC arm64 build environment before yourself (e.g., by running `vsdevcmd.bat -arch=arm64 -host_arch=x64`). There's no bundled libcurl either yet. (#4835, #4846)

#### Bug fixes
- Building multi-file D applications with control-flow protection will no longer cause LDC to throw an internal compiler error. (#4828)
Expand Down
4 changes: 3 additions & 1 deletion packaging/windows_installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ SolidCompression=yes
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "{#LDCDir}\*"; Excludes: "\lib32,\lib64"; DestDir: "{app}"; Components: core; Flags: ignoreversion recursesubdirs
Source: "{#LDCDir}\*"; Excludes: "\lib32,\lib64,\libarm64"; DestDir: "{app}"; Components: core; Flags: ignoreversion recursesubdirs
Source: "{#LDCDir}\lib64\*"; DestDir: "{app}\lib64"; Components: lib64; Flags: ignoreversion recursesubdirs
Source: "{#LDCDir}\lib32\*"; DestDir: "{app}\lib32"; Components: lib32; Flags: ignoreversion recursesubdirs
Source: "{#LDCDir}\libarm64\*"; DestDir: "{app}\libarm64"; Components: libarm64; Flags: ignoreversion recursesubdirs

[Components]
Name: core; Description: "Executables, config file and imports"; Types: full compact custom; Flags: fixed
Name: lib64; Description: "x64 libraries"; Types: full compact
Name: lib32; Description: "x86 libraries"; Types: full
Name: libarm64; Description: "arm64 libraries"; Types: full

[Run]
; note: not added to PATH for silent installs with /SILENT or /VERYSILENT
Expand Down
Loading