File tree Expand file tree Collapse file tree 5 files changed +22
-9
lines changed Expand file tree Collapse file tree 5 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ jobs:
195
195
-DCLANG_BUILD_TOOLS=OFF \
196
196
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_DIR \
197
197
../llvm
198
- emmake ninja clang cling lld gtest_main
198
+ EMCC_CFLAGS="-Oz -flto" emmake ninja clang cling lld gtest_main
199
199
else
200
200
# Apply patches
201
201
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
@@ -226,7 +226,7 @@ jobs:
226
226
-G Ninja \
227
227
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_DIR \
228
228
../llvm
229
- emmake ninja libclang clangInterpreter clangStaticAnalyzerCore lldWasm
229
+ EMCC_CFLAGS="-Oz -flto" emmake ninja libclang clangInterpreter clangStaticAnalyzerCore lldWasm
230
230
fi
231
231
cd ../
232
232
rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")
@@ -296,6 +296,7 @@ jobs:
296
296
-DLLVM_ENABLE_LIBPFM=OFF `
297
297
-DCLANG_BUILD_TOOLS=OFF `
298
298
..\llvm
299
+ $env:EMCC_CFLAGS="-Oz -flto"
299
300
emmake make clang cling lld gtest_main
300
301
}
301
302
else
@@ -337,6 +338,7 @@ jobs:
337
338
-DCLANG_BUILD_TOOLS=OFF `
338
339
-G Ninja `
339
340
..\llvm
341
+ $env:EMCC_CFLAGS="-Oz -flto"
340
342
emmake ninja libclang clangInterpreter clangStaticAnalyzerCore lldWasm
341
343
}
342
344
cd ..\
Original file line number Diff line number Diff line change @@ -100,9 +100,9 @@ emcmake cmake -DCMAKE_BUILD_TYPE=Release \
100
100
-DCLANG_BUILD_TOOLS=OFF \
101
101
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_DIR \
102
102
../llvm
103
- emmake make libclang -j $( nproc --all)
104
- emmake make clangInterpreter clangStaticAnalyzerCore -j $( nproc --all)
105
- emmake make lldWasm -j $( nproc --all)
103
+ EMCC_CFLAGS= " -Oz -flto " emmake make libclang -j $( nproc --all)
104
+ EMCC_CFLAGS= " -Oz -flto " emmake make clangInterpreter clangStaticAnalyzerCore -j $( nproc --all)
105
+ EMCC_CFLAGS= " -Oz -flto " emmake make lldWasm -j $( nproc --all)
106
106
```
107
107
108
108
or executing
@@ -131,7 +131,9 @@ emcmake cmake -DCMAKE_BUILD_TYPE=Release `
131
131
-DCLANG_BUILD_TOOLS=OFF `
132
132
-G Ninja `
133
133
..\llvm
134
+ $env:EMCC_CFLAGS="-Oz -flto"
134
135
emmake ninja libclang clangInterpreter clangStaticAnalyzerCore lldWasm
136
+ $env:EMCC_CFLAGS=""
135
137
```
136
138
137
139
on Windows. Once this finishes building we need to take note of where we built our llvm build. This can be done by executing the following on Linux and osx
Original file line number Diff line number Diff line change @@ -120,9 +120,9 @@ and osx
120
120
-DCLANG_BUILD_TOOLS=OFF \
121
121
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_DIR \
122
122
../llvm
123
- emmake make libclang -j $( nproc --all)
124
- emmake make clangInterpreter clangStaticAnalyzerCore -j $( nproc --all)
125
- emmake make lldWasm -j $( nproc --all)
123
+ EMCC_CFLAGS= " -Oz -flto " emmake make libclang -j $( nproc --all)
124
+ EMCC_CFLAGS= " -Oz -flto " emmake make clangInterpreter clangStaticAnalyzerCore -j $( nproc --all)
125
+ EMCC_CFLAGS= " -Oz -flto " emmake make lldWasm -j $( nproc --all)
126
126
127
127
or executing
128
128
@@ -151,7 +151,9 @@ or executing
151
151
- DCLANG_BUILD_TOOLS= OFF `
152
152
- G Ninja `
153
153
..\llvm
154
+ $env: EMCC_CFLAGS = " -Oz -flto"
154
155
emmake ninja libclang clangInterpreter clangStaticAnalyzerCore lldWasm
156
+ $env: EMCC_CFLAGS = " "
155
157
156
158
on Windows. Once this finishes building we need to take note of where we built our llvm build.
157
159
This can be done by executing the following on Linux and osx
Original file line number Diff line number Diff line change @@ -127,10 +127,16 @@ if(EMSCRIPTEN)
127
127
set_target_properties (clangCppInterOp
128
128
PROPERTIES NO_SONAME 1
129
129
)
130
+ target_compile_options (clangCppInterOp
131
+ PRIVATE "SHELL: -Oz"
132
+ PRIVATE "SHELL: -flto"
133
+ )
130
134
target_link_options (clangCppInterOp
131
135
PRIVATE "SHELL: -s WASM_BIGINT"
132
136
PRIVATE "SHELL: -s SIDE_MODULE=1"
133
137
PRIVATE "SHELL: ${SYMBOLS_LIST} "
138
+ PRIVATE "SHELL: -Oz"
139
+ PRIVATE "SHELL: -flto"
134
140
)
135
141
else ()
136
142
target_link_options (clangCppInterOp
Original file line number Diff line number Diff line change 50
50
-Wl,--export=_ZNK5clang4Type14isFloatingTypeEv
51
51
-Wl,--export=_ZNK5clang12FunctionDecl12getNumParamsEv
52
52
-Wl,--export=__clang_Interpreter_SetValueNoAlloc
53
- -Wl,--export=__clang_Interpreter_SetValueWithAlloc
53
+ -Wl,--export=__clang_Interpreter_SetValueWithAlloc
54
+ -Wl,--export=_ZN4llvm15SmallVectorBaseIjE8set_sizeEm
You can’t perform that action at this time.
0 commit comments