Closed detly closed 5 years ago
I'd welcome a workaround for this by the way, I cannot figure out where in the gmake module this is done.
It was actually in the GCC toolset code. This in premake5.lua
seems to do the trick:
premake.override(
premake.tools.gcc, "getldflags",
function(base, cfg)
premake.tools.gcc.ldflags.symbols = nil
local flags = base(cfg)
return flags
end
)
Have you tried symbols "On"
?
I'm using - Og and - g3, but they definitely don't cancel out the -s.
On Wed., 6 Feb. 2019, 5:04 pm Samuel Surtees <notifications@github.com wrote:
Have you tried symbols "On" https://github.com/premake/premake-core/wiki/symbols?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/premake/premake-core/issues/1238#issuecomment-460910875, or mute the thread https://github.com/notifications/unsubscribe-auth/AAS_x2o9eFmCRpi0Sl3wGMI9tUpmPRy6ks5vKnBUgaJpZM4akdcT .
That didn't really answer my question, have you tried using symbols "On"
?
Sorry, reading too many man pages. I thought you meant On
where n
is a placeholder.
Yes, adding symbols "On"
to premake5.lua
(and removing the workaround) removes this flag, thanks! IMO it should be the default when config=Debug
, but maybe there are reasons not to?
I guess the only reason that it wouldn't default is that configurations
just accepts a bunch of strings. I've never really noticed, there's usually a long list of differences between debug and release builds that adding symbols
or optimize
has never really registered with me.
I guess Premake could contain defaults for arbitrary configurations but that would create inconsistencies and confusion when users create their own configurations. Requiring all settings to be explicitly set for configurations is far more consistent and less confusing overall, just not so much right at the start.
That's fair, I wasn't sure what conventions Premake wanted to take on or not. I was confused by the configuration being provided to the gcc.ldflags
function, but it looks like it's switching on the OS to work around the issue on OS X, rather than on debug vs. release.
Using Premake 5.0.0-alpha13. Take this
premake5.lua
as an example:Both
premake5 gmake
andpremake5 gmake2
produce makefiles where theLDFLAGS
contain-s
eg.This has the effect of stripping debug symbols from the resulting binary, so debugging is quite hard eg. GDB will be unable to load any debugging symbols. See the GCC man page:
I have checked that removing this from the makefiles allows GDB to find and load the symbols.
The
-s
flag should probably be restricted to release builds.