From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1687454447; bh=+XRDjI36PEd0caHlici2GUhkWoB0ec/qz+50JPGebKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SsVgkH/skY1v3CBQPy8YxPB6zH2PSH6cl5wZBHVUzgHJ5Pe5jlPkRaW7VNIe5OKAo 5umKypCl5cmKqqa1lNVqwijyq+27ib9x4PjOyRCdXLQfk1hnzTi/C9gkPyN1ZAIHbp feTSdwiDUrNvD9XQpski4z3VmbEoWMm0ck+OJa5M+FKTpvxgjDpVL5NSQr5mu38GIg OFzVve1ZhMjZvaA8kUgwfBxZ4J8z0uOtk1akdSJcbaLg/6Px4I+ibUT0Y/mA88au87 t0zoR/q0drsQTbEywHwHuzXuOwrclHLaW0+Z+QKoHuxAxdYGP0mH+B7J/slThQ+9xN +3o2Hn9pFapSQ== Received: from integral2.. (unknown [68.183.184.174]) by gnuweeb.org (Postfix) with ESMTPSA id 18B5A249D86; Fri, 23 Jun 2023 00:20:43 +0700 (WIB) From: Ammar Faizi To: Jens Axboe Cc: Alviro Iskandar Setiawan , Guillem Jover , Jeff Moyer , Stefan Hajnoczi , Michael William Jonathan , Matthew Patrick , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [RFC PATCH liburing v1 3/3] src/Makefile: Allow using stack protector with libc Date: Fri, 23 Jun 2023 00:20:29 +0700 Message-Id: <20230622172029.726710-4-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230622172029.726710-1-ammarfaizi2@gnuweeb.org> References: <20230622172029.726710-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Currently, the stack protector is forcefully disabled. Let's allow using the stack protector feature only if libc is used. The stack protector will remain disabled by default if no custom CFLAGS are provided. This ensures the default behavior doesn't change while still offering the option to enable the stack protector. Cc: Stefan Hajnoczi Cc: Guillem Jover Co-authored-by: Alviro Iskandar Setiawan Signed-off-by: Alviro Iskandar Setiawan Signed-off-by: Ammar Faizi --- src/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 951c48fc6797be75..c4c28cbe87c7a8de 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,9 +10,8 @@ CPPFLAGS ?= override CPPFLAGS += -D_GNU_SOURCE \ -Iinclude/ -include ../config-host.h \ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -CFLAGS ?= -g -O3 -Wall -Wextra +CFLAGS ?= -g -O3 -Wall -Wextra -fno-stack-protector override CFLAGS += -Wno-unused-parameter \ - -fno-stack-protector \ -DLIBURING_INTERNAL \ $(LIBURING_CFLAGS) SO_CFLAGS=-fPIC $(CFLAGS) @@ -46,8 +45,8 @@ liburing_srcs := setup.c queue.c register.c syscall.c version.c ifeq ($(CONFIG_NOLIBC),y) liburing_srcs += nolibc.c - override CFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin - override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin + override CFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -fno-stack-protector + override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -fno-stack-protector override LINK_FLAGS += -nostdlib -nodefaultlibs endif -- Ammar Faizi