Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ABSL to tip #384

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Update ABSL to tip #384

merged 1 commit into from
Sep 4, 2024

Conversation

carlocab
Copy link
Contributor

This should hopefully fix the failing build.

@carlocab
Copy link
Contributor Author

Nope, this doesn't work:

: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -W -Wall -Wno-sign-compare -fdiagnostics-color=always -O2 -g1 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/bloaty.dir/src/main.cc.o -o bloaty  liblibbloaty.a  third_party/protobuf/cmake/libprotoc.a  third_party/re2/libre2.a  third_party/capstone/libcapstone.a  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libz.tbd  third_party/abseil-cpp/absl/strings/libabsl_strings.a  third_party/protobuf/cmake/libprotobuf.a  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libz.tbd  third_party/abseil-cpp/absl/strings/libabsl_strings_internal.a  third_party/abseil-cpp/absl/strings/libabsl_string_view.a  third_party/abseil-cpp/absl/base/libabsl_base.a  third_party/abseil-cpp/absl/base/libabsl_spinlock_wait.a  third_party/abseil-cpp/absl/numeric/libabsl_int128.a  third_party/abseil-cpp/absl/base/libabsl_throw_delegate.a  third_party/abseil-cpp/absl/types/libabsl_bad_optional_access.a  third_party/abseil-cpp/absl/base/libabsl_raw_logging_internal.a  third_party/abseil-cpp/absl/base/libabsl_log_severity.a && :
Undefined symbols for architecture arm64:
  "absl::debugging_internal::Demangle(char const*, char*, unsigned long)", referenced from:
      bloaty::ItaniumDemangle(std::__1::basic_string_view<char, std::__1::char_traits<char>>, bloaty::DataSource) in liblibbloaty.a[2](bloaty.cc.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The call site seems fine:

bloaty/src/bloaty.cc

Lines 181 to 182 in 6b78e08

if (absl::debugging_internal::Demangle(demangle_from.data(), demangled,
sizeof(demangled))) {

So I suspect we just need to link the right absl library.

@haberman
Copy link
Member

Is it possible that we're just missing a lib in the list of libs here?

bloaty/CMakeLists.txt

Lines 313 to 315 in 6b78e08

list(APPEND LIBBLOATY_LIBS absl::strings)
list(APPEND LIBBLOATY_LIBS absl::optional)
list(APPEND LIBBLOATY_LIBS Threads::Threads)

@carlocab
Copy link
Contributor Author

carlocab commented Aug 27, 2024

Yes, I think so. Added absl::demangle_internal to the list of libraries that need to be linked.

Edit: nope, that error was just from picking up a separate Abseil install on my system. This PR builds fine for me now. Please have a look, @haberman.

@carlocab
Copy link
Contributor Author

Note that the update to Abseil is not needed to fix anything, but I kept it anyway since it doesn't seem to hurt. Happy to back out that change if needed.

@carlocab
Copy link
Contributor Author

carlocab commented Aug 27, 2024

Windows is still broken, but everything else seems to work now.

Don't know anything about Windows unfortunately. I'll try to dig into it tomorrow.

I also wonder if dropping the Abseil update and keeping only the change to CMakeLists.txt will be enough to fix Windows.

@Oyyko
Copy link

Oyyko commented Aug 28, 2024

Only Adding list(APPEND LIBBLOATY_LIBS absl::demangle_internal) works for me (Ubuntu 20.04 x86-64). Thanks!

@carlocab
Copy link
Contributor Author

Windows CI should be good at #385.

@carlocab
Copy link
Contributor Author

Looks like #385 worked.

Would still be nice to update Abseil to tip anyway, but I'm not sure how to fix the Windows errors...

@carlocab
Copy link
Contributor Author

@haberman, this should be good to go too: https://github.com/carlocab/bloaty/actions/runs/10594891815

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.

3 participants