Skip to content

Commit

Permalink
build: added an option to enforce memory alignment
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Aug 9, 2024
1 parent 68931d1 commit f9e6def
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ option(FLB_WINDOWS_DEFAULTS "Build with predefined Windows settings" Yes)
option(FLB_WASM "Build with WASM runtime support" Yes)
option(FLB_WAMRC "Build with WASM AOT compiler executable" No)
option(FLB_WASM_STACK_PROTECT "Build with WASM runtime with strong stack protector flags" No)
option(FLB_ENFORCE_ALIGNMENT "Enable limited platform specific aligned memory access" No)

# Native Metrics Support (cmetrics)
option(FLB_METRICS "Enable metrics support" Yes)
Expand Down Expand Up @@ -338,6 +339,11 @@ if(FLB_IPO STREQUAL "On" OR (FLB_IPO STREQUAL "ReleaseOnly" AND FLB_RELEASE))
endif()
endif()

# Memory alignment enforcement
if(FLB_ENFORCE_ALIGNMENT)
FLB_DEFINITION(FLB_ENFORCE_ALIGNMENT)
endif()

# Harden release binary against security vulnerabilities
if(FLB_SECURITY STREQUAL "On" OR (FLB_SECURITY STREQUAL "ReleaseOnly" AND FLB_RELEASE))
if (NOT MSVC)
Expand Down

0 comments on commit f9e6def

Please sign in to comment.