From 8b88f3f7fd143fc542a5118d50a7a981464270d5 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 15 Mar 2021 21:07:59 +0200 Subject: Fix compile failure without -O2 Linking fails without lto on --- toolchain.makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'toolchain.makefile') diff --git a/toolchain.makefile b/toolchain.makefile index d8f09f7..ce8fdc6 100644 --- a/toolchain.makefile +++ b/toolchain.makefile @@ -8,13 +8,14 @@ AS := clang AS_FLAGS := LD := ld.lld -LD_FLAGS := -T linker.ld --thinlto-cache-dir=$(OBJ_DIR)/thinlto_cache +LD_FLAGS := -nostdlib -T linker.ld --thinlto-cache-dir=$(OBJ_DIR)/thinlto_cache +# TODO: linking fails with -O0 and -O1 without -flto=thin CXX := clang++ TEST_CXX := clang++ -CXX_FLAGS := -std=c++20 -g \ +CXX_FLAGS := -std=c++20 -g -O2 -flto=thin \ -mkernel -ffreestanding -nostdlib -nostdinc -nostdinc++ \ - -Wall -Wextra -Werror=pedantic -O2 -flto=thin \ + -Wall -Wextra -Werror=pedantic \ -Werror=date-time \ -Werror=shadow-all \ -Wold-style-cast -Wconversion \ -- cgit v1.2.1