From a1a88a589352feca01a6c273b733caf7c96ad31b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 31 Oct 2021 10:23:34 +0200 Subject: [PATCH] Use -fno-omit-frame-pointer if debug is set with optimizations --- source/gnucompiler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index c877ae1..fe1d735 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -278,6 +278,8 @@ Task *GnuCompiler::run(const Target &target) const argv.push_back("-Os"); else argv.push_back(format("-O%d", binfo.optimize)); + if(binfo.debug) + argv.push_back("-fno-omit-frame-pointer"); } if(binfo.threads && architecture->get_system()!="windows" && architecture->get_system()!="darwin") argv.push_back("-pthread"); -- 2.43.0