Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-g3 switch clang #61

Open
Amaroq7 opened this issue Jul 23, 2018 · 4 comments
Open

-g3 switch clang #61

Amaroq7 opened this issue Jul 23, 2018 · 4 comments

Comments

@Amaroq7
Copy link

Amaroq7 commented Jul 23, 2018

  • OS: Linux x64
  • Python: 3.6.6
  • CC: Clang 6.0.1

Every time I build SourcePawn using Clang I get -g3 switch specified. Doesn't matter if I pass --enable-optimize or not.

Passing --enable-debug causes that -g3 is specified twice because of https://github.com/alliedmodders/sourcepawn/blob/d653700024004082b2787b2d95e66eba7d2f598e/AMBuildScript#L77.

From what I found this behavior was added to ambuild back in 2013.
2f9a0be
https://bugs.alliedmods.net/show_bug.cgi?id=5997#c15

But then removed for GCC in 2015.
1864bb9#diff-1427703f7513811334a37d948e0648bcL101
1864bb9#diff-a119ca3177c6ded3d2f16a88cbe924d1R68

What is the reason of specifying -g3 switch by default?
Is there any way to disable that without manually tweaking ambuild sources?

@dvander
Copy link
Member

dvander commented Aug 27, 2020

Sorry for seeing this so very late. By default AMBuild adds full symbolic debug information to binaries. There is no way to toggle this off. Obviously that's bad for packaging purposes, so it does have a toggle to strip debug information into a separate file. So, users get stripped binaries, but the symbols are retained for Breakpad and the symbol server.

If you want a toggle to entirely stop symbolic information, I think that'd be an easy feature to add, but I'm curious what the use case is given that stripping is supported.

@nosoop
Copy link

nosoop commented Jun 28, 2021

I stumbled on this issue as well — AMBuild does not pass -g3 to GCC; the flag only applies to Clang. I'd be fine with either option as long as they are consistent across the two.

@dvander
Copy link
Member

dvander commented Jun 28, 2021

AMBuild treats the compilers almost identically, so that is surprising. What version?

@nosoop
Copy link

nosoop commented Jun 29, 2021

I'm able to reproduce this on the latest metamod-source with the following configuration command:

python ../configure.py -s tf2 --hl2sdk-root '/path/to/hl2sdkroot'

The compilers are GCC 8.3 / Clang 7.0 (Debian Buster), and the AMBuild package installed is 6ad11a1 (latest at time of writing).

Attached are the results of ambuild --show-steps for each: build-steps-clang.txt / build-steps-gcc.txt

This also affects AMBuild API version 2.1, which is what my fork of rcbot2 uses (linked to an older commit; newer ones strip the symbols out at link time use the --symbol-files option as intended).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants