Skip to content

Commit

Permalink
remove --as-needed propagated flag from backward-ros in order to avoi…
Browse files Browse the repository at this point in the history
…d stressing the linker
  • Loading branch information
liarokapisv authored and lopsided98 committed Jan 1, 2025
1 parent 1dd9d25 commit df658f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions distros/ros2-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ rosSelf: rosSuper: with rosSelf.lib; {
'';
});

backward-ros = rosSuper.backward-ros.overrideAttrs ({ postPatch ? "", ... }: {

# The `--as-needed` flag directs the linker to search all libraries specified
# during its invocation to identify which ones contain the symbols required by the binary.
#
# Due to the nixpkgs binutils wrapper and the reliance to `propagatedBuildInputs`,
# the overlay often propagates an excessive number of libraries.
#
# As a result, the `--as-needed` flag can significantly increase the time the linker
# spends searching through these libraries, potentially causing builds to fail to complete.

postPatch = postPatch + ''
sed '/-Wl,--as-needed/d' -i cmake/BackwardConfigAment.cmake
'';
});

cyclonedds = rosSuper.cyclonedds.overrideAttrs ({
cmakeFlags ? [], ...
}: {
Expand Down

0 comments on commit df658f7

Please sign in to comment.