View Issue Details

IDProjectCategoryView StatusLast Update
0031614Open CASCADEOCCT:Configurationpublic2023-09-29 17:43
Reporterbugmaster Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformMacOSOS 
Product Version7.5.0 
Target VersionUnscheduled 
Summary0031614: Configuration, CMake - eliminate CLang -Wl,-s deprecated warning
DescriptionNew warning on MacOS
ld: warning: option -s is obsolete and being ignored
TagsNo tags attached.
Test case number

Relationships

child of 0031606 closedbugmaster Configuration, CMake - build fails with Android NDK + CLang compiler + MinGW Makefiles 
child of 0026247 closedbugmaster Configuration, CMake - strip symbols within Release configuration when using non-msvc 

Activities

kgv

2020-09-23 12:41

developer   ~0095233

Option -s has been marked as deprecated on macOS a long time ago and even not documented in "--help" output.
At the same time it still does work as expected, so that -s provides a cross-platform way for stripping symbols during build (on other platforms this option is not marked deprecated).

To eliminate the warning, we may update our CMake scripts to exclude -s during build and perform a dedicated step using a "strip" tool (CMAKE_STRIP).
The most reasonable place for this could be an installation step:
install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_STRIP} --strip-unneeded \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${target})")


Just removing symbols is suboptimal solution - macOS provides a way to separate debug symbols from .dylib into dedicated file .dSYM (similar to .pdb file for .dll on Windows), so that installation might perform an extra step of .dSYM generation which would allow making ReleaseWithDebugInfo builds - a preferred building configuration for any application (.pdb/.dSYM files could be just not distributed with application, but could be used to reconstruct crash information):
dsymutil libTKernel.dylib -o libTKernel.dSYM
strip -S libTKernel.dylib


Using "strip" tool as alternative to "-s" flag could be considered for macOS/iOS-only solution (just to avoid a warning) or for other platforms as well (Linux, Android).
For this, it would be desired analyzing the difference between approaches (e.g. on file size).

Note that there stipping might be done for unneeded symbols or/and on debug symbols (the latter should appear only for -g builds).

vglukhik

2023-09-29 17:43

administrator   ~0114330

parents are closed

Issue History

Date Modified Username Field Change
2020-06-17 13:41 bugmaster New Issue
2020-06-17 13:41 bugmaster Assigned To => kgv
2020-06-17 13:45 kgv Relationship added child of 0031606
2020-06-17 14:09 bugmaster Status new => assigned
2020-06-17 14:18 kgv Product Version => 7.5.0
2020-06-17 14:19 kgv Category OCCT:Coding => OCCT:Configuration
2020-06-17 14:19 kgv Summary Coding - New warnings after integration fix for 0031606 => Configuration, CMake - eliminate CLang -Wl,-s deprecated warning
2020-06-17 14:27 kgv Relationship added child of 0026247
2020-09-11 15:40 utverdov Target Version 7.5.0 => 7.6.0
2020-09-11 15:59 kgv Target Version 7.6.0 => 7.5.0
2020-09-23 12:41 kgv Note Added: 0095233
2020-09-23 12:41 kgv Assigned To kgv => bugmaster
2020-09-28 11:29 kgv Target Version 7.5.0 => 7.6.0
2021-09-03 14:13 bugmaster Target Version 7.6.0 => 7.7.0
2022-10-24 10:38 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:09 dpasukhi Target Version 7.8.0 => Unscheduled
2023-09-29 17:43 vglukhik Status assigned => closed
2023-09-29 17:43 vglukhik Resolution open => fixed
2023-09-29 17:43 vglukhik Note Added: 0114330