Skip to content

Commit

Permalink
bypass _FORTIFY_SOURCE=3
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Jan 15, 2025
1 parent a31d4d7 commit 1950c4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,15 @@ def readlists(name, prefix):
cxxabi = toolchain_macros.get('_GLIBCXX_USE_CXX11_ABI') or '0'
cxxdefs += [('_GLIBCXX_USE_CXX11_ABI', cxxabi)]

# detect _FORTIFY_SOURCE level
# note: gcc only injects this builtin macro when optimiation enabled
fortify_source, = probe.eval_macros(['_FORTIFY_SOURCE'], extra_postargs=['-O2'], language='c++').values()
print('Detect _FORTIFY_SOURCE', fortify_source)
if fortify_source not in (None, '0', '1', '2'):
# https://github.com/epics-base/epics-base/issues/514
# bypass until patched
print('Bypass _FORTIFY_SOURCE')
cxxdefs += [('__FORTIFY_SOURCE',), ('_FORTIFY_SOURCE', '2')]

modules = []
headers = ['epicsVersion.h']
Expand Down

0 comments on commit 1950c4a

Please sign in to comment.