This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,33 @@
# Changelog
All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.1] - 2026-11-04
### Changed
- Updated the com.unity.sysroot.base dependency to 1.1.1, which fixes payload extraction on CoreCLR Editors
## [1.1.0] - 2026-04-24
### Fixed
- Fixed a crash on older CPUs caused by SDK object files using feature beyond SSE2
### Changed
- Incremented minor version for release
## [1.0.2] - 2025-11-04
### Changed
- Incremented patch version for release
## [1.0.1] - 2025-09-10
### Added
- Documentation for public APIs
- Package tests
### Changed
- Incremented patch version for release
## [1.0.0] - 2025-08-01
### Changed
- Initial release of package supplying SDK for building IL2CPP players
- Sysroot uses glibc 2.35
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 093f79eac47814ed88c3ced1def79bd3
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,29 @@
# com.unity.sdk.linux-x86_64
This package provides the required 64-bit(x86_64) sysroot for building IL2CPP-based Unity players targeting both Linux and Embedded Linux platforms. It contains the system headers and libraries needed to compile and run Unity players, and is intended to be used in conjunction with a matching Unity-provided toolchain package on the host platform.
For an overview of Unity Embedded Linux support, see [Getting started with Embedded Linux](https://docs.unity.com/embeddedlinux/Getting_Started.html).
## Choosing the correct toolchain package
When building IL2CPP-based Unity players targeting 64-bit(x86_64) Linux or Embedded Linux, you must pair this sysroot package with the appropriate Unity toolchain package based on your host development platform.
| Host Platform | Recommended Toolchain Package |
|--------------------|--------------------------------------------------------|
| Linux x86_64 | `com.unity.toolchain.linux-x86_64-linux` |
| macOS x86_64 | `com.unity.toolchain.macos-x86_64-linux` |
| macOS ARM64 | `com.unity.toolchain.macos-arm64-linux` |
| Windows x86_64 | `com.unity.toolchain.win-x86_64-linux` |
## Building IL2CPP Players for Linux and Embedded Linux
After the appropriate toolchain package has been installed for the host platform, open the Unity project and navigate to:
**Project Settings** > **Player** > **Configuration**, then set the **Scripting Backend** to **IL2CPP**.
To build the player:
1. Open **File** > **Build Settings**.
2. In the **Target Platform** dropdown, select either **Linux** or **Embedded Linux**.
3. If **Embedded Linux** is selected, choose **x64** as the desired **Architecture**.
4. Click **Build** or **Build and Run** to generate the player executable.
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6c65fe360f8544fb8b9ea05c1d63a87c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
{
"name": "Unity.Sysroot.Linux_x86_64",
"references": [
"Unity.SysrootPackage.Editor"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 975c74bd4649a4013a160c08497037f2
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,150 @@
using System.IO;
using System.Collections.Generic;
using NiceIO.Sysroot;
namespace UnityEditor.Il2Cpp
{
/// <summary>
/// Sysroot package implementation for building Linux (x86_64) IL2CPP players.
/// </summary>
/// <remarks>
/// This class wires a sysroot payload (headers/libs) into IL2CPP's compile/link
/// steps by advertising the target triple and locating the on-disk sysroot path.
/// The payload itself is distributed via UPM under <see cref="_packageName"/>.
/// </remarks>
public class SysrootLinuxX86_64 : SysrootPackage
{
/// <summary>
/// The UPM package name that ships this sysroot payload.
/// </summary>
private string _packageName => "com.unity.sdk.linux-x86_64";
/// <summary>
/// Human-readable package name as exposed to callers.
/// </summary>
public override string Name => _packageName;
/// <summary>
/// The OS this sysroot targets.
/// </summary>
/// <remarks>Used for selection/routing in higher-level tooling.</remarks>
public override string TargetPlatform => "linux";
/// <summary>
/// The CPU architecture this sysroot targets.
/// </summary>
/// <remarks>Follows the the toolchain triple token (x86_64).</remarks>
public override string TargetArch => "x86_64";
/// <summary>
/// Identifier for the concrete payload version that this package expects.
/// </summary>
/// <remarks>
/// CI typically substitutes this placeholder at pack/publish time so the package
/// resolves a precise, immutable payload directory on disk.
/// </remarks>
private string _payloadVersion => "2.35-134_667fbfcff5dbe4cfa16c1c12d90c48cb2796fa258b226528939b1e36ed5aac21-1";
/// <summary>
/// Relative path (within the UPM cache) to the payload root for this platform/arch.
/// </summary>
private string _payloadDir;
/// <summary>
/// The Clang/LLVM target triple used for cross-compiling IL2CPP code against this sysroot.
/// </summary>
private string _target => "x86_64-unity-linux-gnu";
/// <summary>
/// Cached install directory of the resolved payload.
/// </summary>
private NPath _sysrootInstallDir;
/// <summary>
/// Initializes the package and registers its payload so it can be resolved on disk.
/// </summary>
public SysrootLinuxX86_64()
{
_payloadDir = $"linux-x86_64/{_payloadVersion}";
RegisterPayload(_packageName, _payloadDir);
_sysrootInstallDir = PayloadInstallDirectory(_payloadDir);
}
/// <summary>
/// Gets the absolute path to the installed payload root directory.
/// </summary>
/// <returns>Absolute path to the payload root.</returns>
public string PathToPayload()
{
return PayloadInstallDirectory(_payloadDir).ToString();
}
/// <summary>
/// Resolves the absolute path to the sysroot directory inside the installed payload.
/// </summary>
/// <remarks>
/// Looks for a child directory named exactly like the target triple (e.g.,
/// <c>x86_64-unity-linux-gnu</c>) and returns its <c>sysroot</c> subfolder.
/// Returns <c>null</c> if the expected structure is not present.
/// </remarks>
/// <returns>Absolute path to the sysroot directory, or <c>null</c> if not found.</returns>
private string PathToSysroot()
{
var sdkPath = PathToPayload();
var sdkInfo = new DirectoryInfo(sdkPath);
foreach (var target in sdkInfo.GetDirectories(_target))
{
var sysrootPath = Path.Combine(sdkPath, target.Name, "sysroot");
if (Directory.Exists(sysrootPath))
{
return sysrootPath.ToString();
}
}
return null;
}
/// <summary>
/// Absolute path to the sysroot that IL2CPP should compile/link against (not applicable for this toolchain-only package).
/// </summary>
/// <returns>Absolute sysroot path, or <c>null</c> if the payload is missing/incomplete or a toolchain-only package.</returns>
public override string GetSysrootPath()
{
return PathToSysroot();
}
/// <summary>
/// Absolute path to a toolchain payload (not applicable for this sysroot-only package).
/// </summary>
/// <returns>Absolute toolchain path, or <c>null</c> if the payload is missing/incomplete or a sysroot-only package.</returns>
public override string GetToolchainPath()
{
return null;
}
/// <summary>
/// Compiler flags that IL2CPP (Clang) must receive to target this sysroot.
/// </summary>
/// <remarks>
/// Primarily sets the target triple used for cross-compilation.
/// Example result: <c>-target x86_64-unity-linux-gnu</c>.
/// </remarks>
/// <returns>A space-separated string of compiler flags.</returns>
public override string GetIl2CppCompilerFlags()
{
return $"-target {_target}";
}
/// <summary>
/// Linker flags that IL2CPP must receive to target this sysroot.
/// </summary>
/// <remarks>
/// Mirrors the compiler target so the linker resolves libraries and startup files
/// from the correct sysroot. Example: <c>-target x86_64-unity-linux-gnu</c>.
/// </remarks>
/// <returns>A space-separated string of linker flags.</returns>
public override string GetIl2CppLinkerFlags()
{
return $"-target {_target}";
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a86097cb7fd054c47896d08f1f51b6f0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
This package is comprised of multiple separate components each with their own licensing requirements. There is some Unity wrapper code in the package that is used to make the location of the libraries we redistribute known to the Editor and IL2CPP. This code does not use any of the libraries we redistribute. They are used from script code only, which ones exactly depends on the scripts.
**Component Name**: Unity wrapper code
**License type**: Hybrid UCL and UPDL
com.unity.sdk.linux-x86_64 copyright © 2024 Unity Technologies ApS
Source code of the wrapper code licensed under the Unity Companion License (see https://unity3d.com/legal/licenses/unity_companion_license); otherwise licensed under the Unity Package Runtime Distribution License (see https://unity3d.com/legal/licenses/Unity_Package_Runtime_Distribution_License).
Unless expressly provided otherwise, the software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f3279528d1bc8427791c00f93707a98f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,5 @@
# com.unity.sdk.linux-x86_64
This package provides a sysroot for building Linux and Embedded Linux x86_64 players.
Please note that the components of the sysroot are subject to a variety of licenses detailed in the LICENSE.md file. While Unity itself does not use any of the provided libraries in a way that triggers any copyleft effects, you need to make sure that if you use native code in your project, said code adheres to the requirements of the licenses mentioned above. Specifically, the GCC runtime is subject to a GPL license, but it is also subject to the GCC runtime linking exception which applies to how the Unity player is using it.
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fa4e3b62cfaf2404eba61f1c388a2cfa
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c7792cffa475e4915ad45c6baea61cd0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 885ac5e7a42434a4d8c1c7c91137733e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,64 @@
using NUnit.Framework;
using UnityEditor.Il2Cpp;
/// <summary>
/// EditMode tests for the Linux x86_64 sysroot package.
/// </summary>
/// <remarks>
/// Verifies construction, a non-null payload path, and that compiler/linker flags
/// include the expected target triple—without requiring the payload to be installed.
/// </remarks>
/// <seealso cref="SysrootLinuxX86_64"/>
class SysrootTestX64
{
/// <summary>
/// Expected Clang/LLVM target triple for the Linux x86_64 sysroot.
/// </summary>
private string targetTriplet = "x86_64-unity-linux-gnu";
/// <summary>
/// Verifies the sysroot package can be instantiated without throwing.
/// </summary>
[Test]
public void TestPackageInitialization()
{
Assert.NotNull(new SysrootLinuxX86_64());
}
/// <summary>
/// Ensures the package reports a payload path string.
/// </summary>
/// <remarks>
/// This test only checks that a non-null string is returned; it does not assert the path exists on disk.
/// </remarks>
[Test]
public void TestPayloadExtracted()
{
var sysrootPackage = new SysrootLinuxX86_64();
Assert.NotNull(sysrootPackage.PathToPayload());
}
/// <summary>
/// Confirms the IL2CPP compiler flags include the expected target triple.
/// </summary>
[Test]
public void TestIL2CPPCompilerFlags()
{
var sysrootPackage = new SysrootLinuxX86_64();
Assert.IsTrue(
string.Equals($"-target {targetTriplet}", sysrootPackage.GetIl2CppCompilerFlags()),
"Compiler flags should exactly match the expected target triple.");
}
/// <summary>
/// Confirms the IL2CPP linker flags include the expected target triple.
/// </summary>
[Test]
public void TestIL2CPPLinkerFlags()
{
var sysrootPackage = new SysrootLinuxX86_64();
Assert.IsTrue(
string.Equals($"-target {targetTriplet}", sysrootPackage.GetIl2CppLinkerFlags()),
"Linker flags should exactly match the expected target triple.");
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 212bed8f12609449899f3f2b7646db0f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
{
"name": "Unity.Sysroot.Linux_x86_64.EditorTests",
"references": [
"Unity.SysrootPackage.Editor",
"Unity.Sysroot.Linux.x86_64",
"Unity.Sysroot.Linux_x86_64"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f4dbd28d8bf434681a7afa0d464d1159
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 789bc00358b964c3988f3327fd71fedb
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,29 @@
{
"name": "com.unity.sdk.linux-x86_64",
"displayName": "Sysroot Linux x64",
"description": "This package contains the sysroot used to build and run Unity players on 64-bit Linux systems. It includes the system libraries and headers required by Unity’s runtime environment to ensure compatibility with common Linux distributions during both compilation and execution.",
"version": "1.1.1",
"unity": "6000.3",
"unityRelease": "0b8",
"keywords": [
"unity",
"linux",
"sysroot"
],
"dependencies": {
"com.unity.sysroot.base": "1.1.1"
},
"_upm": {
"changelog": "### Changed\n- Updated the com.unity.sysroot.base dependency to 1.1.1, which fixes payload extraction on CoreCLR Editors"
},
"upmCi": {
"footprint": "4ad14748045547eec284928d58de39652b6479b8"
},
"documentationUrl": "https://docs.unity3d.com/Packages/com.unity.sdk.linux-x86_64@1.1/manual/index.html",
"repository": {
"url": "https://github.com/Unity-Technologies/com.unity.sysroot.git",
"type": "git",
"revision": "9c70b3c5d02ba7fb2000bffd29ea721c94c74422"
},
"_fingerprint": "920bc08129cd8fdbb7047417919cef376ed65070"
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a12af00e75af642b29a9f3987d6a6c98
PackageManifestImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: