Skip to content

Commit

Permalink
keep frame pointer on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansson committed Jul 26, 2021
1 parent c39da19 commit 3232ea3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build/ninja/clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def initialize(self, project, archs, configs, includepaths, dependlibs, libpaths
#Base flags
self.cflags = ['-D' + project.upper() + '_COMPILE=1',
'-funit-at-a-time', '-fstrict-aliasing', '-fvisibility=hidden', '-fno-stack-protector',
'-fomit-frame-pointer', '-fno-math-errno','-ffinite-math-only', '-funsafe-math-optimizations',
'-fno-math-errno','-ffinite-math-only', '-funsafe-math-optimizations',
'-fno-trapping-math', '-ffast-math']
self.cwarnflags = ['-W', '-Werror', '-pedantic', '-Wall', '-Weverything',
'-Wno-c++98-compat', '-Wno-padded', '-Wno-documentation-unknown-command',
Expand Down Expand Up @@ -84,8 +84,13 @@ def initialize(self, project, archs, configs, includepaths, dependlibs, libpaths
self.cflags += ['-D_GNU_SOURCE=1']
self.linkflags += ['-lpthread']
self.oslibs += ['m']
if not self.target.is_windows():
if (not self.target.is_windows()) and (not self.target.is_macos()) and (not self.target.is_ios()):
self.linkflags += ['-fomit-frame-pointer']
if self.target.is_macos() or self.target.is_ios():
# Needed for backtrace() system call (implemented as simple frame pointer walk by Apple)
self.cflags += ['-fno-omit-frame-pointer']
else:
self.cflags += ['-fomit-frame-pointer']

self.includepaths = self.prefix_includepaths((includepaths or []) + ['.'])

Expand Down

0 comments on commit 3232ea3

Please sign in to comment.