Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable static PGO for Linux SGX #2270

Merged
merged 6 commits into from
Jun 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update CMakeLists to correctly set static pgo macro
  • Loading branch information
TianlongLiang committed Jun 6, 2023
commit 3e6479e4c6ef53160664967083dbc8c76bac9f71
7 changes: 6 additions & 1 deletion product-mini/platforms/linux-sgx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ if (NOT DEFINED WAMR_BUILD_SGX_IPFS)
set (WAMR_BUILD_SGX_IPFS 0)
endif ()

if (NOT DEFINED WAMR_BUILD_STATIC_PGO)
# Disable static PGO by default
set (WAMR_BUILD_STATIC_PGO 0)
endif ()

set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -ffunction-sections -fdata-sections \
-Wall -Wno-unused-parameter -Wno-pedantic \
Expand All @@ -107,7 +112,7 @@ add_custom_command (

add_custom_target (vmlib_untrusted ALL DEPENDS libvmlib_untrusted.a)

if ((WAMR_BUILD_AOT EQUAL 1) AND (DEFINED WAMR_BUILD_STATIC_PGO))
if (WAMR_BUILD_AOT EQUAL 1)
execute_process(
COMMAND bash -c "sed -i -E 's/^WAMR_BUILD_STATIC_PGO = .*/WAMR_BUILD_STATIC_PGO = ${WAMR_BUILD_STATIC_PGO}/g' ${CMAKE_CURRENT_SOURCE_DIR}/enclave-sample/Makefile"
OUTPUT_VARIABLE cmdOutput
Expand Down