Add -fsigned-char option

This commit is contained in:
Minseong Jang
2022-01-09 10:20:17 +09:00
parent 1ed49eb716
commit a68aeef92c
2 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ sudo apt install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu qemu-user-static
```sh ```sh
# Compile C source code into RISC-V assembly # Compile C source code into RISC-V assembly
riscv64-linux-gnu-gcc hello.c -S -o hello.S riscv64-linux-gnu-gcc hello.c -S -fsigned-char -o hello.S
# Link to an RISC-V executable # Link to an RISC-V executable
riscv64-linux-gnu-gcc -static hello.S -o hello riscv64-linux-gnu-gcc -static hello.S -o hello

View File

@@ -23,13 +23,13 @@ run-gcc: bench-gcc
qemu-riscv64-static -L /usr/riscv64-linux-gnu ./bench-gcc qemu-riscv64-static -L /usr/riscv64-linux-gnu ./bench-gcc
driver.o: $(SRCS) driver.cpp driver.o: $(SRCS) driver.cpp
$(CXX) $(CFLAGS) -o driver.o -c -I. driver.cpp $(CXX) $(CFLAGS) -fsigned-char -o driver.o -c -I. driver.cpp
.c.s: $(KECC) .c.s: $(KECC)
($(KECC) -O $< >$@) || (rm $@ -rf; exit 1) ($(KECC) -O $< >$@) || (rm $@ -rf; exit 1)
.c.o: .c.o:
($(CC) -O -c $< -o $@) || (rm $@ -rf; exit 1) ($(CC) -O -fsigned-char -c $< -o $@) || (rm $@ -rf; exit 1)
$(KECC): $(KECC):
cargo build --manifest-path=../Cargo.toml --release --bin kecc cargo build --manifest-path=../Cargo.toml --release --bin kecc