From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: xiaoyux.lu@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 22 May 2019 02:41:01 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2019 02:41:00 -0700 X-ExtLoop1: 1 Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 22 May 2019 02:41:00 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 22 May 2019 02:40:59 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 22 May 2019 02:40:59 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.126]) with mapi id 14.03.0415.000; Wed, 22 May 2019 17:40:58 +0800 From: "Xiaoyu Lu" To: "devel@edk2.groups.io" , "Rodriguez, Christian" CC: "Wang, Jian J" , "Ye, Ting" , "Zhu, Yonghong" Subject: Re: [edk2-devel] [Patch V3] OpensslLib: Missing local header files in [Sources] section of .INFs Thread-Topic: [edk2-devel] [Patch V3] OpensslLib: Missing local header files in [Sources] section of .INFs Thread-Index: AQHVEBnlaIUalkUFlE+d5VIzvDgeOKZ2u9LA Date: Wed, 22 May 2019 09:40:57 +0000 Message-ID: References: <20190521211215.13452-1-christian.rodriguez@intel.com> In-Reply-To: <20190521211215.13452-1-christian.rodriguez@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzM3NWU1MjItNjI2YS00NWE3LTkzOTAtYTZjODJhNjk0Mzc5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRkRCUGhVdjNSUDhiZmI2REtDOVd4eURwR212VmVCUDE1QVRwUFpINmtIa0d5cUJBV3VqNzArME5YZGNpUWJOcCJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: xiaoyux.lu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Christian,=20 (1) We use OpenSSL configure script disabled some OpenSSL feature. But I saw you include all .h files from OpenSSL(only excluded some).=20 Even some header files we don't need (In openssl/crypto/).=20 Can you rule them out?=20 I found OpenSSl use configdata.pm to store configure result. use configdata qw/%config/; foreach my $enabledcryptomodule (@{config{"%sdirs"}})=20 } Is it possible? If this is difficult, then I have no problem. (2) see blow. (3) I think it's better to separate this patch into two. Patch1. process_files.pl Patch2. OpensslLib[Crypto].conf > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Christian Rodriguez > Sent: Wednesday, May 22, 2019 5:12 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Ye, Ting ; = Zhu, > Yonghong > Subject: [edk2-devel] [Patch V3] OpensslLib: Missing local header files = in > [Sources] section of .INFs >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1821 >=20 > In V2: Remove opensslconf.h because it is a script generated header. > Update OpenSSL autogeneration script for .INFs because some > OpenSSL local headers are missing from [Sources] section of > OpensslLib.inf and OpensslLibCrypto.inf. Update OpensslLib.inf and > OpensslLibCrypto.inf using the updated script. Enforce compilance > of Edk2 INF Spec 3.9, which states, All HII Unicode format files > must be listed in [Sources] section. Not functional issue, just compilan= ce. >=20 > Signed-off-by: Christian Rodriguez > Cc: Jian Wang > Cc: Ting Ye > Cc: Yonghong Zhu > --- > CryptoPkg/Library/OpensslLib/OpensslLib.inf | 173 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 167 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++++++++++++++++ > CryptoPkg/Library/OpensslLib/process_files.pl | 50 > ++++++++++++++++++++++++++++++++++++++++++++++++-- > 3 files changed, 388 insertions(+), 2 deletions(-) >=20 > diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl > b/CryptoPkg/Library/OpensslLib/process_files.pl > index f6e1f43641..9cad6d3ebd 100755 > --- a/CryptoPkg/Library/OpensslLib/process_files.pl > +++ b/CryptoPkg/Library/OpensslLib/process_files.pl > @@ -115,12 +115,18 @@ BEGIN { > # Retrieve file lists from OpenSSL configdata > # > use configdata qw/%unified_info/; > +use Cwd qw(cwd getcwd); > +use Cwd; >=20 > my @cryptofilelist =3D (); > my @sslfilelist =3D (); > +my %includedirset =3D (); > foreach my $product ((@{$unified_info{libraries}}, > @{$unified_info{engines}})) { > foreach my $o (@{$unified_info{sources}->{$product}}) { > + foreach my $inc (@{%{$unified_info{includes}}{$o}}) { > + $includedirset{$inc} =3D 1; > + } > foreach my $s (@{$unified_info{sources}->{$o}}) { > next if ($unified_info{generate}->{$s}); > next if $s =3D~ "crypto/bio/b_print.c"; > @@ -133,6 +139,46 @@ foreach my $product ((@{$unified_info{libraries}}, > } > } >=20 > +my $fullpathcwd =3D getcwd . '/' . $OPENSSL_PATH . '/'; > +my $cwdpath =3D getcwd . '/'; > +my @sslincludefilelist =3D (); > +my @cryptoincludefilelist =3D (); > +# Current working directory header files > +foreach my $file (split (/\n/, `find . -maxdepth 1 -name "*.h"`)) { > + # Normalize path > + my @filearray =3D split("$cwdpath", Cwd::realpath($file)); > + my $pathstring =3D $filearray[1]; > + my $path =3D ' ' . $pathstring . "\r\n"; > + push @cryptoincludefilelist, $path; > +} > +# Header files below $OPENSSL_PATH > +foreach my $dir (keys %includedirset) { (2) If run process_files.pl twice, it possible generate different *.inf= =20 files(*.h files is disordered). "keys %includedirset" is disordered. I don't know whether this is a problem. > + foreach my $file (split (/\n/, `find $OPENSSL_PATH/$dir/ -name > "*.h"`)) { > + # Normalize path > + my @filearray =3D split("$fullpathcwd", Cwd::realpath($file)); > + my $pathstring =3D $filearray[1]; > + my $path =3D ' $(OPENSSL_PATH)/' . $pathstring . "\r\n"; > + # Don't reuse duplicates > + next if ( $path ~~ @cryptoincludefilelist ); > + next if ( $path ~~ @sslincludefilelist ); > + # Ignore these types > + next if ( $path =3D~ "test" ); > + next if ( $path =3D~ "apps" ); > + next if ( $path =3D~ "engines" ); > + next if ( $path =3D~ "fuzz" ); > + next if ( $path =3D~ "os-dep" ); > + next if ( $path =3D~ "e_os.h" ); > + next if ( $path =3D~ "opensslconf.h"); > + # Seperate Ssl only headers > + if ( $path =3D~ "/ssl/" ) { > + push @sslincludefilelist, $path; > + next; > + } > + push @cryptoincludefilelist, $path; > + } > +} > + > + > # > # Update OpensslLib.inf with autogenerated file list > # > @@ -141,7 +187,7 @@ my $subbing =3D 0; > print "\n--> Updating OpensslLib.inf ... "; > foreach (@inf) { > if ( $_ =3D~ "# Autogenerated files list starts here" ) { > - push @new_inf, $_, @cryptofilelist, @sslfilelist; > + push @new_inf, $_, @cryptofilelist, @sslfilelist, > @cryptoincludefilelist, @sslincludefilelist; > $subbing =3D 1; > next; > } > @@ -184,7 +230,7 @@ $subbing =3D 0; > print "\n--> Updating OpensslLibCrypto.inf ... "; > foreach (@inf) { > if ( $_ =3D~ "# Autogenerated files list starts here" ) { > - push @new_inf, $_, @cryptofilelist; > + push @new_inf, $_, @cryptofilelist, @cryptoincludefilelist; > $subbing =3D 1; > next; > } > -- > 2.19.1.windows.1 >=20 >=20 >=20