Skip to content

Commit d49d68d

Browse files
authored
Add EBcLfSA Toolchain (#28)
* Add EBcLfSA Toolchain Added "aarch64-linux-sdk_0.1.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. However, it can be used to demonstrate functionality. # Conflicts: # examples/MODULE.bazel # extensions/gcc.bzl * Switch to official pre-release 2.0.0-beta1 of EB corbos Toolkit
1 parent a00f6e6 commit d49d68d

File tree

21 files changed

+849
-34
lines changed

21 files changed

+849
-34
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
{
3+
"name": "eclipse-s-core",
4+
"image": "ghcr.io/eclipse-score/devcontainer:v1.2.0"
5+
}

examples/.bazelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ build:target_config_3 --extra_toolchains=@score_aarch64_gcc_toolchain//:aarch64-
6868
build:target_config_4 --config=host_config_1
6969
build:target_config_4 --platforms=@score_bazel_platforms//:x86_64-linux-autosd10
7070
build:target_config_4 --extra_toolchains=@score_autosd_10_toolchain//:x86_64-linux-autosd10
71+
72+
# -------------------------------------------------------------------------------
73+
# Config dedicated to target platform CPU:aarch64 and OS:ebclfsa
74+
# -------------------------------------------------------------------------------
75+
build:aarch64-ebclfsa --config=shared
76+
build:aarch64-ebclfsa --platforms=@score_bazel_platforms//:aarch64-linux-sdk_0.1.0-ebclfsa
77+
build:aarch64-ebclfsa --extra_toolchains=@score_ebclfsa_toolchain//:aarch64-linux-sdk_0.1.0-ebclfsa

examples/MODULE.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,24 @@ gcc.toolchain(
143143
target_os = "linux",
144144
use_default_package = True,
145145
)
146+
147+
# *******************************************************************************
148+
# Setting EBcLfSA 0.1.0 GCC (CPU:aarch64|OS:Linux|V:ebclfsa-0.1.0|ES:ebclfsa)
149+
# *******************************************************************************
150+
gcc.toolchain(
151+
name = "score_ebclfsa_toolchain",
152+
runtime_ecosystem = "ebclfsa",
153+
sdk_version = "0.1.0",
154+
target_cpu = "aarch64",
155+
target_os = "linux",
156+
use_default_package = True,
157+
)
146158
use_repo(
147159
gcc,
148160
"my_toolchain",
149161
"score_aarch64_gcc_toolchain",
150162
"score_autosd_10_toolchain",
163+
"score_ebclfsa_toolchain",
151164
"score_gcc_toolchain",
152165
"score_gcc_toolchain_bp",
153166
"score_qcc_arm_toolchain",

examples/MODULE.bazel.lock

Lines changed: 618 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ bazel build --config=target_config_3 //:main_cpp
4444
bazel build --config=target_config_3 //:main_pthread_cpp
4545
```
4646

47+
**Build for EB corbos Linux for Safety Applications (ARM64):**
48+
```bash
49+
bazel build --config=aarch64-ebclfsa //:main_cpp
50+
bazel build --config=aarch64-ebclfsa //:main_pthread_cpp
51+
bazel test --config=aarch64-ebclfsa //:math_lib_test # this works if you have qemu-user-static installed and configured correctly
52+
```
53+
4754
### QNX Target Builds
4855

4956
> **Note:** Take care of license requirements when using these toolchains and dependencies in your projects.

examples/test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ bazel build --config target_config_3 //:main_cpp
3333
bazel clean --expunge
3434
echo -e "Testing 'target_config_4' ..."
3535
bazel build --config target_config_4 //:main_cpp
36-
bazel clean --expunge
36+
bazel clean --expunge
37+
echo -e "Testing 'aarch64-ebclfsa' ..."
38+
bazel build --config aarch64-ebclfsa //:main_cpp
39+
bazel clean --expunge

extensions/gcc.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ _attrs_tc = {
140140
mandatory = False,
141141
doc = "Version of the GCC toolchain.",
142142
),
143+
"ld_library_paths": attr.string_list(
144+
mandatory = False,
145+
default = [],
146+
doc = "List of paths relative to the sysroot which should build up the runtime linker path of the tools of this toolchain.",
147+
),
143148
}
144149

145150
def _get_packages(tags):

packages/linux/aarch64/autosd/10.0/autosd.BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ filegroup(
5050
srcs = ["usr/bin/strip"],
5151
)
5252

53+
filegroup(
54+
name = "ld_library_paths",
55+
srcs = [],
56+
)
57+
5358
# The sysroot for AutoSD is the entire extracted directory
5459
# since it contains usr/ and lib64/ at the root
5560
filegroup(
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
exports_files([
15+
"ebclfsa.BUILD",
16+
])
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
"""Build file for EBcLfSA 0.1.0 toolchain package"""
15+
16+
package(default_visibility = ["//visibility:public"])
17+
18+
filegroup(
19+
name = "all_files",
20+
srcs = glob(["*/**/*"], exclude = ["usr/share/ca-certificates/**","usr/lib/ssl/certs/**", "lib/ssl/certs/**", "etc/ssl/certs/**", "usr/share/man/**", "usr/share/perl/**", "var/lib/**"]),
21+
)
22+
23+
filegroup(
24+
name = "bin",
25+
srcs = ["usr/bin"],
26+
)
27+
28+
filegroup(
29+
name = "ar",
30+
srcs = ["usr/bin/aarch64-linux-gnu-ar"],
31+
)
32+
33+
filegroup(
34+
name = "cc",
35+
srcs = ["usr/bin/aarch64-linux-gnu-gcc-13.bin"],
36+
)
37+
38+
filegroup(
39+
name = "gcov",
40+
srcs = ["usr/bin/aarch64-linux-gnu-gcov-13"],
41+
)
42+
43+
filegroup(
44+
name = "cxx",
45+
srcs = ["usr/bin/aarch64-linux-gnu-g++-13.bin"],
46+
)
47+
48+
filegroup(
49+
name = "strip",
50+
srcs = ["usr/bin/aarch64-linux-gnu-strip"],
51+
)
52+
53+
filegroup(
54+
name = "elf-enabler",
55+
srcs = ["usr/bin/lisa-elf-enabler"],
56+
)
57+
58+
filegroup(
59+
name = "ld_library_paths",
60+
srcs = ["usr/lib/x86_64-linux-gnu", "lib/x86_64-linux-gnu"],
61+
)
62+
63+
# The sysroot for EBcLfSA is the entire extracted directory
64+
filegroup(
65+
name = "sysroot_dir",
66+
srcs = ["."],
67+
)

0 commit comments

Comments
 (0)