Skip to content

Commit

Permalink
gcc: disable code fortification with sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
lzaoral committed Feb 6, 2023
1 parent 00dd8af commit eec74d5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions py/plugins/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ def handle_args(self, parser, args, props):
self.flags.append_flags(['-g', '-fno-omit-frame-pointer',
'-fsanitize-recover=all'])

# sanitizers are not compatible with FORTIFY_SOURCE
# https://github.com/google/sanitizers/issues/247#issuecomment-1283500316
#
# annobin should always be present in the buildroot since it is
# required by redhat-rpm-config
self.flags.append_flags(["-Wp,-U_FORTIFY_SOURCE",
"-fplugin=annobin",
"-fplugin-arg-annobin-no-active-checks"])

# create directory for sanitizer's results
def create_cap_dir_hook(results, mock):
cmd = f"mkdir -pv '{SANITIZER_CAPTURE_DIR}'"
Expand Down

0 comments on commit eec74d5

Please sign in to comment.