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

remove the -s from compiler flags #12518

Merged
merged 2 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions conan/tools/_compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,8 @@ def build_type_flags(settings):
# clang include the gnu (overriding some things, but not build type) and apple clang
# overrides clang but it doesn't touch clang either
if str(compiler) in ["clang", "gcc", "apple-clang", "qcc", "mcst-lcc"]:
# FIXME: It is not clear that the "-s" is something related with the build type
# cmake is not adjusting it
# -s: Remove all symbol table and relocation information from the executable.
flags = {"Debug": ["-g"],
"Release": ["-O3", "-s"] if str(compiler) == "gcc" else ["-O3"],
"Release": ["-O3"],
"RelWithDebInfo": ["-O2", "-g"],
"MinSizeRel": ["-Os"],
}.get(build_type, [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def test_extra_flags_via_conf():
toolchain = client.load("conanautotoolstoolchain{}".format('.bat' if os_ == "Windows" else '.sh'))
if os_ == "Windows":
assert 'set "CPPFLAGS=%CPPFLAGS% -DNDEBUG -DDEF1 -DDEF2"' in toolchain
assert 'set "CXXFLAGS=%CXXFLAGS% -O3 -s --flag1 --flag2"' in toolchain
assert 'set "CFLAGS=%CFLAGS% -O3 -s --flag3 --flag4"' in toolchain
assert 'set "CXXFLAGS=%CXXFLAGS% -O3 --flag1 --flag2"' in toolchain
assert 'set "CFLAGS=%CFLAGS% -O3 --flag3 --flag4"' in toolchain
assert 'set "LDFLAGS=%LDFLAGS% --flag5 --flag6"' in toolchain
else:
assert 'export CPPFLAGS="$CPPFLAGS -DNDEBUG -DDEF1 -DDEF2"' in toolchain
assert 'export CXXFLAGS="$CXXFLAGS -O3 -s --flag1 --flag2"' in toolchain
assert 'export CFLAGS="$CFLAGS -O3 -s --flag3 --flag4"' in toolchain
assert 'export CXXFLAGS="$CXXFLAGS -O3 --flag1 --flag2"' in toolchain
assert 'export CFLAGS="$CFLAGS -O3 --flag3 --flag4"' in toolchain
assert 'export LDFLAGS="$LDFLAGS --flag5 --flag6"' in toolchain


Expand Down