Skip to content

Commit 978cfaa

Browse files
[libc] add __stack_chk_fail and abort to uefi
1 parent 722c410 commit 978cfaa

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

libc/config/uefi/entrypoints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
set(TARGET_LIBC_ENTRYPOINTS
2+
libc.src.compiler.__stack_chk_fail
3+
24
# ctype.h entrypoints
35
libc.src.ctype.isalnum
46
libc.src.ctype.isalpha
@@ -152,6 +154,7 @@ set(TARGET_LIBC_ENTRYPOINTS
152154

153155
# stdlib.h entrypoints
154156
libc.src.stdlib._Exit
157+
libc.src.stdlib.abort
155158
libc.src.stdlib.abs
156159
libc.src.stdlib.aligned_alloc
157160
libc.src.stdlib.atof
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add_entrypoint_object(
2+
abort
3+
SRCS
4+
abort.cpp
5+
HDRS
6+
../abort.h
7+
)

libc/src/stdlib/uefi/abort.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===-- Implementation of abort -------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "src/__support/common.h"
10+
#include "src/__support/macros/config.h"
11+
12+
#include "src/stdlib/abort.h"
13+
14+
namespace LIBC_NAMESPACE_DECL {
15+
16+
LLVM_LIBC_FUNCTION(void, abort, ()) { __builtin_trap(); }
17+
18+
} // namespace LIBC_NAMESPACE_DECL

0 commit comments

Comments
 (0)