File tree 6 files changed +14
-19
lines changed 6 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,9 @@ if(EXECUTORCH_ENABLE_EVENT_TRACER)
146
146
endif ()
147
147
148
148
# -ffunction-sections -fdata-sections: breaks function and data into sections so
149
- # they can be properly gc'd. -s: strip symbol. -fno-exceptions -fno-rtti:
150
- # disables exceptions and runtime type.
149
+ # they can be properly gc'd. -s: strip symbol.
151
150
set (CMAKE_CXX_FLAGS_RELEASE
152
- "-ffunction-sections -fdata-sections -fno-exceptions -fno-rtti ${CMAKE_CXX_FLAGS_RELEASE} "
151
+ "-ffunction-sections -fdata-sections ${CMAKE_CXX_FLAGS_RELEASE} "
153
152
)
154
153
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
155
154
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s" )
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ echo "--------------------------------------------------------------------------
20
20
21
21
# Since we only want to build the quantized_aot lib in the specified folder,
22
22
# we want exactly the configuration set below and deleting the cache is OK.
23
- rm -f cmake-out-aot-lib/CMakeCache.txt
23
+ rm -f cmake-out-aot-lib/CMakeCache.txt
24
24
25
- cmake \
25
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake \
26
26
-DCMAKE_PREFIX_PATH=" $CMAKE_PREFIX_PATH " \
27
27
-DCMAKE_BUILD_TYPE=${build_type} \
28
28
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ STEPWISE_BUILD=false
21
21
22
22
if $STEPWISE_BUILD ; then
23
23
echo " Building ExecuTorch"
24
- cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
24
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
25
25
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
26
26
-DCMAKE_BUILD_TYPE=Release \
27
27
-DEXECUTORCH_ENABLE_EVENT_TRACER=OFF \
@@ -37,7 +37,7 @@ if $STEPWISE_BUILD; then
37
37
-Bcmake-out .
38
38
39
39
echo " Building any Cadence-specific binaries on top"
40
- cmake -DBUCK2=" $BUCK " \
40
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DBUCK2=" $BUCK " \
41
41
-DCMAKE_TOOLCHAIN_FILE=/home/zonglinpeng/ws/zonglinpeng/executorch/backends/cadence/cadence.cmake \
42
42
-DCMAKE_INSTALL_PREFIX=cmake-out \
43
43
-DCMAKE_BUILD_TYPE=Release \
@@ -61,7 +61,7 @@ if $STEPWISE_BUILD; then
61
61
else
62
62
echo " Building Cadence toolchain with ExecuTorch packages"
63
63
cmake_prefix_path=" ${PWD} /cmake-out/lib/cmake/ExecuTorch;${PWD} /cmake-out/third-party/gflags"
64
- cmake -DBUCK2=" $BUCK " \
64
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DBUCK2=" $BUCK " \
65
65
-DCMAKE_PREFIX_PATH=" ${cmake_prefix_path} " \
66
66
-DHAVE_SYS_STAT_H=ON \
67
67
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ STEPWISE_BUILD=false
21
21
22
22
if $STEPWISE_BUILD ; then
23
23
echo " Building ExecuTorch"
24
- cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
24
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
25
25
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
26
26
-DCMAKE_BUILD_TYPE=Release \
27
27
-DEXECUTORCH_ENABLE_EVENT_TRACER=OFF \
@@ -36,7 +36,7 @@ if $STEPWISE_BUILD; then
36
36
-Bcmake-out .
37
37
38
38
echo " Building any Cadence-specific binaries on top"
39
- cmake -DBUCK2=" $BUCK " \
39
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DBUCK2=" $BUCK " \
40
40
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
41
41
-DCMAKE_INSTALL_PREFIX=cmake-out \
42
42
-DCMAKE_BUILD_TYPE=Release \
@@ -60,7 +60,7 @@ if $STEPWISE_BUILD; then
60
60
else
61
61
echo " Building Cadence toolchain with ExecuTorch packages"
62
62
cmake_prefix_path=" ${PWD} /cmake-out/lib/cmake/ExecuTorch;${PWD} /cmake-out/third-party/gflags"
63
- cmake -DBUCK2=" $BUCK " \
63
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DBUCK2=" $BUCK " \
64
64
-DCMAKE_PREFIX_PATH=" ${cmake_prefix_path} " \
65
65
-DCMAKE_TOOLCHAIN_FILE=./backends/cadence/cadence.cmake \
66
66
-DCMAKE_INSTALL_PREFIX=cmake-out \
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ main() {
21
21
cd " ${EXECUTORCH_ROOT} "
22
22
23
23
rm -rf cmake-out
24
- cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
24
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
25
25
-DCMAKE_BUILD_TYPE=Release \
26
26
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
27
27
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
@@ -33,7 +33,7 @@ main() {
33
33
local build_dir=" cmake-out/${example_dir} "
34
34
local cmake_prefix_path=" ${PWD} /cmake-out/lib/cmake/ExecuTorch;${PWD} /cmake-out/third-party/gflags"
35
35
rm -rf ${build_dir}
36
- cmake -DCMAKE_PREFIX_PATH=" ${cmake_prefix_path} " \
36
+ CXXFLAGS= " -fno-exceptions -fno-rtti " cmake -DCMAKE_PREFIX_PATH=" ${cmake_prefix_path} " \
37
37
-DCMAKE_BUILD_TYPE=Release \
38
38
-DEXECUTORCH_CADENCE_CPU_RUNNER=ON \
39
39
-DEXECUTORCH_ENABLE_LOGGING=ON \
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ cmake_install_executorch_lib() {
15
15
echo " Installing libexecutorch.a"
16
16
clean_executorch_install_folders
17
17
18
- retry cmake -DBUCK2=" $BUCK2 " \
18
+ CXXFLAGS= " -fno-exceptions -fno-rtti " retry cmake -DBUCK2=" $BUCK2 " \
19
19
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
20
20
-DCMAKE_INSTALL_PREFIX=cmake-out \
21
21
-DCMAKE_BUILD_TYPE=Release \
@@ -27,7 +27,7 @@ cmake_install_executorch_lib() {
27
27
}
28
28
29
29
test_cmake_size_test () {
30
- retry cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
30
+ CXXFLAGS= " -fno-exceptions -fno-rtti " retry cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
31
31
32
32
echo " Build size test"
33
33
cmake --build cmake-out/test -j9 --config Release
@@ -39,10 +39,6 @@ test_cmake_size_test() {
39
39
ls -al cmake-out/test/size_test_all_ops
40
40
}
41
41
42
- if [[ -z $BUCK2 ]]; then
43
- BUCK2=buck2
44
- fi
45
-
46
42
if [[ -z $PYTHON_EXECUTABLE ]]; then
47
43
PYTHON_EXECUTABLE=python3
48
44
fi
You can’t perform that action at this time.
0 commit comments