[edk2-devel] [PATCH v4 2/7] CryptoPkg/OpensslLib: Exclude unnecessary files in process_files.pl

Xiaoyu lu posted 7 patches 6 years, 8 months ago
[edk2-devel] [PATCH v4 2/7] CryptoPkg/OpensslLib: Exclude unnecessary files in process_files.pl
Posted by Xiaoyu lu 6 years, 8 months ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1089

When running process_files.py to configure OpenSSL, we can exclude
some unnecessary files. This can reduce porting time, compiling
time and library size.

Upstream OpenSSL commit 71a5516dcc8a which was as part of
OpenSSL_1_1_1b, Add the STORE module(crypto/store/*).
But UEFI don't use them. So exclude these files.

Functions in crypto/rand/randfile.c OpenSSL and edk2 don't
call them. And it requires more crt runtime support.
So exclude it.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
---
 CryptoPkg/Library/OpensslLib/process_files.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl
index 6c136cca092a..e277108f0734 100755
--- a/CryptoPkg/Library/OpensslLib/process_files.pl
+++ b/CryptoPkg/Library/OpensslLib/process_files.pl
@@ -127,6 +127,12 @@ foreach my $product ((@{$unified_info{libraries}},
         foreach my $s (@{$unified_info{sources}->{$o}}) {
             next if ($unified_info{generate}->{$s});
             next if $s =~ "crypto/bio/b_print.c";
+
+            # No need to add unused files in UEFI.
+            # So it can reduce porting time, compile time, library size.
+            next if $s =~ "crypto/rand/randfile.c";
+            next if $s =~ "crypto/store/";
+
             if ($product =~ "libssl") {
                 push @sslfilelist, '  $(OPENSSL_PATH)/' . $s . "\r\n";
                 next;
-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40763): https://edk2.groups.io/g/devel/message/40763
Mute This Topic: https://groups.io/mt/31638506/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v4 2/7] CryptoPkg/OpensslLib: Exclude unnecessary files in process_files.pl
Posted by Laszlo Ersek 6 years, 8 months ago
On 05/16/19 09:54, Xiaoyu lu wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1089
> 
> When running process_files.py to configure OpenSSL, we can exclude
> some unnecessary files. This can reduce porting time, compiling
> time and library size.
> 
> Upstream OpenSSL commit 71a5516dcc8a which was as part of
> OpenSSL_1_1_1b, Add the STORE module(crypto/store/*).
> But UEFI don't use them. So exclude these files.
> 
> Functions in crypto/rand/randfile.c OpenSSL and edk2 don't
> call them. And it requires more crt runtime support.
> So exclude it.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ting Ye <ting.ye@intel.com>
> Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
> ---
>  CryptoPkg/Library/OpensslLib/process_files.pl | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl
> index 6c136cca092a..e277108f0734 100755
> --- a/CryptoPkg/Library/OpensslLib/process_files.pl
> +++ b/CryptoPkg/Library/OpensslLib/process_files.pl
> @@ -127,6 +127,12 @@ foreach my $product ((@{$unified_info{libraries}},
>          foreach my $s (@{$unified_info{sources}->{$o}}) {
>              next if ($unified_info{generate}->{$s});
>              next if $s =~ "crypto/bio/b_print.c";
> +
> +            # No need to add unused files in UEFI.
> +            # So it can reduce porting time, compile time, library size.
> +            next if $s =~ "crypto/rand/randfile.c";
> +            next if $s =~ "crypto/store/";
> +
>              if ($product =~ "libssl") {
>                  push @sslfilelist, '  $(OPENSSL_PATH)/' . $s . "\r\n";
>                  next;
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40813): https://edk2.groups.io/g/devel/message/40813
Mute This Topic: https://groups.io/mt/31638506/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-