diff --git a/.bazelrc b/.bazelrc index b8c89491d..b596dcc95 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/examples/.bazelrc b/examples/.bazelrc index 4136f3964..e20c021ed 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -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 diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index 8f9c26b3d..8454d4db5 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -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)