From 26f81e50066e5bb7aeae218094e0f834c405a8c1 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Wed, 23 Mar 2022 00:45:57 +0000 Subject: fix collision with /usr/include/efi/lib.h squash me --- efi.mk | 8 ++------ kc/boot/kc_main.c | 2 +- kc/core/kstdio.c | 2 +- kc/core/memory.h | 2 +- kc/core/vm_tree.c | 2 +- lib/kstdio.h | 2 +- lib/lib.h | 14 -------------- lib/sophialib.h | 14 ++++++++++++++ lib/string.c | 2 +- loader/Makefile | 2 +- 10 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 lib/lib.h create mode 100644 lib/sophialib.h diff --git a/efi.mk b/efi.mk index 60cf1d6..9b8cc7b 100644 --- a/efi.mk +++ b/efi.mk @@ -8,19 +8,15 @@ ifeq ($(ARCH),i686) endif ifndef EFIAPIDIR -EFIAPIDIR := /usr/local/include/efi +EFIAPIDIR := /usr/include/efi endif ifndef EFILIBDIR EFILIBDIR := /usr/local/$(TARGET)/lib endif -EFICRT := $(EFILIBDIR)/crt0-efi-$(GNUEFIARCH).o -EFILDSCRIPT := $(EFILIBDIR)/elf_$(GNUEFIARCH)_efi.lds - CPPFLAGS += -I$(EFIAPIDIR) -I$(EFIAPIDIR)/protocol -I$(EFIAPIDIR)/$(GNUEFIARCH) \ - -DGNU_EFI_USE_MS_ABI -DEFI_CALL_WRAPPER -DEFI_DEBUG - + -DEFI_CALL_WRAPPER -DGNU_EFI_USE_MS_ABI %.efi: $(CC.info) @$(CC) $(LDFLAGS) -o $@ $^ diff --git a/kc/boot/kc_main.c b/kc/boot/kc_main.c index cb8eb7a..fe670b0 100644 --- a/kc/boot/kc_main.c +++ b/kc/boot/kc_main.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include diff --git a/kc/core/kstdio.c b/kc/core/kstdio.c index 2971b18..fdb52b7 100644 --- a/kc/core/kstdio.c +++ b/kc/core/kstdio.c @@ -1,7 +1,7 @@ #include "kprint.h" #include "serial.h" -#include +#include #include #include diff --git a/kc/core/memory.h b/kc/core/memory.h index 6b7a816..a587d56 100644 --- a/kc/core/memory.h +++ b/kc/core/memory.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include diff --git a/kc/core/vm_tree.c b/kc/core/vm_tree.c index cca32bb..88a4be1 100644 --- a/kc/core/vm_tree.c +++ b/kc/core/vm_tree.c @@ -32,7 +32,7 @@ #include "panic.h" #include "kprint.h" -#include +#include #define assert(expr) diff --git a/lib/kstdio.h b/lib/kstdio.h index 79ed357..d3615f1 100644 --- a/lib/kstdio.h +++ b/lib/kstdio.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include diff --git a/lib/lib.h b/lib/lib.h deleted file mode 100644 index c28e17c..0000000 --- a/lib/lib.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -void *memcpy(void *dest, const void *src, size_t size); -void *memmove(void *dest, const void *src, size_t size); -void *memset(void *dest, int val, size_t size); -int memcmp(const void *str1, const void *str2, size_t count); -size_t strlen(const char *s); -unsigned long long strtoull( - const char *restrict begin, - char **restrict end, - int base); - diff --git a/lib/sophialib.h b/lib/sophialib.h new file mode 100644 index 0000000..c28e17c --- /dev/null +++ b/lib/sophialib.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +void *memcpy(void *dest, const void *src, size_t size); +void *memmove(void *dest, const void *src, size_t size); +void *memset(void *dest, int val, size_t size); +int memcmp(const void *str1, const void *str2, size_t count); +size_t strlen(const char *s); +unsigned long long strtoull( + const char *restrict begin, + char **restrict end, + int base); + diff --git a/lib/string.c b/lib/string.c index c4764ce..3d3f4a1 100644 --- a/lib/string.c +++ b/lib/string.c @@ -1,4 +1,4 @@ -#include +#include size_t strlen(const char *s) { diff --git a/loader/Makefile b/loader/Makefile index add25e7..9ac52f7 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -5,7 +5,7 @@ VPATH := ../lib IMAGE := loader.efi -CPPFLAGS += -I../api -I../lib +CPPFLAGS += -I../api -I../lib -I$(EFIAPIDIR) CFLAGS += --target=$(GNUEFIARCH)-unknown-windows -fshort-wchar -mno-avx \ -mno-sse -mno-mmx -funsigned-char -Wno-pointer-sign -ggdb \ -- cgit v1.3.1-1-g115d