Skip to content

[cmake] Add explicit option to build Apple dSYM#296

Closed
alloy wants to merge 1 commit intofacebook:masterfrom
alloy:emit-debug-symbols-for-apple-platforms-take-2
Closed

[cmake] Add explicit option to build Apple dSYM#296
alloy wants to merge 1 commit intofacebook:masterfrom
alloy:emit-debug-symbols-for-apple-platforms-take-2

Conversation

@alloy
Copy link
Copy Markdown
Contributor

@alloy alloy commented Jul 16, 2020

Summary

Add HERMES_BUILD_APPLE_DSYM option to build a dSYM bundle for the libhermes target on Apple platforms.

This will work with any of the build types and is off by default.

Installing the tools with the install/strip target will ensure all tools and the runtime lib are stripped of debug symbols, but leaving the dSYM bundle in tact.

Test Plan

Build

./src/utils/build/configure.py --distribute --cmake-flags='-DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true -DCMAKE_INSTALL_PREFIX:PATH=../destroot_release' build_release
cmake --build ./build_release

Install without stripping

cmake --build ./build_release --target install
nm -a destroot_release/bin/hermesc | wc -l
   27943

Install with stripping

cmake --build ./build_release --target install/strip
nm -a destroot_release/bin/hermesc | wc -l
     250

…and dSYM DWARF metadata is maintained:

dwarfdump --statistics destroot_release/Library/Frameworks/hermes.framework.dSYM
{"version":3,"file":"destroot_release/Library/Frameworks/hermes.framework.dSYM/Contents/Resources/DWARF/hermes","format":"Mach-O 64-bit x86-64","source functions":30305,"source functions with location":30302,"inlined functions":172725,"inlined funcs with abstract origins":172725,"unique source variables":79276,"source variables":353690,"variables with location":232195,"call site entries":186409,"scope bytes total":19161949,"scope bytes covered":10500176,"total function size":1763513,"total inlined function size":998375,"total formal params":300264,"formal params with source location":166067,"formal params with type":300264,"formal params with binary location":200407,"total vars":38809,"vars with source location":38385,"vars with type":38809,"vars with binary location":22161}

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants