Skip to content
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/aarch64-ebclfsa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# *******************************************************************************
# 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
# *******************************************************************************
name: Bazel Build (Aarch64-Linux)(ebclfsa)
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
merge_group:
types: [checks_requested]
workflow_call:
jobs:
aarch64-ebclfsa:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./examples
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
disk-cache: ${{ github.job }}
repository-cache: true
cache-save: ${{ github.event_name == 'push' }}
- name: Bazel Build (basic)
run: |
bazel build --config aarch64-ebclfsa -- //:main_cpp
15 changes: 13 additions & 2 deletions examples/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions extensions/gcc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def _get_toolchains(tags):
"sdk_version": tag.sdk_version,
"sdp_to_link": tag.sdp_to_link,
"sdp_version": tag.sdp_version,
"tc_compiler_library_search_paths": [],
"tc_cpu": tag.target_cpu,
"tc_extra_c_compile_flags": tag.extra_c_compile_flags,
"tc_extra_compile_flags": tag.extra_compile_flags,
Expand Down Expand Up @@ -232,6 +233,8 @@ def _create_and_link_sdp(toolchain_info):
toolchain_info["tc_extra_link_flags"] = matrix["extra_link_flags"]
if "gcc_version" in matrix and not toolchain_info["gcc_version"]:
toolchain_info["gcc_version"] = matrix["gcc_version"]
if "compiler_library_search_paths" in matrix:
toolchain_info["tc_compiler_library_search_paths"] = matrix["compiler_library_search_paths"]

