增加编译时确定的allocator_magic

This commit is contained in:
pointer-to-bios 2024-02-19 05:15:22 +08:00
parent 501643f86a
commit 25116eaee4
2 changed files with 5 additions and 2 deletions

View File

@ -12,9 +12,11 @@ ifdef release
release = 1
endif
ALLOCATOR_MAGIC = $(shell doas hwclock | sha512sum | head -c 128 | md5sum | head -c 8)
SUBOBJS = kernel/kernel.o libk/libk.o rust.o
DEFINES = ARCH="${ARCH}" ASM="${ASM}" ASMFLAGS="${ASMFLAGS}" SOURCE="${SOURCE}" PWD="${PWD}"
DEFINES = ARCH="${ARCH}" ASM="${ASM}" ASMFLAGS="${ASMFLAGS}" SOURCE="${SOURCE}" PWD="${PWD}" ALLOCATOR_MAGIC="${ALLOCATOR_MAGIC}"
ifdef release
DEFINES := ${DEFINES} release=1
endif

View File

@ -6,7 +6,8 @@
CC = gcc
CCFLAGS = -m64 -mcmodel=large -I ../../include \
-fno-stack-protector -fno-exceptions \
-fno-builtin -nostdinc -nostdlib
-fno-builtin -nostdinc -nostdlib \
-DMEMM_ALLOCATOR_MAGIC=\"${ALLOCATOR_MAGIC}\"
ifdef release
CCFLAGS := ${CCFLAGS} -O2
endif