This repository was archived by the owner on Apr 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ declare_args() {
19
19
20
20
# Set this flag to cause bitcode to be marker only.
21
21
bitcode_marker = false
22
+
23
+ # Set this flag to strip .so files.
24
+ stripped_symbols = ! is_debug
22
25
}
23
26
24
27
declare_args () {
Original file line number Diff line number Diff line change @@ -176,6 +176,22 @@ template("gcc_toolchain") {
176
176
replace_command = " if ! cmp -s $temporary_tocname $tocfile ; then mv $temporary_tocname $tocfile ; fi"
177
177
178
178
command = " $link_command && $toc_command && $replace_command "
179
+ if (stripped_symbols ) {
180
+ if (defined (invoker .strip ) || defined (invoker .llvm_objcopy )) {
181
+ unstripped_outfile = " {{root_out_dir}}/lib.unstripped/$sofile "
182
+ pre_strip_command = " mkdir -p {{root_out_dir}}/lib.unstripped && cp $sofile {{root_out_dir}}/lib.unstripped/"
183
+ }
184
+ if (defined (invoker .strip )) {
185
+ strip = invoker .strip
186
+ strip_command =
187
+ " ${ strip } --strip-unneeded -o $sofile $unstripped_outfile "
188
+ command += " && " + pre_strip_command + " && " + strip_command
189
+ } else if (defined (invoker .llvm_objcopy )) {
190
+ strip = invoker .llvm_objcopy
191
+ strip_command = " ${ strip } --strip-all $unstripped_outfile $sofile "
192
+ command += " && " + pre_strip_command + " && " + strip_command
193
+ }
194
+ }
179
195
if (defined (invoker .postsolink )) {
180
196
command += " && " + invoker .postsolink
181
197
}
You can’t perform that action at this time.
0 commit comments