This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Fix ASM building in llvm/runtimes
ClosedPublic

Authored by Hahnfeld on Aug 18 2016, 5:38 AM.

Details

Summary

When compiler-rt's CMake is not directly invoked, it will currently not call project() and thus ASM will not be enabled.
We also don't need to put the .S files through the C compiler then.

@kubabrecka Could you test under OS X with XCode? I don't have the hardware at hand to make sure that works...

Diff Detail

Event Timeline

Hahnfeld updated this revision to Diff 68516.Aug 18 2016, 5:38 AM
Hahnfeld retitled this revision from to [CMake] Fix ASM building in llvm/runtimes.
Hahnfeld updated this object.
Hahnfeld added reviewers: beanz, samsonov, kubamracek.
Hahnfeld added subscribers: llvm-commits, kubamracek.
beanz accepted this revision.Aug 18 2016, 11:28 AM
beanz edited edge metadata.

The Xcode generator doesn't work at all with the runtimes subdirectory (and I expect the same is true for Visual Studio). I haven't had a chance to figure out how to make it work correctly for IDEs yet, but that is on my TODO list. In the meantime, this patch LGTM.

This revision is now accepted and ready to land.Aug 18 2016, 11:28 AM

The Xcode generator doesn't work at all with the runtimes subdirectory (and I expect the same is true for Visual Studio). I haven't had a chance to figure out how to make it work correctly for IDEs yet, but that is on my TODO list. In the meantime, this patch LGTM.

And in projects or stand-alone? I saw that @kubabrecka added all these set_source_files_properties on the initial commit...

Xcode works fine in projects, which should be good enough. If @kubabrecka encounters issues we can solve them separately.

beanz added inline comments.Aug 18 2016, 1:54 PM
CMakeLists.txt
12

Actually, I do have one suggestion here. Make this:

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)

The runtimes subdirectory CMake file sets the *_STANDALONE_BUILD variable, so we can use it before it would be set in the normal standalone build.

Hahnfeld marked an inline comment as done.Aug 18 2016, 11:11 PM
Hahnfeld added inline comments.
CMakeLists.txt
12

Yes, I just saw your changes for libcxx and will do the change when commiting.

This revision was automatically updated to reflect the committed changes.
Hahnfeld marked an inline comment as done.

Xcode works fine in projects, which should be good enough. If @kubabrecka encounters issues we can solve them separately.

Green dragon complained, I'll leave it to Apple on how to properly resolve the ASM building for TSAN as I can't test that myself:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-globalisel_build/3645/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/23772/