summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.toolchain7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain
index d43590eeb8..18313e6998 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -66,7 +66,7 @@ CFLAGS_TEST=$(if $(TEST_BUILD),-DTEST_BUILD=$(EMPTY) \
$(if $(TEST_ASAN),-fsanitize=address) \
$(if $(TEST_MSAN),-fsanitize=memory) \
$(if $(TEST_UBSAN),$(UBSAN_FLAGS)) \
- $(if $(TEST_FUZZ),-fsanitize=fuzzer-no-link \
+ $(if $(TEST_FUZZ),-fsanitize=fuzzer-no-link -fno-PIE \
-fcoverage-mapping \
-fprofile-instr-generate \
-DTEST_FUZZ=$(EMPTY))
@@ -92,7 +92,7 @@ HOST_CPPFLAGS=$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) $(CFLAGS_TEST) \
$(EXTRA_CFLAGS) $(CFLAGS_COVERAGE) $(LATE_CFLAGS_DEFINE) \
-DSECTION_IS_$(BLD)=$(EMPTY) -DSECTION=$(BLD) $(CPPFLAGS_$(BLD))
ifneq ($(BOARD),host)
-CPPFLAGS+=-ffreestanding -fno-builtin -nostdinc -nostdlib
+CPPFLAGS+=-ffreestanding -fno-builtin -nostdinc -nostdlib -fno-PIC
CPPFLAGS+=-Ibuiltin/
else
CPPFLAGS+=-Og
@@ -101,6 +101,7 @@ CPPFLAGS+= -DCHROMIUM_EC=$(EMPTY)
CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(COMMON_WARN) $(CFLAGS_y)
CFLAGS+= -ffunction-sections -fshort-wchar
CFLAGS+= -fno-delete-null-pointer-checks
+CFLAGS+= -fno-PIC
ifneq ($(cc-name),clang)
CFLAGS+= -ffat-lto-objects
CFLAGS+= -fconserve-stack
@@ -149,7 +150,7 @@ HOST_TEST_LDFLAGS=-Wl,-T core/host/host_exe.lds -lrt -pthread -rdynamic -lm -g \
$(if $(TEST_ASAN), -fsanitize=address) \
$(if $(TEST_MSAN), -fsanitize=memory) \
$(if $(TEST_UBSAN), ${UBSAN_FLAGS}) \
- $(if $(TEST_FUZZ), -fsanitize=fuzzer -fcoverage-mapping -fprofile-instr-generate)
+ $(if $(TEST_FUZZ), -fsanitize=fuzzer -no-pie -fcoverage-mapping -fprofile-instr-generate)
# utility function to provide overridable defaults
# $1: name of variable to set