This is an archive of the discontinued LLVM Phabricator instance.

[libunwind][mips] Include gcc_s for linkage
ClosedPublic

Authored by smaksimovic on Aug 3 2018, 5:10 AM.

Details

Summary

When compiling with optimizations, mips requires various helper routines(__ashldi3 and the like) contained in libgcc_s.
Conditionally include libgcc_s in the set of libraries to be linked to.

Diff Detail

Repository
rL LLVM

Event Timeline

smaksimovic created this revision.Aug 3 2018, 5:10 AM
atanasyan accepted this revision.Aug 14 2018, 10:34 PM

LGTM from MIPS point of view.

This revision is now accepted and ready to land.Aug 14 2018, 10:34 PM
joerg added a subscriber: joerg.Aug 15 2018, 6:14 AM

This hard-coding seems to be counter-productive, it could be compiler-rt just as well.

@joerg Would it be okay to commit this?
The LIBUNWIND_HAS_GCC_S_LIB although declared, did not have its value used anywhere unlike LIBUNWIND_HAS_C_LIB and LIBUNWIND_HAS_DL_LIB which had been declared/used similarly.
The added line is only executed if the following block is (cmake/config-ix.cmake):

if (NOT LIBUNWIND_USE_COMPILER_RT)
  check_library_exists(gcc_s __gcc_personality_v0 "" LIBUNWIND_HAS_GCC_S_LIB)
endif()

in which case compiler-rt is not being used anyway, if that's what you were referring to.

joerg added a comment.Aug 16 2018, 4:49 AM

If a build against compiler-rt works, that's ok. It wasn't clear from the diff.

This revision was automatically updated to reflect the committed changes.