From f07ff66d8ff8fd65e0f50d296b61418af18f64f7 Mon Sep 17 00:00:00 2001 From: SashaXser <24498484+SashaXser@users.noreply.github.com> Date: Wed, 14 Aug 2024 00:28:09 +0400 Subject: [PATCH] Update Makefile --- src/Makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Makefile b/src/Makefile index 6d70ebb5..6319cf15 100644 --- a/src/Makefile +++ b/src/Makefile @@ -8,21 +8,22 @@ MINGWLIB = /usr/$(CPREFIX)/lib/ MINGWINCLUDE = /usr/$(CPREFIX)/include/ TARGET = goodbyedpi.exe -LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32 -l:libssp.a -CC = clang --target=$(CPREFIX) --sysroot=/usr/$(CPREFIX) +LIBS = -L$(WINDIVERTLIBS) -lWinDivert -lws2_32 +CC = $(CPREFIX)gcc -CCWINDRES = llvm-windres --target=$(CPREFIX) -ifeq (, $(shell which $(CPREFIX)llvm-windres)) - CCWINDRES = llvm-windres +CCWINDRES = $(CPREFIX)windres +ifeq (, $(shell which $(CPREFIX)windres)) + CCWINDRES = windres endif -CFLAGS = -std=c99 -fPIE -pipe -I$(WINDIVERTHEADERS) -I$(MINGWINCLUDE) -I/usr/$(CPREFIX)/include -L$(WINDIVERTLIBS) \ +# Обновленные флаги компиляции +CFLAGS = -std=c99 -fPIE -pipe -I$(WINDIVERTHEADERS) -I$(MINGWINCLUDE) -L$(WINDIVERTLIBS) \ -O3 -march=x86-64-v3 -D_FORTIFY_SOURCE=2 -fstack-protector \ -Wall -Wextra -Wpedantic -Wformat=2 -Wshadow -Wstrict-aliasing=1 \ -Wnull-dereference -Wcast-align -Wsign-conversion -LDFLAGS = -fstack-protector -Wl,-O1,-pie,--dynamicbase,--nxcompat,--sort-common,--as-needed \ --Wl,--disable-auto-image-base -L$(MINGWLIB) +LDFLAGS = -fstack-protector -Wl,-O3,-pie,--dynamicbase,--nxcompat,--sort-common,--as-needed \ +-Wl,--disable-auto-image-base ifdef BIT64 LDFLAGS += -Wl,--high-entropy-va -Wl,--pic-executable,-e,mainCRTStartup @@ -48,7 +49,8 @@ goodbyedpi-rc.o: .PRECIOUS: $(TARGET) $(OBJECTS) $(TARGET): $(OBJECTS) + $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -s -o $@ clean: -rm -f *.o utils/*.o - -rm -f $(TARGET) \ No newline at end of file + -rm -f $(TARGET)