drop puts in favor of write, smaller main prog :D

This commit is contained in:
Brooke Vibber 2026-01-05 20:35:31 -08:00
commit ac747bbbf4
4 changed files with 925 additions and 1657 deletions

View file

@ -1,17 +1,20 @@
STRIP=riscv64-linux-gnu-strip STRIP=riscv64-linux-gnu-strip
CC=riscv64-linux-musl-gcc CC=riscv64-linux-musl-gcc
OBJDUMP=riscv64-linux-gnu-objdump
.FAKE: all clean test .FAKE: all clean test
all: hello all: hello hello-objdump.txt
clean: clean:
rm -f hello rm -f hello
rm -f hello-objdump.txt
hello: hello.c hello: hello.c
$(CC) -static -O2 -o hello hello.c $(CC) -static -O2 -o hello hello.c
hello-objdump.txt: hello
$(OBJDUMP) -d hello > hello-objdump.txt
test: hello test: hello
./hello ./hello

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#include <unistd.h> #include <unistd.h>
int main(int argc, const char **argv) { int main(int argc, const char **argv) {
const message = "Hello, world!\n"; static const char message[] = "Hello, world!\n";
write(STDIN_FILENO, message, strlen(message)); write(STDIN_FILENO, message, strlen(message));
return 0; return 0;
} }