Skip to content
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
11 changes: 6 additions & 5 deletions compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,15 @@ set(s390x_SOURCES
${GENERIC_TF_SOURCES}
)

set(wasm32_SOURCES
${GENERIC_TF_SOURCES}
${GENERIC_SOURCES}
)
set(wasm64_SOURCES

set(wasm_SOURCES
wasm/__c_longjmp.S
wasm/__cpp_exceptions.S
${GENERIC_TF_SOURCES}
${GENERIC_SOURCES}
)
set(wasm32_SOURCES ${wasm_SOURCES})
set(wasm64_SOURCES ${wasm_SOURCES})

set(ve_SOURCES
ve/grow_stack.S
Expand Down
26 changes: 26 additions & 0 deletions compiler-rt/lib/builtins/wasm/__c_longjmp.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//===-- __c_longjmp.S - Implement __c_longjmp -----------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file implements __c_longjmp which LLVM uses to implenmet setjmp/longjmp
// when Wasm EH is enabled.
//
//===----------------------------------------------------------------------===//

#ifdef __wasm_exception_handling__

#ifdef __wasm64__
#define PTR i64
#else
#define PTR i32
#endif

.globl __c_longjmp
.tagtype __c_longjmp PTR
__c_longjmp:

#endif // !__wasm_exception_handling__
26 changes: 26 additions & 0 deletions compiler-rt/lib/builtins/wasm/__cpp_exception.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//===-- __cpp_exception.S - Implement __cpp_exception ---------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file implements __cpp_exception which LLVM uses to implement exception
// handling when Wasm EH is enabled.
//
//===----------------------------------------------------------------------===//

#ifdef __wasm_exception_handling__

#ifdef __wasm64__
#define PTR i64
#else
#define PTR i32
#endif

.globl __cpp_exception
.tagtype __cpp_exception PTR
__cpp_exception:

#endif // !__wasm_exception_handling__