This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Try to fix standalone build on armv7
ClosedPublic

Authored by rovka on Aug 5 2022, 2:21 AM.

Details

Summary

When linking scudo standalone on armv7, it can't find symbols related to
unwinding (e.g. __aeabi_unwind_cpp_pr0). This is probably because it
is passing --unwindlib=none. This patch hacks around the issue by adding
COMPILER_RT_UNWINDER_LINK_LIBS if we're using the LLVM unwinder.

I don't know anything about scudo, so I'm not sure what the original
intention was.

This is a release blocker.
See also https://github.com/llvm/llvm-project/issues/56900

Diff Detail

Event Timeline

rovka created this revision.Aug 5 2022, 2:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 2:21 AM
rovka requested review of this revision.Aug 5 2022, 2:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2022, 2:21 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
phosek accepted this revision.Aug 5 2022, 10:21 AM

This looks like a correct fix to me, thank you for looking into it.

compiler-rt/lib/scudo/standalone/CMakeLists.txt
138–140

You should be able to set this unconditionally since COMPILER_RT_UNWINDER_LINK_LIBS is already set (or unset) based on the content of COMPILER_RT_USE_LLVM_UNWINDER (in the future it might also expand to -lgcc on other platforms).

This revision is now accepted and ready to land.Aug 5 2022, 10:21 AM
rovka added inline comments.Aug 8 2022, 1:22 AM
compiler-rt/lib/scudo/standalone/CMakeLists.txt
138–140

Makes sense, thanks for the quick review!

This revision was automatically updated to reflect the committed changes.