Skip to content

Commit a87e12d

Browse files
committed
cmake: use size optimization for nacl_helper_bootstrap, with toplevel-reorder disabled on armhf
The -ftoplevel-reorder option breaks the build for armhf.
1 parent 10eb46d commit a87e12d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/trusted/service_runtime/linux/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ if (ANDROID)
1414
remove_definitions(-D_FORTIFY_SOURCE=2)
1515
endif()
1616

17-
# Using optimizations when building with GCC breaks the program on armhf.
18-
if (NOT DAEMON_CXX_COMPILER_Clang_COMPATIBILITY)
19-
list(APPEND BOOTSTRAP_FLAGS "-O0")
17+
list(APPEND BOOTSTRAP_FLAGS "-Os")
18+
19+
# Using this optimization when building with GCC breaks the program on armhf:
20+
# > Illegal instruction
21+
if (NOT DAEMON_CXX_COMPILER_Clang_COMPATIBILITY AND (DAEMON_ARCH_armhf OR DAEMON_ARCH_armel))
22+
list(APPEND BOOTSTRAP_FLAGS -fno-toplevel-reorder)
2023
endif()
2124

2225
# The src/trusted/service_runtime/build.scons file was only setting them on

0 commit comments

Comments
 (0)