Skip to content

Revert "[builtins] Disable COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY by d… #84580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ cmake_dependent_option(COMPILER_RT_BUILD_CRT "Build crtbegin.o/crtend.o" ON "COM
if (COMPILER_RT_BUILD_CRT)
add_compiler_rt_component(crt)

option(COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY "Use eh_frame in crtbegin.o/crtend.o" OFF)
option(COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY "Use eh_frame in crtbegin.o/crtend.o" ON)

include(CheckSectionExists)
check_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY
Expand Down
10 changes: 10 additions & 0 deletions compiler-rt/test/builtins/Unit/ctor_dtor.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,23 @@

// Ensure the various startup functions are called in the proper order.

// CHECK: __register_frame_info()
/// ctor() is here if ld.so/libc supports DT_INIT/DT_FINI
// CHECK: main()
/// dtor() is here if ld.so/libc supports DT_INIT/DT_FINI
// CHECK: __deregister_frame_info()

struct object;
static int counter;

void __register_frame_info(const void *fi, struct object *obj) {
printf("__register_frame_info()\n");
}

void __deregister_frame_info(const void *fi) {
printf("__deregister_frame_info()\n");
}

void __attribute__((constructor)) ctor() {
printf("ctor()\n");
++counter;
Expand Down