
On Linux crt is typically use in combination with builtins. In the Clang driver the use of builtins and crt is controlled by the --rtlib option. Both builtins and crt also have similar build requirements where they need to be built before any other runtimes and must avoid dependencies. We also want builtins and crt these to be buildable separately from the rest of compiler-rt for bootstrapping purposes. Given how simple crt is, rather than maintaining a separate directory with its own separate build setup, it's more efficient to just move crt into builtins. We still use separate CMake option to control whether to built crt same as before. This is an alternative to D89492 and D136664. Differential Revision: https://reviews.llvm.org/D153989
23 lines
890 B
C
23 lines
890 B
C
//===-- crtend.c - End of constructors and destructors --------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include <stdint.h>
|
|
|
|
// Put 4-byte zero which is the length field in FDE at the end as a terminator.
|
|
const int32_t __EH_FRAME_LIST_END__[]
|
|
__attribute__((section(".eh_frame"), aligned(sizeof(int32_t)),
|
|
visibility("hidden"), used)) = {0};
|
|
|
|
#ifndef CRT_HAS_INITFINI_ARRAY
|
|
typedef void (*fp)(void);
|
|
fp __CTOR_LIST_END__[]
|
|
__attribute__((section(".ctors"), visibility("hidden"), used)) = {0};
|
|
fp __DTOR_LIST_END__[]
|
|
__attribute__((section(".dtors"), visibility("hidden"), used)) = {0};
|
|
#endif
|