Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More improvements to native library builds #2140

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .github/workflows/vulkan-loader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
for arch in amd64 arm64 armhf; do
sudo apt install -y libx11-xcb-dev:$arch libxkbcommon-dev:$arch libwayland-dev:$arch libxrandr-dev:$arch
done
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20240417/llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz
sudo mkdir /opt/llvm-mingw-msvcrt
sudo tar xf llvm-mingw-20240417-msvcrt-ubuntu-20.04-x86_64.tar.xz --strip-components 1 -C /opt/llvm-mingw-msvcrt
- os: windows-2022
name: Windows
nuke_invoke: ./build.cmd
Expand Down
12 changes: 12 additions & 0 deletions build/cmake/aarch64-w64-mingw32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_ASM_COMPILER "aarch64-w64-mingw32-as")
set(CMAKE_C_COMPILER "aarch64-w64-mingw32-gcc")
set(CMAKE_CXX_COMPILER "aarch64-w64-mingw32-g++")
set(CMAKE_RC_COMPILER "aarch64-w64-mingw32-windres")
set(CMAKE_LINKER "aarch64-w64-mingw32-ld")
set(CMAKE_FIND_ROOT_PATH "/opt/llvm-mingw-msvcrt/aarch64-w64-mingw32")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
6 changes: 3 additions & 3 deletions build/nuke/Native/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public void PrUpdatedNativeBinary(string name, [CanBeNull] string glob = null)
// it's assumed that the pushable token was used to checkout the repo
if (OperatingSystem.IsWindows())
{
glob ??= "src/Native/**/*.dll";
glob ??= "src/Native/**/*.dll src/Native/**/*.json";
}
else if (OperatingSystem.IsMacOS())
{
glob ??= "src/Native/**/*.a src/Native/**/*.dylib";
glob ??= "src/Native/**/*.a src/Native/**/*.dylib src/Native/**/*.json";
}
else if (OperatingSystem.IsLinux())
{
glob ??= "src/Native/**/*.so*";
glob ??= "src/Native/**/*.so* src/Native/**/*.json";
}

