From f8f501a2545d357d05591ef53688e8d3d6926818 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Mon, 9 Feb 2026 16:55:13 +0100 Subject: [PATCH 1/3] Add EBcLfSA Toolchain Added "aarch64-linux-gcc_13.3.0-ebclfsa", a GCC-based toolchain for EB corbos Linux for Safety Applications. This is *not* the final toolchain, since that will require a clang-based compiler and a special libc. --- examples/.bazelrc | 8 +++ examples/MODULE.bazel | 43 +++++++++++++ examples/README.md | 7 +++ packages/linux/aarch64/ebclfsa/0.1.0/BUILD | 16 +++++ .../linux/aarch64/ebclfsa/0.1.0/ebclfsa.BUILD | 62 +++++++++++++++++++ 5 files changed, 136 insertions(+) create mode 100644 packages/linux/aarch64/ebclfsa/0.1.0/BUILD create mode 100644 packages/linux/aarch64/ebclfsa/0.1.0/ebclfsa.BUILD diff --git a/examples/.bazelrc b/examples/.bazelrc index ee241d5..499f1a9 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -75,3 +75,11 @@ build:aarch64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-pos # ------------------------------------------------------------------------------- build:target_config_2 --config=aarch64-qnx build:target_config_2 --extra_toolchains=@score_qcc_arm_toolchain//:aarch64-qnx-sdp_8.0.0-posix + +# ------------------------------------------------------------------------------- +# Config dedicated to target platform CPU:aarch64 and OS:ebclfsa +# ------------------------------------------------------------------------------- +build:aarch64-ebclfsa --config=shared +build:aarch64-ebclfsa --platforms=@score_bazel_platforms//:aarch64-linux-gcc_13.3.0-ebclfsa +build:aarch64-ebclfsa --extra_toolchains=@score_ebclfsa_toolchain//:aarch64-linux-gcc_13.3.0-ebclfsa +build:aarch64-ebclfsa --spawn_strategy=local diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index 3aadc2e..49b418c 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -146,6 +146,48 @@ gcc.toolchain( use_default_package = True, ) +# ******************************************************************************* +# Setting EBcLfSA 0.1.0 GCC (CPU:aarch64|OS:Linux|V:ebclfsa-0.1.0|ES:ebclfsa) +# ******************************************************************************* +gcc.sdp( + name = "score_ebclfsa_toolchain_pkg", + url = "https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/download/0.5.0-beta/fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64.tar.gz", + strip_prefix = "fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64", + sha256 = "05b57bbc8d99d46df6b57f774c39a5a2664964ea7eb94147cbece08508c1f121", + build_file = "@score_bazel_cpp_toolchains//packages/linux/aarch64/ebclfsa/0.1.0:ebclfsa.BUILD", +) +gcc.toolchain( + name = "score_ebclfsa_toolchain", + sdp_to_link = "score_ebclfsa_toolchain_pkg", + target_os = "linux", + target_cpu = "aarch64", + runtime_ecosystem = "ebclfsa", + version = "13.3.0", + extra_c_compile_flags = [ + "-nostdinc", + "-isystem", "external/%{toolchain_pkg}%/usr/lib/gcc-cross/aarch64-linux-gnu/13/include", + "-isystem", "external/%{toolchain_pkg}%/usr/aarch64-linux-gnu/include", + ], + extra_cxx_compile_flags = [ + "-nostdinc++", + "-isystem", "external/%{toolchain_pkg}%/usr/aarch64-linux-gnu/include/c++/13", + "-isystem", "external/%{toolchain_pkg}%/usr/aarch64-linux-gnu/include/c++/13/aarch64-linux-gnu", + "-isystem", "external/%{toolchain_pkg}%/usr/aarch64-linux-gnu/include/c++/13/backward", + "-nostdinc", + "-isystem", "external/%{toolchain_pkg}%/usr/lib/gcc-cross/aarch64-linux-gnu/13/include", + "-isystem", "external/%{toolchain_pkg}%/usr/aarch64-linux-gnu/include", + ], + extra_link_flags = [ + "-lm", + "-ldl", + "-lrt", + "-static-libstdc++", + "-static-libgcc", + "-static", + "-no-canonical-prefixes" + ], +) + use_repo( gcc, "score_gcc_toolchain", @@ -154,4 +196,5 @@ use_repo( "score_qcc_toolchain", "score_qcc_arm_toolchain", "score_autosd_10_toolchain", + "score_ebclfsa_toolchain", ) \ No newline at end of file diff --git a/examples/README.md b/examples/README.md index fbbc619..2f1fd1f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -44,6 +44,13 @@ bazel build --config=target_config_3 //:main_cpp bazel build --config=target_config_3 //:main_pthread_cpp ``` +**Build for EB corbos Linux for Safety Applications (ARM64):** +```bash +bazel build --config=aarch64-ebclfsa //:main_cpp +bazel build --config=aarch64-ebclfsa //:main_pthread_cpp +bazel test --config=aarch64-ebclfsa //:math_lib_test # this works if you have qemu-user-static installed and configured correctly +``` + ### QNX Target Builds > **Note:** Take care of license requirements when using these toolchains and dependencies in your projects. diff --git a/packages/linux/aarch64/ebclfsa/0.1.0/BUILD b/packages/linux/aarch64/ebclfsa/0.1.0/BUILD new file mode 100644 index 0000000..82b4316 --- /dev/null +++ b/packages/linux/aarch64/ebclfsa/0.1.0/BUILD @@ -0,0 +1,16 @@ +# ******************************************************************************* +# Copyright (c) 2025 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 +# ******************************************************************************* + +exports_files([ + "ebclfsa.BUILD", +]) \ No newline at end of file diff --git a/packages/linux/aarch64/ebclfsa/0.1.0/ebclfsa.BUILD b/packages/linux/aarch64/ebclfsa/0.1.0/ebclfsa.BUILD new file mode 100644 index 0000000..f7be295 --- /dev/null +++ b/packages/linux/aarch64/ebclfsa/0.1.0/ebclfsa.BUILD @@ -0,0 +1,62 @@ +# ******************************************************************************* +# Copyright (c) 2025 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 EBcLfSA 0.1.0 toolchain package""" + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "all_files", + srcs = glob(["*/**/*"], exclude = ["usr/share/ca-certificates/**","usr/lib/ssl/certs/**", "lib/ssl/certs/**", "etc/ssl/certs/**", "usr/share/man/**", "var/lib/**"]), +) + +filegroup( + name = "bin", + srcs = ["usr/bin"], +) + +filegroup( + name = "ar", + srcs = ["usr/bin/aarch64-linux-gnu-ar"], +) + +filegroup( + name = "cc", + srcs = ["usr/bin/aarch64-linux-gnu-gcc-13.bin"], +) + +filegroup( + name = "gcov", + srcs = ["usr/bin/aarch64-linux-gnu-gcov-13"], +) + +filegroup( + name = "cxx", + srcs = ["usr/bin/aarch64-linux-gnu-g++-13.bin"], +) + +filegroup( + name = "strip", + srcs = ["usr/bin/aarch64-linux-gnu-strip"], +) + +filegroup( + name = "elf-enabler", + srcs = ["usr/bin/lisa-elf-enabler"], +) + +# The sysroot for EBcLfSA is the entire extracted directory +filegroup( + name = "sysroot_dir", + srcs = ["."], +) From 46bf9d1959f7ec42e3781dda46936e7daa48547f Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Mon, 9 Feb 2026 17:04:13 +0100 Subject: [PATCH 2/3] Add git_overrides until the related PR is merged --- MODULE.bazel | 5 +++++ examples/MODULE.bazel | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index 4bb76fa..293ec42 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -27,6 +27,11 @@ bazel_dep(name = "bazel_skylib", version = "1.8.1") # ******************************************************************************* bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "score_bazel_platforms", version = "0.0.2") +git_override( + module_name = "score_bazel_platforms", + commit = "ebe31e0f6bec98005d64f67e9d7567d9a2274d3c", + remote = "https://github.com/eclipse-score/bazel_platforms.git", +) # ******************************************************************************* # C++ Rules for Bazel diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index 49b418c..cb0517f 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -27,6 +27,12 @@ bazel_dep(name = "bazel_skylib", version = "1.8.2") bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "score_bazel_platforms", version = "0.0.4") +git_override( + module_name = "score_bazel_platforms", + commit = "ebe31e0f6bec98005d64f67e9d7567d9a2274d3c", + remote = "https://github.com/eclipse-score/bazel_platforms.git", +) + # ******************************************************************************* # C++ Rules for Bazel # ******************************************************************************* From 81275df68d1297314d1026f07525406b830616f8 Mon Sep 17 00:00:00 2001 From: Oliver Pajonk Date: Tue, 10 Feb 2026 16:42:27 +0100 Subject: [PATCH 3/3] here is where the elf-enabler needs to go --- rules/gcc.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/gcc.bzl b/rules/gcc.bzl index 69263f8..bfa133b 100644 --- a/rules/gcc.bzl +++ b/rules/gcc.bzl @@ -53,6 +53,7 @@ cc_toolchain_config( tc_cpu = rctx.attr.tc_cpu, tc_os = rctx.attr.tc_os, ) + #tc_elf_enabler = rctx.attr.tc_elf_enabler, def _get_cc_config_qnx(rctx): """ TODO: Write docstring