mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
To prevent crashes during `exit` caused by SR-12668, avoid running static destructors. During testing, we do this by interposing `__cxa_exit` to prevent registration of destructors. This depends on the previous commit that disabled RTLD_DEEPBIND. In the sourcekit-lsp executable, since we control the exit points, we can make a less invasive change to just use `_Exit` instead of `exit` to avoid cleanups. This should hopefully fix the CI issues we have seen when testing with --parallel. rdar://61837752
20 lines
730 B
C
20 lines
730 B
C
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifdef __linux__
|
|
// For testing, override __cxa_atexit to prevent registration of static
|
|
// destructors due to SR-12668.
|
|
int __cxa_atexit(void (*f) (void *), void *arg, void *dso_handle) {
|
|
return 0;
|
|
}
|
|
#endif
|