forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SH]tools/sh-demo: conveniently experiment with native compilation
sh-demo includes compilation of a .c file produced by `shermes` in the regular CMake build, making it easy to experiment and test things.
- Loading branch information
Showing
6 changed files
with
1,061 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
link_libraries(shermes_console_a hermesvmlean_a jsi) | ||
link_libraries(setjmp) | ||
link_libraries(wasi-emulated-mman) | ||
|
||
add_executable(sh-demo demo.c cxa.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "llvh/Support/ErrorHandling.h" | ||
|
||
extern "C" void __cxa_throw(void* thrown_exception, | ||
std::type_info* tinfo, | ||
void (*dest)(void*)) { | ||
llvh::report_fatal_error("C++ exceptions not supported on Wasi"); | ||
} | ||
|
||
extern "C" void* __cxa_allocate_exception(size_t) { | ||
llvh::report_fatal_error("C++ exceptions not supported on Wasi"); | ||
} |
Oops, something went wrong.