hello_world: Fix stat with coreutils(linux)

the development nix shell has coreutils
This commit is contained in:
Artturin 2025-02-22 21:44:28 +02:00
parent 459ed89ce2
commit eb77c50eb2

View file

@ -27,7 +27,7 @@ $(ELF): $(SRC) $(LDSCRIPT)
$(BIN): $(ELF) $(BIN): $(ELF)
$(OBJCOPY) -O binary $(ELF) $(BIN) $(OBJCOPY) -O binary $(ELF) $(BIN)
# Pad the binary to a multiple of 4 bytes # Pad the binary to a multiple of 4 bytes
size=$$(stat -f%z $(BIN)); \ size=$$(stat -c %s $(BIN)); \
padding=$$(( (4 - (size % 4)) % 4 )); \ padding=$$(( (4 - (size % 4)) % 4 )); \
[ $$padding -ne 0 ] && dd if=/dev/zero bs=1 count=$$padding >> $(BIN) || true [ $$padding -ne 0 ] && dd if=/dev/zero bs=1 count=$$padding >> $(BIN) || true