nasa/fprime

Sanitizer Disable Does Not Work

Opened this issue · 2 comments

F´ Version
Affected Component

Problem Description

Generating with -DENABLE_SANITIZER_ADDRESS=OFF does not work. Only the --disable-sanitizer to disable everything. The culprit is:

https://github.com/fprime-community/fprime-tools/blob/c15253c98ffc816bcca24db43f24c4c070b7c5ff/src/fprime/fbuild/cli.py#L55-L59

Notice how the sanitizers are forced-on.

The fix is in several stages:

  1. In CMake default to sanitizers should be == BUILD_TESTING (default "ON" when testing).
  2. Above code should read "if disable" set the ENABLES "OFF"
  3. Take no action on disable sanitizers not set

This way the sanitizers are explicitly turned off, or left to defaults.

Could it also work if in the 4 lines you linked, each value in the cmake_args dictionary would be set to ON only if they are not in the cmake_args dictionary already (so not passed in by the user)?

That could work too.