commit 53efcfa08238d8cd1d7b0db2a936a7a9f43c486e
parent 54a70620b35380cf2ad6e225e6f8fdc522e6848a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 11 Oct 2024 17:09:31 +0200
build: Use -fno-stack-protector only for libc
We require no pie and without stack protector only for the libc,
because we want to link the libc with the output of qbe that is
not pie. Also, the libc does not support the symbols required
by the stack protector functionality from gcc, and for that reason
we have to disable it.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/build/tool/gnu.mk b/scripts/build/tool/gnu.mk
@@ -9,6 +9,7 @@ PRECOMP = cpp
ARCHIVE_FLAGS = -U
NOPIE_CFLAGS = -fno-pie
-TOOL_CFLAGS = -std=c99 -fno-stack-protector -static $(PROFILE_CFLAGS)
+TOOL_CFLAGS = -std=c99 $(PROFILE_CFLAGS)
+TOOL_LDFLAGS = -static
TOOL_LDLIBS = $(PROFILE_LDLIBS)
-TOOL_LIBC_CFLAGS = -ffreestanding
+TOOL_LIBC_CFLAGS = -fno-stack-protector -ffreestanding