diff options
author | Marvin Borner | 2021-04-04 00:11:00 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-04 00:11:00 +0200 |
commit | 7a64bdbbcf14023370b90b22de73c2f61a6f84ac (patch) | |
tree | 7f26778ddcd9f7e213f70e60e04c1805c4f2572f /libs/libc/Makefile | |
parent | 9127d8e4d09207d5c9d98024ca6610310a7273ad (diff) |
Implemented basic user program ASLR
Diffstat (limited to 'libs/libc/Makefile')
-rw-r--r-- | libs/libc/Makefile | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/libc/Makefile b/libs/libc/Makefile index 24970d8..cc1b836 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -1,7 +1,8 @@ # MIT License, Copyright (c) 2020 Marvin Borner # TODO: Remove cpu from libc? -COBJS = sanitize.o \ +COBJS = crt/crt0.o \ + sanitize.o \ errno.o \ str.o \ alloc.o \ @@ -26,11 +27,12 @@ ASFLAGS = -f elf32 %.o: %.c @$(CC) -c $(CFLAGS) $< -o $@ -libc: CFLAGS += -DUSER +libc: CFLAGS += -pie -fPIE -fPIC -DUSER libc: $(COBJS) - @$(AS) $(ASFLAGS) crt/crt0.asm -o crt0.o @mkdir -p ../../build/ - @$(AR) rcs ../../build/libc.a crt0.o $+ + @$(AS) $(ASFLAGS) crt/crti.asm -o ../../build/crti.o + @$(AS) $(ASFLAGS) crt/crtn.asm -o ../../build/crtn.o + @$(AR) rcs ../../build/libc.a ../../build/crti.o ../../build/crti.o $+ libk: CFLAGS += -DKERNEL -ffreestanding -I../../kernel/inc/ $(CFLAGS_EXTRA) libk: $(COBJS) |