Skip to content

Commit

Permalink
Merge pull request #566 from overte-org/fix/align_functions
Browse files Browse the repository at this point in the history
Align functions to avoid V8 asserts in debug builds
  • Loading branch information
ksuprynowicz authored Aug 18, 2023
2 parents 0cecaa3 + 70833f6 commit c6f9f16
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ if( NOT WIN32 )
MESSAGE(STATUS "OVERTE_CPU_ARCHITECTURE: ${OVERTE_CPU_ARCHITECTURE}")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OVERTE_OPTIMIZE_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OVERTE_OPTIMIZE_FLAGS}")

set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} ${OVERTE_OPTIMIZE_FLAGS}")
set(ENV{CFLAGS} "$ENV{CFLAGS} ${OVERTE_OPTIMIZE_FLAGS}")
# Function alignment is necessary for V8.
# SetAlignedPointerInInternalField requires at least 2 byte alignment and -falign-functions will set alignment
# to machine specific value which should be greater than 2.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions")

set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions")
set(ENV{CFLAGS} "$ENV{CFLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions")
message($ENV{CXXFLAGS})
endif()

Expand Down

0 comments on commit c6f9f16

Please sign in to comment.