From 582150a6fbf0e41b7a60b24855050f6bb155f7d0 Mon Sep 17 00:00:00 2001 From: memsharded Date: Fri, 11 Nov 2022 20:18:01 +0100 Subject: [PATCH 1/2] remove the -s from compiler flags --- conan/tools/_compilers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/conan/tools/_compilers.py b/conan/tools/_compilers.py index a3ab6bc86c5..a4f6f9da29d 100644 --- a/conan/tools/_compilers.py +++ b/conan/tools/_compilers.py @@ -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, []) From b20421071945412b57d1d6ae46f81892046d5001 Mon Sep 17 00:00:00 2001 From: memsharded Date: Fri, 11 Nov 2022 21:03:45 +0100 Subject: [PATCH 2/2] fix test --- .../integration/toolchains/gnu/test_autotoolstoolchain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py b/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py index 36ede715b8f..1b9b3269abe 100644 --- a/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py +++ b/conans/test/integration/toolchains/gnu/test_autotoolstoolchain.py @@ -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