Git("fetch --all", RootDirectory);
Expand Down
1 change: 1 addition & 0 deletions build/nuke/Native/SwiftShader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ partial class Build {
{
("Win32", "win-x86"),
("x64", "win-x64"),
("ARM64", "win-arm64"),
})
{
EnsureCleanDirectory(buildDir);
Expand Down
11 changes: 10 additions & 1 deletion build/nuke/Native/VulkanLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ partial class Build {
}
else if (OperatingSystem.IsLinux())
{

foreach (var (triple, rid) in new[]
{
("x86_64-linux-gnu", "linux-x64"),
Expand All @@ -76,6 +75,16 @@ partial class Build {

CopyAll((buildDir / "loader").GlobFiles("libvulkan.so"), runtimes / rid / "native");
}

// Build for win-arm64 with llvm-mingw.
{
EnsureCleanDirectory(buildDir);

InheritedShell($"{prepare} -DUSE_GAS=ON {GetCMakeToolchainFlag("aarch64-w64-mingw32")}", buildDir).AssertZeroExitCode();
InheritedShell(build, buildDir).AssertZeroExitCode();

CopyAll((buildDir / "loader").GlobFiles("libvulkan-1.dll"), runtimes / "win-arm64" / "native");
}
}
else if (OperatingSystem.IsMacOS())
{
Expand Down
2 changes: 1 addition & 1 deletion build/submodules/SwiftShader
Submodule SwiftShader updated 29 files
+11 −0 CMakeLists.txt
+7 −7 src/Device/Context.cpp
+2 −2 src/Reactor/Debug.cpp
+3 −3 src/System/Debug.cpp
+9 −1 src/Vulkan/VkRenderPass.cpp
+4 −0 third_party/llvm-10.0/configs/windows/include/llvm/Config/llvm-config.h
+1 −0 third_party/llvm-16.0/Android.bp
+50 −3 third_party/llvm-16.0/BUILD.gn
+32 −0 third_party/llvm-16.0/CMakeLists.txt
+2,353 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenAsmMatcher.inc
+2,204 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenAsmWriter.inc
+10,214 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenDAGISel.inc
+1,911 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenDisassemblerTables.inc
+5,980 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenInstrInfo.inc
+1,743 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenMCCodeEmitter.inc
+166 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenMCPseudoLowering.inc
+1,676 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenRegisterInfo.inc
+261 −0 third_party/llvm-16.0/configs/common/lib/Target/LoongArch/LoongArchGenSubtargetInfo.inc
+3 −0 third_party/llvm-16.0/configs/linux/include/llvm/Config/AsmParsers.def
+3 −0 third_party/llvm-16.0/configs/linux/include/llvm/Config/AsmPrinters.def
+3 −0 third_party/llvm-16.0/configs/linux/include/llvm/Config/Disassemblers.def
+3 −0 third_party/llvm-16.0/configs/linux/include/llvm/Config/Targets.def
+1 −1 third_party/llvm-16.0/configs/linux/include/llvm/Config/config.h
+18 −0 third_party/llvm-16.0/configs/linux/include/llvm/Config/llvm-config.h
+4 −0 third_party/llvm-16.0/configs/windows/include/llvm/Config/llvm-config.h
+14 −1 third_party/llvm-16.0/scripts/generate_build_files.py
+20 −0 third_party/llvm-16.0/scripts/template_BUILD.gn
+6 −0 third_party/llvm-16.0/scripts/template_CMakeLists.txt
+2 −0 third_party/llvm-16.0/scripts/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Content Include="runtimes\linux-x64\native\libvulkan.so" PackagePath="runtimes\linux-x64\native\libvulkan.so" />
<Content Include="runtimes\osx-arm64\native\libvulkan.dylib" PackagePath="runtimes\osx-arm64\native\libvulkan.dylib" />
<Content Include="runtimes\osx-x64\native\libvulkan.dylib" PackagePath="runtimes\osx-x64\native\libvulkan.dylib" />
<Content Include="runtimes\win-arm64\native\vulkan-1.dll" PackagePath="runtimes\win-arm64\native\vulkan-1.dll" />
<Content Include="runtimes\win-x64\native\vulkan-1.dll" PackagePath="runtimes\win-x64\native\vulkan-1.dll" />
<Content Include="runtimes\win-x86\native\vulkan-1.dll" PackagePath="runtimes\win-x86\native\vulkan-1.dll" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@
</PropertyGroup>
<ItemGroup>
<Content Include="build\net461\$(PackageId).targets" PackagePath="build\net461\$(PackageId).targets" />
<Content Include="runtimes\linux-arm\native\libvk_swiftshader.so" PackagePath="runtimes\linux-arm\native\libvk_swiftshader.so" />
<Content Include="runtimes\linux-arm\native\vk_swiftshader_icd.json" PackagePath="runtimes\linux-arm\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\linux-arm64\native\libvk_swiftshader.so" PackagePath="runtimes\linux-arm64\native\libvk_swiftshader.so" />
<Content Include="runtimes\linux-arm64\native\vk_swiftshader_icd.json" PackagePath="runtimes\linux-arm64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\linux-x64\native\libvk_swiftshader.so" PackagePath="runtimes\linux-x64\native\libvk_swiftshader.so" />
<Content Include="runtimes\linux-x64\native\vk_swiftshader_icd.json" PackagePath="runtimes\linux-x64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\osx-arm64\native\libvk_swiftshader.dylib" PackagePath="runtimes\osx-arm64\native\libvk_swiftshader.dylib" />
<Content Include="runtimes\osx-arm64\native\vk_swiftshader_icd.json" PackagePath="runtimes\osx-arm64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\osx-x64\native\libvk_swiftshader.dylib" PackagePath="runtimes\osx-x64\native\libvk_swiftshader.dylib" />
<Content Include="runtimes\win-arm64\native\vk_swiftshader.dll" PackagePath="runtimes\win-arm64\native\vk_swiftshader.dll" />
<Content Include="runtimes\win-arm64\native\vk_swiftshader_icd.json" PackagePath="runtimes\win-arm64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\win-x64\native\vk_swiftshader.dll" PackagePath="runtimes\win-x64\native\vk_swiftshader.dll" />
<Content Include="runtimes\win-x64\native\vk_swiftshader_icd.json" PackagePath="runtimes\win-x64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\win-x86\native\vk_swiftshader.dll" PackagePath="runtimes\win-x86\native\vk_swiftshader.dll" />
<Content Include="runtimes\linux-x64\native\vk_swiftshader_icd.json" PackagePath="runtimes\linux-x64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\osx-x64\native\vk_swiftshader_icd.json" PackagePath="runtimes\osx-x64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\win-x64\native\vk_swiftshader_icd.json" PackagePath="runtimes\win-x64\native\vk_swiftshader_icd.json" />
<Content Include="runtimes\win-x86\native\vk_swiftshader_icd.json" PackagePath="runtimes\win-x86\native\vk_swiftshader_icd.json" />
</ItemGroup>
</Project>
Loading