blob: 088cdf0cab31a46e9591745d287ddb7e6523ccb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# SPDX-License-Identifier: GPL-2.0-or-later
WARNINGS ?= -Wall -Wextra -Wno-unused-parameter
ifeq ($(BUILD_VARIANT),release)
KERNEL_OPT_FLAGS := -O2 -g0 -DNDEBUG
else
KERNEL_OPT_FLAGS := -O2 -g
endif
CFLAGS := $(WARNINGS) $(KERNEL_OPT_FLAGS) \
-ffreestanding -nostdlib \
-mcmodel=medany -fPIE -MMD -MP \
$(TOOLCHAIN_CFLAGS) $(KCPPFLAGS) $(INCLUDES) \
-I$(BUILD)/generated
CFLAGS_LIBC := $(CFLAGS) -std=gnu23 -Iinclude/libc-shim \
-Wno-parentheses -Wno-sign-compare
CXXFLAGS := $(CFLAGS) $(TOOLCHAIN_CXXFLAGS) -std=c++23 \
-fno-exceptions -fno-rtti -fno-use-cxa-atexit \
-fno-threadsafe-statics
# Pre-MMU assembly must never use GOT-indirect addressing.
ASFLAGS := $(filter-out -fPIE,$(CFLAGS)) -fno-pie
LDFLAGS := -nostdlib -shared -Bsymbolic -z notext -z norelro \
--no-dynamic-linker
|