aboutsummaryrefslogtreecommitdiff
path: root/toolchain.makefile
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-03-15 21:07:59 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-03-15 21:07:59 +0200
commit8b88f3f7fd143fc542a5118d50a7a981464270d5 (patch)
tree86b4ca2b14b3594d3eaa7ff449db72920cad2b70 /toolchain.makefile
parentEnable ThinLTO (diff)
downloadkernel.cpp-8b88f3f7fd143fc542a5118d50a7a981464270d5.tar.xz
Fix compile failure without -O2
Linking fails without lto on
Diffstat (limited to 'toolchain.makefile')
-rw-r--r--toolchain.makefile7
1 files changed, 4 insertions, 3 deletions
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 \