diff --git a/packages/linux/aarch64/autosd/10.0/BUILD b/packages/linux/aarch64/autosd/10.0/BUILD index c9126ba..94627b0 100644 --- a/packages/linux/aarch64/autosd/10.0/BUILD +++ b/packages/linux/aarch64/autosd/10.0/BUILD @@ -13,4 +13,5 @@ exports_files([ "autosd.BUILD", + "autosd_cross.BUILD", ]) diff --git a/packages/linux/aarch64/autosd/10.0/autosd_cross.BUILD b/packages/linux/aarch64/autosd/10.0/autosd_cross.BUILD new file mode 100644 index 0000000..04d18e4 --- /dev/null +++ b/packages/linux/aarch64/autosd/10.0/autosd_cross.BUILD @@ -0,0 +1,77 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +"""Build file for the AutoSD 10 GCC cross toolchain package (x86_64 host -> aarch64 target)""" + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "all_files", + srcs = glob(["*/**/*"]), +) + +filegroup( + name = "bin", + srcs = ["x86_64/usr/bin"], +) + +# The cross archive is split into an x86_64/ host tree and an aarch64/ target +# sysroot. The host cross compiler lives under x86_64/usr/bin as target-prefixed +# aarch64-redhat-linux-* wrappers (there is no bare gcc/g++/ar/... in this +# package, unlike the native AutoSD package). +filegroup( + name = "ar", + srcs = ["x86_64/usr/bin/aarch64-redhat-linux-ar"], +) + +filegroup( + name = "cc", + srcs = ["x86_64/usr/bin/aarch64-redhat-linux-gcc"], +) + +filegroup( + name = "gcov", + srcs = ["x86_64/usr/bin/aarch64-redhat-linux-gcov"], +) + +filegroup( + name = "cxx", + srcs = ["x86_64/usr/bin/aarch64-redhat-linux-g++"], +) + +filegroup( + name = "strip", + srcs = ["x86_64/usr/bin/aarch64-redhat-linux-strip"], +) + +# For the cross toolchain the aarch64 target sysroot is the ./aarch64 tree +# (the host-side compiler and its support files live under ./x86_64), unlike the +# native AutoSD package where the extracted root is itself the sysroot. +filegroup( + name = "sysroot_dir", + srcs = ["aarch64"], +) + +# Builtin include directories for the compiler. The glibc/libstdc++ headers +# live in the target sysroot (aarch64/); the compiler's own builtin headers stay +# host-side under x86_64/usr/lib/gcc. +filegroup( + name = "cxx_builtin_include_directories", + srcs = [ + "aarch64/usr/include", + "aarch64/usr/include/c++/14", + "aarch64/usr/include/c++/14/backward", + "aarch64/usr/include/c++/14/aarch64-redhat-linux", + "x86_64/usr/lib/gcc/aarch64-redhat-linux/14/include", + ], +) diff --git a/packages/version_matrix.bzl b/packages/version_matrix.bzl index 105a7d6..3a4b479 100644 --- a/packages/version_matrix.bzl +++ b/packages/version_matrix.bzl @@ -68,9 +68,54 @@ VERSION_MATRIX = { "-lrt", "-lstdc++", ], - "sha256": "e2f6a21681730e61ce39af19758003ba3568b093956a57cde136d5c73cf6540a", + "sha256": "981183eefabbfb1c8e7c7eebd9bc18ca4ab9d50ba4e3b4914cf94a0d971f0353", "strip_prefix": "sysroot", - "url": "https://github.com/eclipse-score/os_autosd/releases/download/v0.0.2/autosd-toolchain-aarch64.tar.gz", + "url": "https://github.com/eclipse-score/os_autosd/releases/download/v0.2.0/autosd-toolchain-aarch64.tar.gz", + }, + "aarch64-linux-autosd10-crossland": { + "build_file": "@score_bazel_cpp_toolchains//packages/linux/aarch64/autosd/10.0:autosd_cross.BUILD", + "extra_c_compile_flags": [ + "-nostdinc", + "-isystem", + "external/%{toolchain_pkg}%/x86_64/usr/lib/gcc/aarch64-redhat-linux/14/include", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include", + ], + "extra_cxx_compile_flags": [ + "-nostdinc++", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include/c++/14", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include/c++/14/aarch64-redhat-linux", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include/c++/14/backward", + "-nostdinc", + "-isystem", + "external/%{toolchain_pkg}%/x86_64/usr/lib/gcc/aarch64-redhat-linux/14/include", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include", + ], + "extra_link_flags": [ + "-B", + "external/%{toolchain_pkg}%/x86_64/usr/bin", + "-L", + "external/%{toolchain_pkg}%/x86_64/usr/lib/gcc/aarch64-redhat-linux/14", + "-L", + "external/%{toolchain_pkg}%/aarch64/lib64", + "-L", + "external/%{toolchain_pkg}%/aarch64/lib", + "-L", + "external/%{toolchain_pkg}%/aarch64/usr/lib64", + "-L", + "external/%{toolchain_pkg}%/aarch64/usr/lib", + "-lm", + "-ldl", + "-lrt", + "-lstdc++", + ], + "sha256": "c21025ddc5310c04d0203551ad1cbd1d60cc10842d91ca96c81dbdd9a2373a03", + "strip_prefix": "sysroot", + "url": "https://github.com/eclipse-score/os_autosd/releases/download/v0.2.0/autosd-toolchain-crossland.tar.gz", }, "aarch64-qnx-sdp_8.0.0": { "build_file": "@score_bazel_cpp_toolchains//packages/qnx/aarch64/sdp/8.0.0:sdp.BUILD", @@ -139,9 +184,9 @@ VERSION_MATRIX = { "-lrt", "-lstdc++", ], - "sha256": "25991056bd29d4cb37b11e42d0c09f55dc61d0b9d703f75d854cf614f688c96f", + "sha256": "1ab0d9760b6dfcc1aca0b22ef085c2e9ffc10ddaa049f992d560152900d4e775", "strip_prefix": "sysroot", - "url": "https://github.com/eclipse-score/os_autosd/releases/download/v0.0.2/autosd-toolchain-x86_64.tar.gz", + "url": "https://github.com/eclipse-score/os_autosd/releases/download/v0.2.0/autosd-toolchain-x86_64.tar.gz", }, "aarch64-linux-sdk_2.0.0-beta2-ebclfsa": { "build_file": "@score_bazel_cpp_toolchains//packages/linux/aarch64/ebclfsa/2.0.0-beta2:ebclfsa.BUILD", diff --git a/tests/.bazelrc b/tests/.bazelrc index fb80bfd..cb4ad1f 100644 --- a/tests/.bazelrc +++ b/tests/.bazelrc @@ -98,6 +98,13 @@ build:x86_64-linux-autosd10 --config=x86_64-linux build:x86_64-linux-autosd10 --platforms=@score_bazel_platforms//:x86_64-linux-autosd10 build:x86_64-linux-autosd10 --extra_toolchains=@score_autosd_10_toolchain//:x86_64-linux-autosd10 +# ------------------------------------------------------------------------------- +# Toolchain configuration for aarch64-linux-autosd10-crossland (target: aarch64, host: x86_64 cross) +# ------------------------------------------------------------------------------- +build:aarch64-linux-autosd10-crossland --config=x86_64-linux +build:aarch64-linux-autosd10-crossland --platforms=@score_bazel_platforms//:aarch64-linux-autosd10-crossland +build:aarch64-linux-autosd10-crossland --extra_toolchains=@score_autosd_10_cross_toolchain//:aarch64-linux-autosd10-crossland + # ------------------------------------------------------------------------------- # Config dedicated to target platform CPU:aarch64 and OS:ebclfsa # ------------------------------------------------------------------------------- diff --git a/tests/MODULE.bazel b/tests/MODULE.bazel index e5fc562..0bca1f7 100644 --- a/tests/MODULE.bazel +++ b/tests/MODULE.bazel @@ -194,6 +194,17 @@ gcc.toolchain( use_default_package = True, ) +# ******************************************************************************* +# Setting AutoSD 10 GCC cross (CPU:aarch64|OS:Linux|ES:autosd10-crossland, x86_64 host) +# ******************************************************************************* +gcc.toolchain( + name = "score_autosd_10_cross_toolchain", + runtime_ecosystem = "autosd10-crossland", + target_cpu = "aarch64", + target_os = "linux", + use_default_package = True, +) + # ******************************************************************************* # Setting EBcLfSA 2.0.0-beta2 GCC (CPU:aarch64|OS:Linux|V:ebclfsa-2.0.0-beta2|ES:ebclfsa) # ******************************************************************************* @@ -218,6 +229,7 @@ use_repo( "my_toolchain", "score_aarch64_gcc_toolchain", "score_aarch64_gcc_toolchain_15", + "score_autosd_10_cross_toolchain", "score_autosd_10_toolchain", "score_ebclfsa_2.0.0-beta2_toolchain", "score_ebclfsa_2.0.0-beta3_toolchain", diff --git a/tests/MODULE.bazel.lock b/tests/MODULE.bazel.lock index a5ca37b..d182a48 100644 --- a/tests/MODULE.bazel.lock +++ b/tests/MODULE.bazel.lock @@ -1400,8 +1400,8 @@ }, "@@score_bazel_cpp_toolchains+//extensions:gcc.bzl%gcc": { "general": { - "bzlTransitiveDigest": "yiKGkwXWPgQN1NFDCA5Y1j0TzFxp6ojsmf4Td5CzMpY=", - "usagesDigest": "6tdL3YzS2zo0EaIGu0SKjN8CkeJGfj+W3K0kk1VS/ec=", + "bzlTransitiveDigest": "nsbKejNA4VOLaazXnN2o7EG2He4yPLlWVRa7tJ7JK0Q=", + "usagesDigest": "BkOcTZ5iNKR+5duxzNN9Vybfv5/191KgNSvkoOHbhGE=", "recordedInputs": [ "REPO_MAPPING:,score_bazel_cpp_toolchains score_bazel_cpp_toolchains+", "REPO_MAPPING:bazel_tools,rules_cc rules_cc+", @@ -1557,7 +1557,7 @@ "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", "attributes": { "urls": [ - "https://github.com/eclipse-score/os_autosd/releases/download/v0.0.2/autosd-toolchain-x86_64.tar.gz" + "https://github.com/eclipse-score/os_autosd/releases/download/v0.2.0/autosd-toolchain-x86_64.tar.gz" ], "build_file": "@@score_bazel_cpp_toolchains+//packages/linux/x86_64/autosd/10.0:autosd.BUILD", "files": {}, @@ -1566,7 +1566,25 @@ "patch_strip": 0, "patch_tool": "", "patches": [], - "sha256": "25991056bd29d4cb37b11e42d0c09f55dc61d0b9d703f75d854cf614f688c96f", + "sha256": "1ab0d9760b6dfcc1aca0b22ef085c2e9ffc10ddaa049f992d560152900d4e775", + "strip_prefix": "sysroot", + "type": "" + } + }, + "score_autosd_10_cross_toolchain_pkg": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/eclipse-score/os_autosd/releases/download/v0.2.0/autosd-toolchain-crossland.tar.gz" + ], + "build_file": "@@score_bazel_cpp_toolchains+//packages/linux/aarch64/autosd/10.0:autosd_cross.BUILD", + "files": {}, + "patch_args": [], + "patch_cmds": [], + "patch_strip": 0, + "patch_tool": "", + "patches": [], + "sha256": "c21025ddc5310c04d0203551ad1cbd1d60cc10842d91ca96c81dbdd9a2373a03", "strip_prefix": "sysroot", "type": "" } @@ -1883,6 +1901,68 @@ "use_base_constraints_only": false } }, + "score_autosd_10_cross_toolchain": { + "repoRuleId": "@@score_bazel_cpp_toolchains+//rules:gcc.bzl%gcc_toolchain", + "attributes": { + "extra_compile_flags": [], + "extra_c_compile_flags": [ + "-nostdinc", + "-isystem", + "external/%{toolchain_pkg}%/x86_64/usr/lib/gcc/aarch64-redhat-linux/14/include", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include" + ], + "extra_cxx_compile_flags": [ + "-nostdinc++", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include/c++/14", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include/c++/14/aarch64-redhat-linux", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include/c++/14/backward", + "-nostdinc", + "-isystem", + "external/%{toolchain_pkg}%/x86_64/usr/lib/gcc/aarch64-redhat-linux/14/include", + "-isystem", + "external/%{toolchain_pkg}%/aarch64/usr/include" + ], + "extra_known_features": [], + "extra_enabled_features": [], + "extra_link_flags": [ + "-B", + "external/%{toolchain_pkg}%/x86_64/usr/bin", + "-L", + "external/%{toolchain_pkg}%/x86_64/usr/lib/gcc/aarch64-redhat-linux/14", + "-L", + "external/%{toolchain_pkg}%/aarch64/lib64", + "-L", + "external/%{toolchain_pkg}%/aarch64/lib", + "-L", + "external/%{toolchain_pkg}%/aarch64/usr/lib64", + "-L", + "external/%{toolchain_pkg}%/aarch64/usr/lib", + "-lm", + "-ldl", + "-lrt", + "-lstdc++" + ], + "license_info_variable": "", + "license_info_value": "", + "license_path": "/opt/score_qnx/license/licenses", + "sdk_version": "", + "sdp_version": "", + "tc_compiler_library_search_paths": [], + "tc_cpu": "aarch64", + "tc_identifier": "", + "tc_os": "linux", + "tc_pkg_repo": "score_autosd_10_cross_toolchain_pkg", + "tc_system_toolchain": false, + "tc_runtime_ecosystem": "autosd10-crossland", + "gcc_version": "", + "cc_toolchain_config": "@@score_bazel_cpp_toolchains+//templates:cc_toolchain_config.bzl.template", + "use_base_constraints_only": false + } + }, "score_ebclfsa_2.0.0-beta2_toolchain": { "repoRuleId": "@@score_bazel_cpp_toolchains+//rules:gcc.bzl%gcc_toolchain", "attributes": {