Skip to content

Commit

Permalink
fix duplicated symbols stdin etc
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Oct 19, 2023
1 parent 118e8f1 commit fd1eed4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lualib/Makefile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CC= clang-16
# And if __ISO_C_VISIBLE=1999 then LLONG_MAX is defined in ckb-c-stdlib
# See https://github.com/nervosnetwork/ckb-c-stdlib/blob/efe1fe6b3cdda12e248e25664f5c04cbf7876265/libc/limits.h#L94
# and https://github.com/nervosnetwork/ckb-lua/blob/b71d44288e8fb085074d3af056b359b8c6c22afa/lualib/luaconf.h#L502
CFLAGS= --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs -Ic-stdlib -I../include/ckb-c-stdlib -I../include/ckb-c-stdlib/libc -O3 -Wall -Wextra -D__ISO_C_VISIBLE=1999 -DLUA_COMPAT_5_3 -ULUA_USE_LINUX -ULUA_USE_POSIX -fno-builtin-printf -fno-builtin-memcmp -nostdinc -nostdlib $(SYSCFLAGS) $(MYCFLAGS)
CFLAGS= --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs -Ic-stdlib -I../include/ckb-c-stdlib -I../include/ckb-c-stdlib/libc -O3 -Wall -Wextra -D__ISO_C_VISIBLE=1999 -DCKB_DECLARATION_ONLY -DCKB_MALLOC_DECLARATION_ONLY -DLUA_COMPAT_5_3 -ULUA_USE_LINUX -ULUA_USE_POSIX -fno-builtin-printf -fno-builtin-memcmp -nostdinc -nostdlib $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)

Expand Down
6 changes: 3 additions & 3 deletions lualib/c-stdlib/my_stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ typedef struct FILE {
uint32_t offset;
} FILE;

FILE *stdin;
FILE *stdout;
FILE *stderr;
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;

int remove(const char *__filename);

Expand Down
1 change: 1 addition & 0 deletions lualib/c-stdlib/my_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define LUA_C_STDLIB_STRING_H_

#include <stddef.h>
#include <string.h>

char *strchr (const char *, int);
int strncmp(const char *_l, const char *_r, size_t n);
Expand Down

0 comments on commit fd1eed4

Please sign in to comment.