Chenged -falign-functions to use architecture-specific value

This commit is contained in:
Karol Suprynowicz 2023-08-18 13:17:45 +02:00
parent e8c1e691ad
commit 70833f6591

View file

@ -132,12 +132,14 @@ if( NOT WIN32 )
MESSAGE(STATUS "OVERTE_CPU_ARCHITECTURE: ${OVERTE_CPU_ARCHITECTURE}")
endif()
# Function alignment is necessary for V8
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions=16")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions=16")
# 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=16")
set(ENV{CFLAGS} "$ENV{CFLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions=16")
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions")
set(ENV{CFLAGS} "$ENV{CFLAGS} ${OVERTE_OPTIMIZE_FLAGS} -falign-functions")
message($ENV{CXXFLAGS})
endif()