From b6c677c6d291e285c1df79487bda8accb5829d20 Mon Sep 17 00:00:00 2001 From: Leonid Pavel Date: Fri, 9 Jun 2023 14:29:06 +0000 Subject: [PATCH 1/2] build: fix compilation through CFLAGS --- kernel/Makefile | 2 +- loader/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index c0e531ec..22b1233c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -68,7 +68,7 @@ LIBS := C_DEFS := -D_KERNEL=1 -D_DEBUG -D_STANDALONE -D"MIRA_PLATFORM=${MIRA_PLATFORM}" -DMIRA_UNSUPPORTED_PLATFORMS -D__LP64__ -D_M_X64 -D__amd64__ -D__BSD_VISIBLE # C++ Flags, -02 Optimizations break shit badly -CFLAGS := $(I_DIRS) $(C_DEFS) -fpic -m64 -O0 -fno-builtin -nodefaultlibs -nostdlib -nostdinc -fcheck-new -ffreestanding -fno-strict-aliasing -fno-exceptions -fno-asynchronous-unwind-tables -Wall -Werror -Wno-unknown-pragmas +CFLAGS := $(I_DIRS) $(C_DEFS) -fpic -m64 -O0 -fno-builtin -nodefaultlibs -nostdlib -nostdinc -fcheck-new -ffreestanding -fno-strict-aliasing -fno-exceptions -fno-asynchronous-unwind-tables -fno-stack-protector -Wall -Wno-unknown-pragmas # Assembly flags SFLAGS := -m64 -nodefaultlibs -nostdlib diff --git a/loader/Makefile b/loader/Makefile index fe22e947..b467efe4 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -59,7 +59,7 @@ LIBS := C_DEFS := -D_KERNEL=1 -D_DEBUG -D_STANDALONE -D"MIRA_PLATFORM=${MIRA_PLATFORM}" -DMIRA_UNSUPPORTED_PLATFORMS -D__LP64__ -D_M_X64 -D__amd64__ -D__BSD_VISIBLE # C++ Flags, -02 Optimizations break shit badly -CFLAGS := $(I_DIRS) $(C_DEFS) -fpie -fPIC -m64 -std=c++17 -O0 -fno-builtin -nodefaultlibs -nostdlib -nostdinc -fcheck-new -ffreestanding -fno-strict-aliasing -fno-exceptions -fno-asynchronous-unwind-tables -Wall -Werror -Wno-unknown-pragmas +CFLAGS := $(I_DIRS) $(C_DEFS) -fpie -fPIC -m64 -std=c++17 -O0 -fno-builtin -nodefaultlibs -nostdlib -nostdinc -fcheck-new -ffreestanding -fno-strict-aliasing -fno-exceptions -fno-asynchronous-unwind-tables -fno-stack-protector -Wall -Werror -Wno-unknown-pragmas # Assembly flags SFLAGS := -fPIE -m64 -nodefaultlibs -nostdlib From 1fb71303bf26eaf7caf208792d4e1ac06c9b7613 Mon Sep 17 00:00:00 2001 From: Leonid Pavel Date: Fri, 9 Jun 2023 17:36:10 +0000 Subject: [PATCH 2/2] loader: use ld.lld as linker --- loader/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/Makefile b/loader/Makefile index b467efe4..a1884409 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -17,7 +17,7 @@ PROJ_NAME := MiraLoader CPPC := clang # Linker -LNK := ld # ps4-ld, we are compiling for the kernel so this is not going to use the OpenOrbis userland linker +LNK := ld.lld # C compiler CC := clang