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
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Install LLVM tools (Windows)
shell: bash
run: |
curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe
7z x LLVM-10.0.0-win64.exe -y -o"llvm"
curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/LLVM-14.0.0-win64.exe
7z x LLVM-14.0.0-win64.exe -y -o"llvm"
echo "$(pwd)/llvm/bin" >> $GITHUB_PATH
echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV
echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV
Expand All @@ -35,8 +35,8 @@ jobs:
- name: Install LLVM tools (MacOS)
shell: bash
run: |
curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-apple-darwin/bin
curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
export CLANG_DIR=`pwd`/clang+llvm-14.0.0-x86_64-apple-darwin/bin
echo "$CLANG_DIR" >> $GITHUB_PATH
echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
Expand All @@ -46,8 +46,8 @@ jobs:
- name: Install LLVM tools (Linux)
shell: bash
run: |
curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf -
export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf -
export CLANG_DIR=`pwd`/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
echo "$CLANG_DIR" >> $GITHUB_PATH
echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
Expand Down
2 changes: 0 additions & 2 deletions expected/wasm32-wasi/defined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ __log2f_data
__log_data
__logf_data
__lseek
__main_argc_argv
__main_void
__math_divzero
__math_divzerof
Expand All @@ -170,7 +169,6 @@ __ofl_lock
__ofl_unlock
__optpos
__optreset
__original_main
__overflow
__p1evll
__pio2_hi
Expand Down
2 changes: 1 addition & 1 deletion expected/wasm32-wasi/undefined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ __imported_wasi_snapshot_preview1_sock_send
__imported_wasi_snapshot_preview1_sock_shutdown
__letf2
__lttf2
__main_argc_argv
__netf2
__stack_pointer
__subtf3
__trunctfdf2
__trunctfsf2
__unordtf2
__wasm_call_ctors
main
10 changes: 5 additions & 5 deletions libc-bottom-half/crt/crt1-command.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include <wasi/api.h>
#include <stdlib.h>
extern void __wasm_call_ctors(void);
extern int __original_main(void);
extern int __main_void(void);
extern void __wasm_call_dtors(void);

__attribute__((export_name("_start")))
void _start(void) {
// Call `__original_main` which will either be the application's zero-argument
// `__original_main` function or a libc routine which calls `__main_void`.
// TODO: Call `main` directly once we no longer have to support old compilers.
int r = __original_main();
// Call `__main_void` which will either be the application's zero-argument
// `__main_void` function or a libc routine which obtains the command-line
// arguments and calls `__main_argv_argc`.
int r = __main_void();

// If main exited successfully, just return, otherwise call `exit`.
if (r != 0) {
Expand Down
10 changes: 5 additions & 5 deletions libc-bottom-half/crt/crt1.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include <wasi/api.h>
extern void __wasm_call_ctors(void);
extern int __original_main(void);
extern int __main_void(void);
extern void __wasm_call_dtors(void);

__attribute__((export_name("_start")))
void _start(void) {
// The linker synthesizes this to call constructors.
__wasm_call_ctors();

// Call `__original_main` which will either be the application's zero-argument
// `__original_main` function or a libc routine which calls `__main_void`.
// TODO: Call `main` directly once we no longer have to support old compilers.
int r = __original_main();
// Call `__main_void` which will either be the application's zero-argument
// `__main_void` function or a libc routine which obtains the command-line
// arguments and calls `__main_argv_argc`.
int r = __main_void();

// Call atexit functions, destructors, stdio cleanup, etc.
__wasm_call_dtors();
Expand Down
10 changes: 0 additions & 10 deletions libc-bottom-half/sources/__main_argc_argv.c

This file was deleted.

10 changes: 0 additions & 10 deletions libc-bottom-half/sources/__original_main.c

This file was deleted.