summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/crt
Commit message (Collapse)AuthorAgeFilesLines
* Check for aarch64 when not using .init_arraysSterling Augustine2020-01-021-2/+2
| | | | | | | | | | Reviewers: vvereschaka Subscribers: kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D72005
* Support powerpc and sparc when building without init_array.Sterling Augustine2019-12-271-7/+25
| | | | | | | | | | | | Summary: Support powerpc and sparc when building without init_array. Reviewers: rdhindsa, gribozavr Subscribers: jyknight, nemanjai, fedor.sergeev, jsji, shchenz, steven.zhang, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71944
* Revert "Support powerpc when builing without init_array."Dmitri Gribenko2019-12-191-17/+3
| | | | | This reverts commit 5789e83dedb97588ad75cca36d01ba6c5142d6d3. It broke the build on aarch64.
* Support powerpc when builing without init_array.Sterling Augustine2019-12-181-3/+17
| | | | | | | | | | Summary: Also add an error case when targetting an unimplement architecture. Subscribers: nemanjai, jsji, shchenz, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71670
* Fix include guard and properly order __deregister_frame_info.Sterling Augustine2019-11-122-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes two problems with the crtbegin.c as written: 1. In do_init, register_frame_info is not guarded by a #define, but in do_fini, deregister_frame_info is guarded by #ifndef CRT_HAS_INITFINI_ARRAY. Thus when CRT_HAS_INITFINI_ARRAY is not defined, frames are registered but then never deregistered. The frame registry mechanism builds a linked-list from the .so's static variable do_init.object, and when the .so is unloaded, this memory becomes invalid and should be deregistered. Further, libgcc's crtbegin treats the frame registry as independent from the initfini array mechanism. This patch fixes this by adding a new #define, "EH_USE_FRAME_INFO_REGISTRY", which is set by the cmake option COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY Currently, do_init calls register_frame_info, and then calls the binary's constructors. This allows constructors to safely use libunwind. However, do_fini calls deregister_frame_info and then calls the binary's destructors. This prevents destructors from safely using libunwind. This patch also switches that ordering, so that destructors can safely use libunwind. As it happens, this is a fairly common scenario for thread sanitizer.
* [compiler-rt][crt] make test case nontrivial in check_cxx_section_existsJian Cai2019-09-161-1/+1
| | | | | | | | | | | | | | | | | | Summary: .init_array gets optimized away when building with -O2 and as a result, check_cxx_section_exists failed to pass -DCOMPILER_RT_HAS_INITFINI_ARRAY when building crtbegin.o and crtend.o, which causes binaries linked with them encounter segmentation fault. See https://crbug.com/855759 for details. This change prevents .init_array section to be optimized away even with -O2 or higher optimization level. Subscribers: dberris, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67628 llvm-svn: 372038
* [compiler-rt][crt] Pass -fno-lto in check_cxx_section_existsHans Wennborg2019-08-201-0/+1
| | | | | | | | | Otherwise it doesn't work when building with -DLLVM_ENABLE_LTO=thin (We hit this in Chromium in https://bugs.chromium.org/p/chromium/issues/detail?id=966403) llvm-svn: 369336
* Use CMAKE_C_COMPILER_ARG1 in compiler invocationPetr Hosek2019-05-191-2/+2
| | | | | | | | | This is needed when using compiler wrappers such as ccache or distcc and should address the failure on clang-x86_64-debian-fast bot. Differential Revision: https://reviews.llvm.org/D62104 llvm-svn: 361111
* [compiler-rt] Fix crtbegin.c compilationShoaib Meenai2019-05-111-4/+4
| | | | | | | We're building with -std=c11 now (as opposed to -std=gnu11), so we can't use GNU extensions and need to spell inline assembly as __asm__. llvm-svn: 360503
* [crt] Use -std=c11 for crtbegin.o/crtend.oPetr Hosek2019-05-101-0/+1
| | | | | | | | | The source uses C11 syntax such as comments and some compilers print warnings without specifying this flag. Differential Revision: https://reviews.llvm.org/D61797 llvm-svn: 360459
* [crtbegin] Fix an off-by-1 bug in __do_finiFangrui Song2019-05-031-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61367 llvm-svn: 359850
* [compiler-rt] Use correct spelling of the -Wno-pedantic variablePetr Hosek2019-05-011-1/+1
| | | | | | | This addresses the issue introduced in r359646 which is causing sanitizer bots to fail. llvm-svn: 359659
* Use __extension__ to suppress __EH_FRAME_LIST__ warningsFangrui Song2019-05-011-1/+1
| | | | | | | gcc -pedantic => warning: ISO C forbids empty initializer braces clang -pedantic => -Wzero-length-array + -Wgnu-empty-initializer llvm-svn: 359655
* [compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.oPetr Hosek2019-05-011-0/+1
| | | | | | | | These are needed to make bots happy. Differential Revision: https://reviews.llvm.org/D61363 llvm-svn: 359646
* Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-303-0/+209
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359591
* Revert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-303-209/+0
| | | | | | This reverts commit r359576 since it's failing on Windows bots. llvm-svn: 359579
* [compiler-rt] Simple crtbegin.o and crtend.o implementationPetr Hosek2019-04-303-0/+209
Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359576
OpenPOWER on IntegriCloud