mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Moved the _gCRAnnotations declarations to their own object module, which will help to avoid duplicate symbol problems (at least with .a files). Also tweaked things to make it so that the demangler and runtime versions of the message setting code will interoperate (and so that they'll interoperate better with other implementations that might creep in from somewhere, like the one in LLVMSupport). rdar://91095592
36 lines
1.3 KiB
C++
36 lines
1.3 KiB
C++
//===--- CrashReporter.cpp - Crash Reporter integration ---------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2022 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Declares gCRAnnotations. This lets us link with other static libraries
|
|
// that also declare gCRAnnotations, because we'll pull in their copy
|
|
// (assuming they're linked first).
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "swift/Runtime/Debug.h"
|
|
|
|
#if SWIFT_HAVE_CRASHREPORTERCLIENT
|
|
|
|
// Instead of linking to CrashReporterClient.a (because it complicates the
|
|
// build system), define the only symbol from that static archive ourselves.
|
|
//
|
|
// The layout of this struct is CrashReporter ABI, so there are no ABI concerns
|
|
// here.
|
|
extern "C" {
|
|
SWIFT_LIBRARY_VISIBILITY
|
|
struct crashreporter_annotations_t gCRAnnotations __attribute__((
|
|
__section__("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION))) = {
|
|
CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0, 0};
|
|
}
|
|
|
|
#endif
|