diff options
| author | Ada Christine <adachristine18@gmail.com> | 2021-12-26 15:25:44 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2021-12-26 15:25:44 +0000 |
| commit | c33d2dedd7ae7f259179abdc9a6f58847b32db21 (patch) | |
| tree | e6126b1a9e11b2cc525a587d4bd2689eca94ef4a /kc | |
| parent | 7fb62e402724181a56d632635fc94d49cd051a2b (diff) | |
make all component objects have the same base linker options
Diffstat (limited to 'kc')
| -rw-r--r-- | kc/boot/Makefile | 6 | ||||
| -rw-r--r-- | kc/core/Makefile | 6 | ||||
| -rw-r--r-- | kc/defaults.mk | 6 |
3 files changed, 8 insertions, 10 deletions
diff --git a/kc/boot/Makefile b/kc/boot/Makefile index 76bd4d4..e84330f 100644 --- a/kc/boot/Makefile +++ b/kc/boot/Makefile @@ -1,4 +1,5 @@ include ../../defaults.mk +include ../defaults.mk VPATH := ../../lib ../ @@ -13,11 +14,6 @@ CPPFLAGS += -I../../api -I$(EFIAPIDIR) -I$(EFIAPIDIR)/$(ARCH) -I$(EFIAPIDIR)/pro CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden \ -g -fshort-wchar -mgeneral-regs-only -LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name)) -LDSCRIPT := ../component.ld -LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker -LOADLIBES := -lgcc - OBJS := entry_x86_64.o reloc_x86_64.o kc_main.o elf64.o memcmp.o memcpy.o \ memmove.o memset.o $(OBJS): CFLAGS += -fPIC diff --git a/kc/core/Makefile b/kc/core/Makefile index b210efd..85cdb53 100644 --- a/kc/core/Makefile +++ b/kc/core/Makefile @@ -1,4 +1,5 @@ include ../../defaults.mk +include ../defaults.mk VPATH := ../../lib ../ @@ -8,11 +9,6 @@ TARGET := kernel.os CPPFLAGS += -I../../api CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden -g -LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name)) -LDSCRIPT := ../component.ld -LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker -LOADLIBES := -lgcc - SOBJS := GOBJS := entry_x86_64.o reloc_x86_64.o kprint.o serial.o port.o \ kc_main.o main.o memory.o memset.o memcpy.o memmove.o memcmp.o cpu.o \ diff --git a/kc/defaults.mk b/kc/defaults.mk new file mode 100644 index 0000000..4464801 --- /dev/null +++ b/kc/defaults.mk @@ -0,0 +1,6 @@ +LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name)) +LDSCRIPT := ../component.ld +LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker \ + -z separate-code +LOADLIBES := -lgcc + |
