Page MenuHomePhabricator

[compiler-rt][CMake] Fix configuration on PowerPC with sanitizers
ClosedPublic

Authored by Hahnfeld on Sep 26 2017, 6:44 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld created this revision.Sep 26 2017, 6:44 AM
alekseyshl edited edge metadata.Sep 27 2017, 7:46 PM

I wonder what's the error message?

cmake/base-config-ix.cmake
153 ↗(On Diff #116660)

cmake_push_check_state()

157 ↗(On Diff #116660)

cmake_pop_check_state()

Hahnfeld marked 2 inline comments as done.Sep 28 2017, 6:50 AM

The error with -DLLVM_USE_SANITIZER=Address is

-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for stddef.h
-- Looking for stddef.h - not found
-- Check size of unsigned short
-- Check size of unsigned short - failed
-- Check size of unsigned int
-- Check size of unsigned int - failed
-- Check size of unsigned long
-- Check size of unsigned long - failed
CMake Error at <...>/cmake/share/cmake-3.5/Modules/TestBigEndian.cmake:51 (message):
  no suitable type found
Call Stack (most recent call first):
  projects/compiler-rt/cmake/base-config-ix.cmake:151 (TEST_BIG_ENDIAN)
  projects/compiler-rt/cmake/config-ix.cmake:138 (test_targets)
  projects/compiler-rt/CMakeLists.txt:99 (include)

The reason is that the compile tests are performed with -fsanitize=address -nodefaultlibs. This gives a lot of undefined references because the runtime dependencies aren't linked in.

Hahnfeld updated this revision to Diff 116977.Sep 28 2017, 6:51 AM
Hahnfeld retitled this revision from [compiler-rt}[CMake] Fix configuration on PowerPC with sanitizers to [compiler-rt][CMake] Fix configuration on PowerPC with sanitizers.
Hahnfeld added a subscriber: gtbercea.
alekseyshl accepted this revision.Sep 28 2017, 2:08 PM
This revision is now accepted and ready to land.Sep 28 2017, 2:08 PM
This revision was automatically updated to reflect the committed changes.
alekseyshl added inline comments.Sep 29 2017, 8:59 AM
compiler-rt/trunk/cmake/base-config-ix.cmake
154

Oh, right, it should be:

string(REPLACE "-nodefaultlibs" "" CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})

Hahnfeld added inline comments.Sep 29 2017, 9:13 AM
compiler-rt/trunk/cmake/base-config-ix.cmake
154

Sorry! Thanks for fixing it so fast, my git-svn just told me that I'm out of sync!