This is an archive of the discontinued LLVM Phabricator instance.

[Zorg] Use CMAKE_ASM_FLAGS with compiler-rt.
ClosedPublic

Authored by danalbert on Oct 15 2018, 2:59 PM.

Details

Summary

Right now this script works because add_compiler_rt_object_libraries
unconditionally adds CMAKE_CXX_FLAGS to every target, even though
CMake will do this automatically for C++ files. Doing this breaks
when using -Werror=unused-command-line-argument and when
CMAKE_CXX_FLAGS contains flags that are not valid for building C or
assembly code (like -stdlib).

This change is needed because I'm changing the default -stdlib for
Android, and this build needs to use an explicit stdlib to revert to
the old behavior since it uses an old NDK.

This change needs to land in four parts:

  1. This change: use CMAKE_ASM_FLAGS.
  2. Remove the explicit CMAKE_CXX_FLAGS from add_compiler_rt_object_libraries.
  3. Reland the change to use an explicit -stdlib.
  4. Reland the change to make Android default to -stdlib=libc++.

Diff Detail

Repository
rL LLVM

Event Timeline

danalbert created this revision.Oct 15 2018, 2:59 PM
danalbert updated this revision to Diff 169767.Oct 15 2018, 4:09 PM

Accidentally uploaded the patch with an underlying revert that included step 2. Pulled that out.

eugenis accepted this revision.Oct 16 2018, 9:03 AM

LGTM

This revision is now accepted and ready to land.Oct 16 2018, 9:03 AM
This revision was automatically updated to reflect the committed changes.