Archived issue #0026247
Configuration, CMake - strip symbols within Release configuration when using non-msvc
Description
By default binaries with unstripped symbols are produced using MinGW in release mode (-DBUILD_CONFIGURATION:STRING=Release, shared). As a result size of binaries is 3 times greater than expected (e.g. TKernel occupies 6Mb instead of 1.8Mb).
Adding "-s" parameter to CMAKE_CXX_FLAGS_RELEASE can solve this problem.
Adding "-s" parameter to CMAKE_CXX_FLAGS_RELEASE can solve this problem.
Steps to reproduce
N/A
Public activity
18 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: ski
Date: Fri Jun 19 16:09:25 2015 +0300
0026247: Too huge binaries are produced for Android platform using MinGW
Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE for MinGW compiler to optimize size of binaries
[revision removed]
Detailed log of new commits:
Author: ski
Date: Fri Jun 19 16:09:25 2015 +0300
0026247: Too huge binaries are produced for Android platform using MinGW
Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE for MinGW compiler to optimize size of binaries
Parameter "-s" was added to CMAKE_CXX_FLAGS_RELEASE for MinGW compiler to optimize size of binaries in release mode
Size of binaries:
• without fix - 189 Mb
• with fix - 42 Mb
Dear ibs,
please review.
Size of binaries:
• without fix - 189 Mb
• with fix - 42 Mb
Dear ibs,
please review.
+# Optimize size of binaries for MinGW compiler
+if ("${CMAKE_GENERATOR}" STREQUAL "MinGW Makefiles")
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+endif()
does this problem is MinGW-specific?
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
occt branch CR26247 was updated.
I have tried to compile occt on linux station with "-s" parameter and got next results:
Size of binaries:
• without fix - 77 Mb
• with fix - 64 Mb
Dear kgv,
please review.
I have tried to compile occt on linux station with "-s" parameter and got next results:
Size of binaries:
• without fix - 77 Mb
• with fix - 64 Mb
Dear kgv,
please review.
Please test the patch and integrate.
Insertion of -s option cause crash compilation on MacOS platform
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch CR26247 was rebased on current state of master.
Since now, option "-s" will not be added during compilation on Windows and Mac stations.
Please, review.
Since now, option "-s" will not be added during compilation on Windows and Mac stations.
Please, review.
+# Optimize size of binaries
+if (NOT WIN32 AND NOT APPLE)
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+endif()
the same parameter should be added to C compiler options within Release configuration.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
CMAKE_C_FLAGS_RELEASE is also considered. Please review CR26247 branch of OCCT git
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
dear ski,
please review CR26247 branch of OCCT git
please review CR26247 branch of OCCT git
Reviewed. no remarks, please test.
Size of libraries decreased from 114 Mb till 96 Mb
Branch [archived branch] has been deleted by Commenter 3.
[revision removed]
[revision removed]
Related records