summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2019-09-13 17:31:22 +0000
committerDan Liew <dan@su-root.co.uk>2019-09-13 17:31:22 +0000
commit4b0918f3e49d407a821d573a3aa41e77a8cfb442 (patch)
tree2c9ac1dfc087a8d4d1694473dd7f2845b4ee0078 /include
parentb83f360f7e249afbc59a20dc81845ac776079f0a (diff)
downloadcompiler-rt-4b0918f3e49d407a821d573a3aa41e77a8cfb442.tar.gz
[CMake] Separate the detection Darwin platforms architectures for the
built-ins from the rest of compiler-rt. The detection of supported platform (os) architectures for Darwin relies on the `darwin_test_archs()` CMake function. This is used both for building the builtins (`builtin-config-ix.cmake`) and for the rest of the compiler-rt (`config-ix.cmake`). `darwin_test_archs()` implements a cache, presumably to speed up CMake re-configures. Unfortunately this caching is buggy because it depends on external global state (i.e. the `TEST_COMPILE_ONLY` variable) and this is not taken into account. For `config-ix.cmake` `TEST_COMPILE_ONLY` is not set and for `builtin-config-ix.cmake` `TEST_COMPILE_ONLY` is set to `On`. This makes the `darwin_test_archs()` function racey in the sense that a call from one calling context will poison the cache for the other calling context. This is actually an issue George Karpenkov discovered a while back and had an incomplete patch for (https://reviews.llvm.org/D45337) but this was never merged. To workaround this, this patch switches to using a different set of variables for the platform architecture builtins, i.e. `DARWIN_<OS>_ARCHS` -> `DARWIN_<OS>_BUILTIN_ARCHS`. This avoids the cache poisoning problem because the cached variable names are different. This also has the advantage that the the configured architectures for builtins and the rest of the compiler-rt are now independent and can be set differently if necessary. Note in `darwin_test_archs()` we also now pass `-w` to the compiler because `try_compile_only()` treats compiler warnings as errors. This was extremely fragile because compiler warnings (can easily appear due to a buggy compiler or SDK headers) would cause compiler-rt to think an architecture on Darwin wasn't supported. rdar://problem/48637491 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions