aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2024-01-02 19:58:26 -0800
committerGitHub <noreply@github.com>2024-01-02 19:58:26 -0800
commit16124a3946c7f26fa4b25a5497ab68cc417950b3 (patch)
treefa469d82cb9f3e5e5ee38a5914fa3af94c63d7a6 /llvm/lib/Object/WasmObjectFile.cpp
parent4e347b4e38b95bc455d0e620e11ac58fc0172a94 (diff)
downloadllvm-16124a3946c7f26fa4b25a5497ab68cc417950b3.zip
llvm-16124a3946c7f26fa4b25a5497ab68cc417950b3.tar.gz
llvm-16124a3946c7f26fa4b25a5497ab68cc417950b3.tar.bz2
[libc] `__stack_chk_fail` baremetal dependencies (#76412)
`__stack_chk_fail` uses `write_to_stderr` and `abort` but these currently aren't included in baremetal targets resulting in a CMake build error: ``` CMake Error at /llvm-project/libc/cmake/modules/LLVMLibCObjectRules.cmake:693 (target_link_libraries): Target "libc.src.stdlib.abort" of type UTILITY may not be linked into another target. One may link only to INTERFACE, OBJECT, STATIC or SHARED libraries, or to executables with the ENABLE_EXPORTS property set. Call Stack (most recent call first): /llvm-project/libc/cmake/modules/LLVMLibCObjectRules.cmake:811 (create_entrypoint_object) /llvm-project/libc/cmake/modules/LLVMLibCObjectRules.cmake:891 (expand_flags_for_entrypoint_object) /llvm-project/libc/src/compiler/generic/CMakeLists.txt:1 (add_entrypoint_object) CMake Error at /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:5 (get_target_property): get_target_property() called with non-existent target "libc.src.__support.OSUtil.osutil". Call Stack (most recent call first): /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:36 (collect_object_file_deps) /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:36 (collect_object_file_deps) /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:85 (collect_object_file_deps) /llvm-project/libc/lib/CMakeLists.txt:26 (add_entrypoint_library) ``` To address these errors, we need to include `abort` in the list of baremetal entrypoints. We also need to provide `write_to_stderr` baremetal implementation, but this is challenging since there is no uniform way to print a message on these platforms (sometimes there may not be any way to print a message). We instead defer to `__libc_log_write` which can be provided by the underlying platform. We use a similar approach for `quick_exit`, defering to `__libc_quick_exit`.
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions