10

My compile command is in macOS Sierra is

clang -std=c11 -g -Wall -Werror -fsanitize=address -file.c -o file

after it compiles, it also generates an extra file.dSYM file which included all debug symbols. However, when I use WSL or other *nix system it will not generate such file, debug symbols were embedded into executable binaries. So I just wondering is there a way to do the same in macOS with clang.

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
X.Yang
  • 115
  • 1
  • 1
  • 6

1 Answers1

5

When you compile a program in one pass, clang actually runs dsymutil for you, which is responsible for creating the .dSYM file. Thus, the solution to your problem is to compile and link separately, in which case clang won't automatically call dsymutil.

Check this SO question for more details!

Community
  • 1
  • 1
filaton
  • 2,257
  • 17
  • 27