From 2791dbdcc8a639990988844b45484a0a469d4b1b Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Fri, 28 Oct 2022 08:43:58 -0400 Subject: [PATCH] When debugging, only set the required LDFLAGS. This allows us to actually use good debugging symbols when loading the executable into something like lldb or gdb. --- tools/bin/td | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bin/td b/tools/bin/td index a61851a..6df3464 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -27,7 +27,7 @@ : "${CC:=cc}" : "${CFLAGS:=-Wall -Wextra -pedantic -std=c89 -O3 $DEFINES $INCLUDES}" -: "${LDFLAGS:=-pthread -static -flto -fdata-sections -ffunction-sections -s -Wl,-static -Wl,-gc-sections}" +: "${LDFLAGS:=-lm -pthread -static -flto -fdata-sections -ffunction-sections -s -Wl,-static -Wl,-gc-sections}" : "${PROG:=telodendria}" # If a .env file exists in the current directory, we load it. @@ -41,7 +41,7 @@ fi if [ "$DEBUG" = "1" ]; then CFLAGS="$CFLAGS -O0 -g" - LDFLAGS="$LDFLAGS -v" + LDFLAGS="-lm -pthread -v" PROG="$PROG-debug" fi