Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions boards/native/native_sim/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
help
Enables the reboot implementation for the native sim executable.

config ARCH_POSIX_AFLPLUSPLUS
bool "Enable AFL++ support"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool "Enable AFL++ support"
bool "AFL++"

as per https://docs.zephyrproject.org/latest/build/kconfig/tips.html#prompt-strings

For a Kconfig symbol that enables a driver/subsystem FOO, consider having just “Foo” as the prompt, instead of “Enable Foo support” or the like.
It will usually be clear in the context of an option that can be toggled on/off, and makes things consistent.

default n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n is the default for Kconfigs and should only be used in cases where there exists a default y that should be overruled, for example in a defconfig file.

Suggested change
default n
help
When selected, the AFL++ instrumentation will be enabled for the native

Check failure on line 41 in boards/native/native_sim/Kconfig

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

boards/native/native_sim/Kconfig:41 trailing whitespace
simulator.

source "boards/native/common/sdl/Kconfig"
source "boards/native/common/extra_args/Kconfig"

Expand Down
9 changes: 7 additions & 2 deletions cmake/compiler/clang/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ if(DEFINED TOOLCHAIN_HOME)
set(find_program_clang_args PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
endif()

find_program(CMAKE_C_COMPILER clang ${find_program_clang_args})
find_program(CMAKE_CXX_COMPILER clang++ ${find_program_clang_args})
if(CONFIG_ARCH_POSIX_AFLPLUSPLUS)
find_program(CMAKE_C_COMPILER afl-clang-fast ${find_program_clang_args})
find_program(CMAKE_CXX_COMPILER afl-clang-fast++ ${find_program_clang_args})
Comment on lines +19 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not overwrite a given compiler this way behind the scenes of the user.

else()
find_program(CMAKE_C_COMPILER clang ${find_program_clang_args})
find_program(CMAKE_CXX_COMPILER clang++ ${find_program_clang_args})
endif()

if(SYSROOT_DIR)
# The toolchain has specified a sysroot dir, pass it to the compiler
Expand Down
Loading