Skip to content

Add Abseil as libtego's dependency to fix linker errors#183

Closed
dllud wants to merge 1 commit intoblueprint-freespeech:mainfrom
dllud:abseil-dep
Closed

Add Abseil as libtego's dependency to fix linker errors#183
dllud wants to merge 1 commit intoblueprint-freespeech:mainfrom
dllud:abseil-dep

Conversation

@dllud
Copy link
Copy Markdown

@dllud dllud commented Feb 12, 2024

ricochet-refresh's build is failing with a DSO missing from command line error, on Arch Linux (binutils 2.42), when liking the final binary.

/usr/bin/ld: ../libtego/libtego.a(ControlChannel.pb.cc.o): undefined reference to symbol '_ZN4absl12lts_2023080212log_internal17MakeCheckOpStringIllEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc'
/usr/bin/ld: /usr/lib/libabsl_log_internal_check_op.so.2308.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [ricochet-refresh/CMakeFiles/ricochet-refresh.dir/build.make:440: ricochet-refresh/ricochet-refresh/ricochet-refresh] Error 1
make[1]: *** [CMakeFiles/Makefile2:363: ricochet-refresh/CMakeFiles/ricochet-refresh.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

libabsl_log_internal_check_op.so is needed to build libtego.a because protobuf depends on it. Setting the linker flags to -Wl,--copy-dt-needed-entries as I did on the AUR PKGBUILD works around the issue. However it goes against the now default behaviour of binutils of not recursively fetching dependencies for libs when linking.

Adding an explicit link to Abseil as I am doing in this PR fixes the error in the manner binutils now deems proper. On the other hand, it makes libtego build files depend on the internals of protobuf. As such I am unsure if this is the proper way to go. Reviews and comments are gladly welcomed.

ricochet-refresh's build fails with a "DSO missing from command line"
error, on Arch Linux (binutils 2.42), when liking the final binary.
libabsl_log_internal_check_op.so is needed to build libtego.a because
protobuf depends on it. Setting the linker flags to
"-Wl,--copy-dt-needed-entries" works around the issue but goes against
the now default behaviour of binutils of not recursively fetching
dependencies for libs when linking. Adding this explicit link to Abseil
fixes the error in the proper manner but makes libtego build depend on
the internals of protobuf.
Copy link
Copy Markdown
Member

@morganava morganava left a comment

Choose a reason for hiding this comment

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

So official builds are using an older version of protobuf (3.21.12) to avoid this abseil problem. Making it a REQUIRED package won't work.

We can take this if it is modified to make it conditional on the version of protobuf found (ie make abseil a required dependency if protobuf 3.22 or greater is found).

@morganava
Copy link
Copy Markdown
Member

Alternatively, we can leave the abseil check if we update ricochet-build to build with a newer protobuf dependency that includes abseil.

@morganava morganava closed this May 30, 2025
@dllud
Copy link
Copy Markdown
Author

dllud commented Jun 2, 2025

Build still fails with protobuf ≥ 3.22 without -Wl,--copy-dt-needed-entries.
I guess this PR was closed to keep the PR list tidy.
Should I open an issue to keep tracking this problem?

@morganava
Copy link
Copy Markdown
Member

@dllud we'll be switching to an entirely Rust implementation of the Ricochet-Refresh v3 protocol in the coming months, so this abseill problem will go away after this switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants