openssl / openssl

TLS/SSL and crypto library
https://www.openssl.org
Apache License 2.0
25.52k stars 10.07k forks source link

Huge size difference between 1.1.1 and 3.0.X #20345

Open liyi77 opened 1 year ago

liyi77 commented 1 year ago

After upgrading to 3.0, the size of compiled binary will increase by >+50%, This is really a huge change... affecting backwards compatibility.

I've tried adding more no-x from https://github.com/openssl/openssl/blob/master/INSTALL.md, clipping the default provider, clipping object_dat and object_mac but with little effect, there is still about 30% growth. I am not very familiar with the structure of openssl, is there more effective ways to reduce the size? Thanks.

config list as: https://github.com/kraxel/edk2/blob/6fb6b61b93be4170de0ed12ae782b82c3c43a139/CryptoPkg/Library/OpensslLib/process_files.pl#L151-L211

slontis commented 1 year ago

OpenSSL 3.0 added a lot of code in order to support the providers - so it is going to be bigger.. The old code is still there so that engines still work also/ Apart from applying lots of no (e.g no-cmp), I am not sure you can do much else currently. I can see a tool that can compare files that might help? https://github.com/google/bloaty It may be possible that we need more config options to strip some of this stuff out..

xtkoba commented 1 year ago

See also: #13219

liyi77 commented 1 year ago

OpenSSL 3.0 added a lot of code in order to support the providers - so it is going to be bigger.. The old code is still there so that engines still work also/ Apart from applying lots of no (e.g no-cmp), I am not sure you can do much else currently. I can see a tool that can compare files that might help? https://github.com/google/bloaty It may be possible that we need more config options to strip some of this stuff out..

Thanks! It is useful. At least I known where to start if I have to trim the openssl library myself.

liyi77 commented 1 year ago

See also: #13219

Glad to see the community is already discussing this issue, thanks

nhorman commented 3 months ago

marking as inactive, will be closed at the completion of 3.4 dev without further input