[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Wed Jan 24 15:00:00 UTC 2018


The branch OpenSSL_1_1_0-stable has been updated
       via  8054342b78d3ffbd3625689a9692ff1e5f709913 (commit)
       via  6a8dfb90b54ad1d3d87510b37e409bf568a4338f (commit)
      from  38454902208c358ffaa140aef3077c2316f82b19 (commit)


- Log -----------------------------------------------------------------
commit 8054342b78d3ffbd3625689a9692ff1e5f709913
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jan 23 19:13:48 2018 +0100

    Configure: ensure that a DEPEND generates the correct inclusion directory
    
    We incorrectly assumed that explicit dependencies meant that the
    source directory would be added for inclusion.  However, if the
    dependent file is generated, it's stored in the build directory, and
    that should be used for inclusion rather than the source directory.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5153)
    
    (cherry picked from commit e431bcfabd72163b0ee89674e2face26a349ba9c)

commit 6a8dfb90b54ad1d3d87510b37e409bf568a4338f
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jan 23 19:07:14 2018 +0100

    Configure: let INCLUDEs set on binaries "trickle down" to the objects
    
    This ensures that only one set of includes is associated with each
    object file, reagardless of where it's used.
    
    For example, if apps/build.info has this:
    
        SOURCE[openssl]=foo.c
        INCLUDE[openssl]=.. ../include
    
    and test/build.info has this:
    
        SOURCE[footest]=../apps/foo.c
        INCLUDE[footest]=../include
    
    The inclusion directories used for apps/foo.o would differ depending
    on which program's dependencies get generated first in the build file.
    
    With this change, all those INCLUDEs get combined into one set of
    inclusion directories tied to the object file.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5153)
    
    (cherry picked from commit 1b5ad51fc9b29d8893d5224f00bb3360f8aca465)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/common.tmpl |  6 ++----
 Configure                  | 53 ++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index 9d7fbf2..13ffe94 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -52,8 +52,7 @@
                              generator_incs => $unified_info{includes}->{$script},
                              generator_deps => $unified_info{depends}->{$script},
                              deps => $unified_info{depends}->{$src},
-                             incs => [ @{$unified_info{includes}->{$bin}},
-                                       @{$unified_info{includes}->{$obj}} ],
+                             incs => $unified_info{includes}->{$obj},
                              %opts);
          foreach (@{$unified_info{depends}->{$src}}) {
              dogenerate($_, $obj, $bin, %opts);
@@ -74,8 +73,7 @@
          $OUT .= src2obj(obj => $obj_no_o,
                          srcs => $unified_info{sources}->{$obj},
                          deps => $unified_info{depends}->{$obj},
-                         incs => [ @{$unified_info{includes}->{$bin}},
-                                   @{$unified_info{includes}->{$obj}} ],
+                         incs => $unified_info{includes}->{$obj},
                          %opts);
          foreach ((@{$unified_info{sources}->{$obj}},
                    @{$unified_info{depends}->{$obj}})) {
diff --git a/Configure b/Configure
index ecbebcc..933b9e6 100755
--- a/Configure
+++ b/Configure
@@ -1847,13 +1847,6 @@ EOF
                     $d = $unified_info{rename}->{$d};
                 }
                 $unified_info{depends}->{$ddest}->{$d} = 1;
-                # If we depend on a header file or a perl module, let's make
-                # sure it can get included
-                if ($dest ne "" && $d =~ /\.(h|pm)$/) {
-                    my $i = dirname($d);
-                    push @{$unified_info{includes}->{$ddest}->{source}}, $i
-                        unless grep { $_ eq $i } @{$unified_info{includes}->{$ddest}->{source}};
-                }
             }
         }
 
@@ -1880,6 +1873,47 @@ EOF
         }
     }
 
+    # Massage the result
+
+    # If we depend on a header file or a perl module, add an inclusion of
+    # its directory to allow smoothe inclusion
+    foreach my $dest (keys %{$unified_info{depends}}) {
+        next if $dest eq "";
+        foreach my $d (keys %{$unified_info{depends}->{$dest}}) {
+            next unless $d =~ /\.(h|pm)$/;
+            if ($d eq "configdata.pm"
+                    || defined($unified_info{generate}->{$d})) {
+                my $i = cleandir($blddir, dirname($d));
+                push @{$unified_info{includes}->{$dest}->{build}}, $i
+                    unless grep { $_ eq $i } @{$unified_info{includes}->{$dest}->{build}};
+            } else {
+                my $i = cleandir($srcdir, dirname($d));
+                push @{$unified_info{includes}->{$dest}->{source}}, $i
+                    unless grep { $_ eq $i } @{$unified_info{includes}->{$dest}->{source}};
+            }
+        }
+    }
+
+    # Trickle down includes placed on libraries, engines and programs to
+    # their sources (i.e. object files)
+    foreach my $dest (keys %{$unified_info{engines}},
+                      keys %{$unified_info{libraries}},
+                      keys %{$unified_info{programs}}) {
+        foreach my $k (("source", "build")) {
+            next unless defined($unified_info{includes}->{$dest}->{$k});
+            my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}};
+            foreach my $obj (grep /\.o$/,
+                             (keys %{$unified_info{sources}->{$dest}},
+                              keys %{$unified_info{shared_sources}->{$dest}})) {
+                foreach my $inc (@incs) {
+                    unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc
+                        unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}};
+                }
+            }
+        }
+        delete $unified_info{includes}->{$dest};
+    }
+
     ### Make unified_info a bit more efficient
     # One level structures
     foreach (("programs", "libraries", "engines", "scripts", "extra", "overrides")) {
@@ -1895,8 +1929,9 @@ EOF
     # Includes
     foreach my $dest (sort keys %{$unified_info{includes}}) {
         if (defined($unified_info{includes}->{$dest}->{build})) {
-            my @source_includes =
-                ( @{$unified_info{includes}->{$dest}->{source}} );
+            my @source_includes = ();
+            @source_includes = ( @{$unified_info{includes}->{$dest}->{source}} )
+                if defined($unified_info{includes}->{$dest}->{source});
             $unified_info{includes}->{$dest} =
                 [ @{$unified_info{includes}->{$dest}->{build}} ];
             foreach my $inc (@source_includes) {


More information about the openssl-commits mailing list