Skip to content

Commit 190e026

Browse files
committed
Optimize size by removing unused data and functions
1 parent a444ce0 commit 190e026

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

rehlds/build.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,11 @@ void setupToolchain(NativeBinarySpec b) {
170170
} else {
171171
cfg.compilerOptions.args '-Qoption,cpp,--treat_func_as_string_literal_cpp'
172172
}
173-
173+
cfg.compilerOptions.args '-ffunction-sections', '-fdata-sections' // Remove unused code and data
174174
cfg.compilerOptions.args '-fno-rtti', '-fno-exceptions'
175+
176+
cfg.linkerOptions.args '-Wl,--version-script=../version_script.lds', '-Wl,--gc-sections'
177+
175178
cfg.projectLibpath(project, '/lib/linux32')
176179
cfg.extraLibs 'rt', 'dl', 'm', 'steam_api', 'aelf32'
177180
}

version_script.lds

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
HLDS_ABI_1.0 {
2+
global:
3+
CreateInterface;
4+
F;
5+
NET_Sleep_Timeout;
6+
local:
7+
*;
8+
};

0 commit comments

Comments
 (0)