return {
"build_file": matrix["build_file"],
Expand Down Expand Up @@ -324,6 +327,7 @@ def _impl(mctx):
license_path = toolchain_info["tc_license_path"],
sdk_version = toolchain_info["sdk_version"],
sdp_version = toolchain_info["sdp_version"],
tc_compiler_library_search_paths = toolchain_info["tc_compiler_library_search_paths"],
tc_cpu = toolchain_info["tc_cpu"],
tc_identifier = toolchain_info["tc_identifier"],
tc_os = toolchain_info["tc_os"],
Expand Down
5 changes: 0 additions & 5 deletions packages/linux/aarch64/autosd/10.0/autosd.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ filegroup(
srcs = ["usr/bin/strip"],
)

filegroup(
name = "ld_library_paths",
srcs = [],
)

# The sysroot for AutoSD is the entire extracted directory
# since it contains usr/ and lib64/ at the root
filegroup(
Expand Down
18 changes: 12 additions & 6 deletions packages/linux/aarch64/ebclfsa/0.1.0/ebclfsa.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ 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/**", "usr/share/perl/**", "var/lib/**"]),
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/**",
],
),
)

filegroup(
Expand Down Expand Up @@ -55,11 +66,6 @@ filegroup(
srcs = ["usr/bin/lisa-elf-enabler"],
)

filegroup(
name = "ld_library_paths",
srcs = ["usr/lib/x86_64-linux-gnu", "lib/x86_64-linux-gnu"],
)

# The sysroot for EBcLfSA is the entire extracted directory
filegroup(
name = "sysroot_dir",
Expand Down
7 changes: 1 addition & 6 deletions packages/linux/aarch64/gcc/12.2.0/gcc.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ filegroup(
srcs = ["bin/aarch64-unknown-linux-gnu-strip"],
)

filegroup(
name = "ld_library_paths",
srcs = [],
)

filegroup(
name = "sysroot_dir",
srcs = ["aarch64-unknown-linux-gnu/sysroot"],
)
)
9 changes: 2 additions & 7 deletions packages/linux/x86_64/autosd/10.0/autosd.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ filegroup(
srcs = ["usr/bin/strip"],
)

filegroup(
name = "ld_library_paths",
srcs = [],
)

# The sysroot for AutoSD is the entire extracted directory
# since it contains usr/ and lib64/ at the root
filegroup(
Expand All @@ -67,10 +62,10 @@ filegroup(
filegroup(
name = "cxx_builtin_include_directories",
srcs = [
"usr/lib/gcc/x86_64-redhat-linux/14/include",
"usr/include",
"usr/include/c++/14",
"usr/include/c++/14/x86_64-redhat-linux",
"usr/include/c++/14/backward",
"usr/include/c++/14/x86_64-redhat-linux",
"usr/lib/gcc/x86_64-redhat-linux/14/include",
],
)
7 changes: 1 addition & 6 deletions packages/linux/x86_64/gcc/12.2.0/gcc.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ filegroup(
srcs = ["bin/x86_64-unknown-linux-gnu-strip"],
)

filegroup(
name = "ld_library_paths",
srcs = [],
)

filegroup(
name = "sysroot_dir",
srcs = ["x86_64-unknown-linux-gnu/sysroot"],
)
)
4 changes: 4 additions & 0 deletions packages/version_matrix.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ VERSION_MATRIX = {
"-static",
"--no-canonical-prefixes",
],
"compiler_library_search_paths": [
"external/%{toolchain_pkg}%/usr/lib/x86_64-linux-gnu",
"external/%{toolchain_pkg}%/lib/x86_64-linux-gnu",
],
"strip_prefix": "fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64",
"sha256": "f44286c28d831dc40acdac08ef49f38a2e9cbb057bea38c25834964693785287",
"url": "https://github.com/Elektrobit/eb_corbos_toolkit/releases/download/v2.0.0-beta1/fastdev-sdk-ubuntu-ebclfsa-ebcl-qemuarm64.tar.gz",
Expand Down
5 changes: 4 additions & 1 deletion rules/gcc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ cc_toolchain_config(
cxx_binary = "@{tc_pkg_repo}//:cxx",
gcov_binary = "@{tc_pkg_repo}//:gcov",
strip_binary = "@{tc_pkg_repo}//:strip",
ld_library_path_dirs = "@{tc_pkg_repo}//:ld_library_paths",
sysroot = "@{tc_pkg_repo}//:sysroot_dir",
target_cpu = "{tc_cpu}",
target_os = "{tc_os}",
Expand Down Expand Up @@ -157,8 +156,11 @@ def _impl(rctx):
extra_c_compile_flags = get_flag_groups(replace_placeholder(rctx.attr.extra_c_compile_flags))
extra_cxx_compile_flags = get_flag_groups(replace_placeholder(rctx.attr.extra_cxx_compile_flags))
extra_link_flags = get_flag_groups(replace_placeholder(rctx.attr.extra_link_flags))
compiler_library_search_paths = replace_placeholder(rctx.attr.tc_compiler_library_search_paths)

template_dict = {
"%{compiler_library_search_paths_switch}": "True" if len(rctx.attr.tc_compiler_library_search_paths) else "False",
"%{compiler_library_search_paths}": ":".join(["/proc/self/cwd/" + entry for entry in compiler_library_search_paths]),
"%{extra_c_compile_flags_switch}": "True" if len(rctx.attr.extra_c_compile_flags) else "False",
"%{extra_c_compile_flags}": extra_c_compile_flags,
"%{extra_compile_flags_switch}": "True" if len(rctx.attr.extra_compile_flags) else "False",
Expand Down Expand Up @@ -230,6 +232,7 @@ gcc_toolchain = repository_rule(
"license_path": attr.string(doc = "Lincese path"),
"sdk_version": attr.string(doc = "SDK version string"),
"sdp_version": attr.string(doc = "SDP version string"),
"tc_compiler_library_search_paths": attr.string_list(doc = "Additional search path which compiler needs."),
"tc_cpu": attr.string(doc = "Target platform CPU."),
"tc_identifier": attr.string(doc = "Constraint to be used for toolchain definition (e.g. gcc_12.2.0)."),
"tc_os": attr.string(doc = "Target platform OS."),
Expand Down
37 changes: 16 additions & 21 deletions templates/linux/cc_toolchain_config.bzl.template
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ def _impl(ctx):
strip_action,
]

# Set LD_LIBRARY_PATH environment variable for all actions
# This is needed by some toolchains since these libraries are not in `rpath` of compiler binary
# which are needed to run it.
compiler_library_search_paths = "%{compiler_library_search_paths}"
compiler_library_search_paths_feature = feature(
name = "compiler_library_search_paths",
enabled = %{compiler_library_search_paths_switch},
env_sets = [
env_set(
actions = all_actions,
env_entries = [env_entry(key = "LD_LIBRARY_PATH", value = compiler_library_search_paths)] if compiler_library_search_paths != "" else [],
),
],
)

unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
Expand Down Expand Up @@ -617,6 +632,7 @@ def _impl(ctx):
# after a command line parameter from a feature at the beginning of the list.

features = [
compiler_library_search_paths_feature,
sanitizer_feature,
asan_feature,
lsan_feature,
Expand Down Expand Up @@ -657,26 +673,6 @@ def _impl(ctx):
if ctx.attr.sysroot != None:
sysroot = ctx.attr.sysroot[DefaultInfo].files.to_list()[0].path

# Get ld_library_paths from attribute if provided and set LD_LIBRARY_PATH environment variable for actions
if hasattr(ctx.attr, "ld_library_path_dirs") and ctx.attr.ld_library_path_dirs and ctx.attr.ld_library_path_dirs[DefaultInfo].files.to_list():
values = ["/proc/self/cwd/" + entry.path for entry in ctx.attr.ld_library_path_dirs[DefaultInfo].files.to_list()]
ld_library_path = ":".join(values)

sdk_env_feature = feature(
name = "sdk_env",
enabled = True,
env_sets = [
env_set(
actions = all_actions,
env_entries = [
env_entry(key = "LD_LIBRARY_PATH", value = ld_library_path),
],
),
],
)

features.append(sdk_env_feature)

return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
abi_version = "%{tc_abi_version}",
Expand Down Expand Up @@ -709,6 +705,5 @@ cc_toolchain_config = rule(
"host_dir": attr.label(default = None),
"target_dir": attr.label(default = None),
"cxx_builtin_include_directories": attr.label(allow_files = True, default = None),
"ld_library_path_dirs": attr.label(allow_files = True, default = None),
},
)
Loading