Skip to content

Commit 8c9e1c6

Browse files
authored
Make the __original_main definition weak, fixing -flto. (#138)
1 parent cf81683 commit 8c9e1c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libc-bottom-half/sources/__original_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ int main(int argc, char *argv[]);
99
// If the user's `main` function expects arguments, the compiler won't emit
1010
// an `__original_main` function so this version will get linked in, which
1111
// initializes the argument data and calls `main`.
12+
__attribute__((weak))
1213
int __original_main(void) {
1314
__wasi_errno_t err;
1415

0 commit comments

Comments
 (0)