Skip to content

Commit 1d787dc

Browse files
Dan Gohmanjohn-sharratt
authored andcommitted
Remove support for __original_main. (WebAssembly#295)
* Remove support for `__original_main`. This was used in old LLVM versions. Recent LLVM versions all emit either `__main_void` or `__main_argv_argc`, so we can use those directly. * Update the CI to use LLVM 14.0.0.
1 parent a8cd851 commit 1d787dc

File tree

5 files changed

+8
-30
lines changed

5 files changed

+8
-30
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
- name: Install LLVM tools (Windows)
2424
shell: bash
2525
run: |
26-
curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe
27-
7z x LLVM-10.0.0-win64.exe -y -o"llvm"
26+
curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/LLVM-14.0.0-win64.exe
27+
7z x LLVM-14.0.0-win64.exe -y -o"llvm"
2828
echo "$(pwd)/llvm/bin" >> $GITHUB_PATH
2929
echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV
3030
echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV
@@ -42,8 +42,8 @@ jobs:
4242
- name: Install LLVM tools (MacOS)
4343
shell: bash
4444
run: |
45-
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 -
46-
export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-apple-darwin/bin
45+
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 -
46+
export CLANG_DIR=`pwd`/clang+llvm-14.0.0-x86_64-apple-darwin/bin
4747
echo "$CLANG_DIR" >> $GITHUB_PATH
4848
echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
4949
echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
@@ -53,8 +53,8 @@ jobs:
5353
- name: Install LLVM tools (Linux)
5454
shell: bash
5555
run: |
56-
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 -
57-
export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
56+
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 -
57+
export CLANG_DIR=`pwd`/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
5858
echo "$CLANG_DIR" >> $GITHUB_PATH
5959
echo "CLANG_DIR=$CLANG_DIR" >> $GITHUB_ENV
6060
echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV

expected/wasm32-wasi/defined-symbols.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ __log2f_data
188188
__log_data
189189
__logf_data
190190
__lseek
191-
__main_argc_argv
192191
__main_void
193192
__malloc_atfork
194193
__math_divzero
@@ -215,7 +214,6 @@ __ofl_lock
215214
__ofl_unlock
216215
__optpos
217216
__optreset
218-
__original_main
219217
__overflow
220218
__p1evll
221219
__parsespent

libc-bottom-half/crt/crt1-command.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extern void __wasi_init_tp(void);
44
#endif
55
#include <wasi/api.h>
66
extern void __wasm_call_ctors(void);
7-
extern int __original_main(void);
7+
extern int __main_void(void);
88
extern void __wasm_call_dtors(void);
99

1010
__attribute__((export_name("_start")))
@@ -40,7 +40,7 @@ void _start(void) {
4040
// Call `__main_void` which will either be the application's zero-argument
4141
// `__main_void` function or a libc routine which obtains the command-line
4242
// arguments and calls `__main_argv_argc`.
43-
int r = __original_main();
43+
int r = __main_void();
4444

4545
// Call atexit functions, destructors, stdio cleanup, etc.
4646
__wasm_call_dtors();

libc-bottom-half/sources/__main_argc_argv.c

Lines changed: 0 additions & 10 deletions
This file was deleted.

libc-bottom-half/sources/__original_main.c

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)