From fa25cde79c9e613bf3238a6bb60c5e9d99a49a61 Mon Sep 17 00:00:00 2001 From: Tiiffi Date: Thu, 7 Nov 2024 14:04:48 +0200 Subject: [PATCH] Modify compilation flags: - Remove "-s" flag - Change stack protector mode from "strong" to "all" - Change optimization level from "-Os" to "-O2" --- INSTALL.md | 2 +- Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 6a3bec9..cc7b916 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,7 +5,7 @@ Only dependency is C library and POSIX getopt support. Compiling with GCC or CLANG: - cc -std=gnu99 -Wpedantic -Wall -Wextra -Os -s -o mcrcon mcrcon.c + cc -std=gnu99 -Wpedantic -Wall -Wextra -O2 -o mcrcon mcrcon.c Note: on Windows remember to link with winsock by adding `-lws2_32` to your compiler command line. diff --git a/Makefile b/Makefile index c755128..25b5127 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # make # # Windows cross compile: -# i686-w64-mingw32-gcc -std=gnu99 -Wall -Wextra -Wpedantic -Os -s -o mcrcon.exe mcrcon.c -lws2_32 +# i686-w64-mingw32-gcc -std=gnu99 -Wall -Wextra -Wpedantic -O2 -o mcrcon.exe mcrcon.c -lws2_32 EXENAME = mcrcon PREFIX ?= /usr/local @@ -14,8 +14,8 @@ LINKER = RM = rm -v -f CC = gcc -CFLAGS = -std=gnu99 -Wall -Wextra -Wpedantic -Os -s -EXTRAFLAGS ?= -fstack-protector-strong +CFLAGS = -std=gnu99 -Wall -Wextra -Wpedantic -O2 +EXTRAFLAGS ?= -fstack-protector-all ifeq ($(OS), Windows_NT) LINKER = -lws2_32 @@ -25,7 +25,7 @@ endif ifeq ($(shell uname), Darwin) INSTALL = ginstall - CFLAGS = -std=gnu99 -Wall -Wextra -Wpedantic -Os + CFLAGS = -std=gnu99 -Wall -Wextra -Wpedantic -O2 endif .PHONY: all