This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt/mac]: use DARWIN_osx_SYSROOT to set OSX_SYSROOT_FLAG
Needs ReviewPublic

Authored by thakis on Feb 18 2021, 8:16 AM.

Details

Summary

No behavior change, and less code.

While here, also un-bitrot the libc++ header copy suggestion a bit.

Diff Detail

Event Timeline

thakis created this revision.Feb 18 2021, 8:16 AM
thakis requested review of this revision.Feb 18 2021, 8:16 AM
delcypher added inline comments.Feb 18 2021, 4:09 PM
compiler-rt/cmake/base-config-ix.cmake
104

Can we actually remove this? This file is actually included in two places.

$ git grep base-config-ix
CMakeLists.txt:include(base-config-ix)
lib/builtins/CMakeLists.txt:  include(base-config-ix)

It seems the builtins directory can be used for a standalone build. I'm not entirely sure who is using this but I suspect if you remove this code you'd probably break the standalone builtin build because it doesn't include config-ix.cmake.

kubamracek added inline comments.Feb 19 2021, 7:35 AM
compiler-rt/cmake/config-ix.cmake
372

config-ix does a bunch of compilation attempts and flag detection above this point. I assume you've tested the change and it works fine, but I'm wondering how come that the these compilations don't need this option already set?

kubamracek added inline comments.
compiler-rt/cmake/base-config-ix.cmake
104

This is a good point. @steven_wu @arphaman ?

steven_wu added inline comments.Feb 19 2021, 9:38 AM
compiler-rt/cmake/base-config-ix.cmake
104

Sounds like a valid point. It is hard to reason about compiler_rt cmake. Might want to test all our build configurations to make sure this still works.

I tested this in a "normal" build. Should I test anything exotic? (I can't test the apple-internal things, obvsly.)

compiler-rt/cmake/config-ix.cmake
372

I guess none of them include c++ stdlib headers.

kubamracek added inline comments.Feb 19 2021, 10:00 AM
compiler-rt/cmake/config-ix.cmake
372

The -isysroot flag is needed even for C headers. And for example test_targets() about 200 lines above is test-compiling and using stdlib.h+stdio.h.