Page MenuHomePhabricator

[orc][cmake] Check if 8 byte atomics require libatomic for unittest
ClosedPublic

Authored by sdardis on Dec 8 2017, 7:57 AM.

Details

Summary

rL319838 introduced SymbolStringPool which uses 8 byte atomics for
reference counters. On systems which do not support such atomics
natively such as MIPS32, explicitly add libatomic as one of the
libraries for SymbolStringPool's unittest.

Diff Detail

Repository
rL LLVM

Event Timeline

sdardis created this revision.Dec 8 2017, 7:57 AM
beanz added a comment.Dec 18 2017, 4:44 PM

I'm going to nitpick here a little. The patch is fine, but one of two things should change. Either line 29 should use list(APPEND...) instead of set, or you should do something more like:

if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
  set(ORC_TEST_ATOMIC_LIB atomic)
endif()

target_link_libraries(OrcJITTests PRIVATE ${LLVM_PTHREAD_LIB} ${ORC_TEST_ATOMIC_LIB})
sdardis updated this revision to Diff 127512.Dec 19 2017, 5:57 AM
sdardis set the repository for this revision to rL LLVM.

Address nit.

beanz accepted this revision.Dec 19 2017, 9:41 AM

LGTM

This revision is now accepted and ready to land.Dec 19 2017, 9:41 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the review @beanz .