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
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ common:linux_x86_64_score_gcc_12_2_0_posix --extra_toolchains=@score_gcc_x86_64_
common:linux_aarch64_score_gcc_12_2_0_posix --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.0-posix
common:linux_aarch64_score_gcc_12_2_0_posix --extra_toolchains=@score_gcc_aarch64_toolchain//:aarch64-linux
common:linux_aarch64_score_gcc_12_2_0_posix --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_linux_gnu
# The score aarch64 GCC toolchain is built without --enable-default-pie, so static libs are non-PIC.
# -no-pie disables PIE; -lstdc++ links the C++ stdlib; -lgcc provides aarch64 outline atomic helpers
# (__aarch64_ldadd4_acq_rel etc.) from the toolchain's libgcc.a (sysroot's libgcc_s.so lacks them).
# ticket - https://github.com/eclipse-score/toolchains_rust/issues/27
common:linux_aarch64_score_gcc_12_2_0_posix --@rules_rust//:extra_rustc_flags=-Clink-arg=-no-pie,-Clink-arg=-lgcc

# In order to build for QNX, you need:
# * An account on qnx.com
Expand Down
2 changes: 2 additions & 0 deletions examples/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ common --registry=https://bcr.bazel.build
common --@score_baselibs//score/json:base_library=nlohmann

common --@score_communication//score/mw/com/flags:tracing_library=@score_baselibs//score/analysis/tracing/generic_trace_library/stub_implementation

common --@rules_rust//:extra_rustc_flags=-Clink-arg=-no-pie,-Clink-arg=-lgcc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is going in the wrong direction. We should instead enable PIC compatible builds.
From what I see the issues about relocation come from ACL.
Can you create a bugticket in baselibs, that the ACL library must be provided with -fPIC?

Copy link
Copy Markdown
Contributor Author

@bharatGoswami8 bharatGoswami8 Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not just ACL library issue, it is a score aarch64 GCC toolchain tool-chain issuw which build without --enable-default-pie.
Because if resolve in ACL next static library may have same kind of issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If keeping no-pie flag on tool-chain is not a ideal solution then we can move to user level - #361

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed created ticket for ACL lib in baselibs - eclipse-score/baselibs#172

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the linkage to gcc, we have to investigate further.
I'd first check whether bumping the toolchain version helps here. @nradakovic mentioned in a talk that they link libgcc. Maybe we are on a version that does not yet do that.
We need to look at the bazel subcommands to investigate.
Can you please do a bazel run with the flag -s and post the logs here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added logs in the mentioned ticket as a comment - #328 (comment)

1 change: 1 addition & 0 deletions examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local_path_override(

bazel_dep(name = "rules_cc", version = "0.1.5")
bazel_dep(name = "score_baselibs", version = "0.2.6")
bazel_dep(name = "rules_rust", version = "0.68.1-score")

# Only required to build the example, shall be replaceable with nearly every other C++ Toolchain setup
bazel_dep(name = "score_bazel_platforms", version = "0.1.2", dev_dependency = True)
Expand Down