summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-05-21 17:54:16 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-05-21 19:32:49 +0800
commita7cd7d8eb37c50554ae7c75f2ba94db74d293a1b (patch)
treee0985cde7dbea591c88eb60e47beee00753dd84f
parenta7dd55a38147ff27f27d553e92e5ecc21b5a1892 (diff)
Makefile: pthread for debug
Makefile: use default instead of afl-g++
-rw-r--r--Makefile8
-rw-r--r--compile_commands.json113
2 files changed, 57 insertions, 64 deletions
diff --git a/Makefile b/Makefile
index 6fdde0a..1997923 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,8 @@ CXXFLAGS += -std=c++26 -Oz -s -Wall -flto -fPIC
LDFLAGS += -Wl,--as-needed,-z,now,-z,pack-relative-relocs
# Debug flags
-DEBUG_CXXFLAGS = -std=c++26 -g3 -O0 -Wall -fno-lto -fPIC -DDEBUG
-DEBUG_LDFLAGS = -Wl,--no-as-needed,-z,now,-z,pack-relative-relocs
+DEBUG_CXXFLAGS = -std=c++26 -g3 -O0 -Wall -fno-lto -fPIC -DDEBUG,-ffu -pthread
+DEBUG_LDFLAGS = -Wl,--no-as-needed,-z,now,-z,pack-relative-relocs -lpthread
CXXFLAGS += $(shell pkg-config --cflags ftxui)
LDFLAGS += $(shell pkg-config --libs ftxui)
@@ -76,8 +76,8 @@ clang-tidy:
debug: CXXFLAGS = $(DEBUG_CXXFLAGS)
debug: LDFLAGS = $(DEBUG_LDFLAGS)
-debug: CC = afl-g++
-debug: CXX = afl-g++
+# debug: CC = afl-g++
+# debug: CXX = afl-g++
# debug: export AFL_USE_ASAN = 1
debug: $(BIN)
@echo "Debug build complete"
diff --git a/compile_commands.json b/compile_commands.json
index 628ff44..2e54416 100644
--- a/compile_commands.json
+++ b/compile_commands.json
@@ -1,15 +1,13 @@
[
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/chatManager.o",
"src/chatManager.cpp"
@@ -20,15 +18,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/chatServer.o",
"src/chatServer.cpp"
@@ -39,15 +35,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/commandHandler.o",
"src/commandHandler.cpp"
@@ -58,15 +52,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/commands.o",
"src/commands.cpp"
@@ -77,15 +69,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/FileDescriptor.o",
"src/FileDescriptor.cpp"
@@ -96,15 +86,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/inputManager.o",
"src/inputManager.cpp"
@@ -115,15 +103,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/IOManager.o",
"src/IOManager.cpp"
@@ -134,15 +120,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/main.o",
"src/main.cpp"
@@ -153,15 +137,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/renderManager.o",
"src/renderManager.cpp"
@@ -172,15 +154,30 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
+ "-fPIC",
+ "-o",
+ "build/scroller.o",
+ "src/scroller.cpp"
+ ],
+ "directory": "/mnt/DATA/personal/Code/projects/chat-server",
+ "file": "/mnt/DATA/personal/Code/projects/chat-server/src/scroller.cpp",
+ "output": "/mnt/DATA/personal/Code/projects/chat-server/build/scroller.o"
+ },
+ {
+ "arguments": [
+ "/usr/bin/g++",
+ "-c",
+ "-std=c++26",
+ "-Oz",
+ "-Wall",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/server.o",
"src/server.cpp"
@@ -191,15 +188,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/session.o",
"src/session.cpp"
@@ -210,15 +205,13 @@
},
{
"arguments": [
- "/usr/bin/afl-g++",
+ "/usr/bin/g++",
"-c",
"-std=c++26",
- "-g3",
- "-O0",
+ "-Oz",
"-Wall",
- "-fno-lto",
+ "-flto",
"-fPIC",
- "-DDEBUG",
"-o",
"build/sessionManager.o",
"src/sessionManager.cpp"