X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=Configure;h=732220ef3aa0fa555ac7a5253442f94d72a7c6ab;hb=f1358634af5b84be22cb20fff3dcb613f5f8c978;hp=059271275d74e85bdf4e12ff7aa4cda540e8a2bd;hpb=4e360445473c3da938703a8142a36cf6ee86a191;p=openssl.git diff --git a/Configure b/Configure index 059271275d..732220ef3a 100755 --- a/Configure +++ b/Configure @@ -405,7 +405,6 @@ my @disablables = ( "tests", "threads", "tls", - "tls13downgrade", "ts", "ubsan", "ui-console", @@ -449,7 +448,6 @@ our %disabled = ( # "what" => "comment" "ssl3" => "default", "ssl3-method" => "default", "ubsan" => "default", - "tls13downgrade" => "default", "unit-test" => "default", "weak-ssl-ciphers" => "default", "zlib" => "default", @@ -1012,9 +1010,18 @@ if (scalar(@seed_sources) == 0) { print "Using os-specific seed configuration\n"; push @seed_sources, 'os'; } -die "Cannot seed with none and anything else" - if scalar(grep { $_ eq 'none' } @seed_sources) > 0 - && scalar(@seed_sources) > 1; +if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { + die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; + warn <<_____ if scalar(@seed_sources) == 1; +You have selected the --with-rand-seed=none option, which effectively disables +automatic reseeding of the OpenSSL random generator. All operations depending +on the random generator such as creating keys will not work unless the random +generator is seeded manually by the application. + +Please read the 'Note on random number generation' section in the INSTALL +instructions and the RAND_DRBG(7) manual page for more details. +_____ +} push @{$config{openssl_other_defines}}, map { (my $x = $_) =~ tr|[\-a-z]|[_A-Z]|; "OPENSSL_RAND_SEED_$x" } @seed_sources; @@ -1114,7 +1121,9 @@ $target{exe_extension}=""; $target{exe_extension}=".exe" if ($config{target} eq "DJGPP" || $config{target} =~ /^(?:Cygwin|mingw)/); $target{exe_extension}=".pm" if ($config{target} =~ /vos/); - +$target{def_extension}=".ld"; +$target{def_extension}=".def" if $config{target} =~ /^mingw|VC-/; +$target{def_extension}=".opt" if $config{target} =~ /^vms/; ($target{shared_extension_simple}=$target{shared_extension}) =~ s|\.\$\(SHLIB_VERSION_NUMBER\)|| unless defined($target{shared_extension_simple}); @@ -1434,7 +1443,7 @@ if (!$disabled{makedepend}) { } } -if (!$disabled{asm}) { +if (!$disabled{asm} && !$predefined{__MACH__} && $^O ne 'VMS') { # probe for -Wa,--noexecstack option... if ($predefined{__clang__}) { # clang has builtin assembler, which doesn't recognize --help, @@ -1442,7 +1451,7 @@ if (!$disabled{asm}) { # supported platforms even when it's meaningless. In other words # probe would fail, but probed option always accepted... push @{$config{cflags}}, "-Wa,--noexecstack", "-Qunused-arguments"; - } elsif ($^O ne 'VMS') { + } else { my $cc = $config{CROSS_COMPILE}.$config{CC}; open(PIPE, "$cc -Wa,--help -c -o null.$$.o -x assembler /dev/null 2>&1 |"); while() { @@ -2022,15 +2031,15 @@ EOF $o =~ s/\.[csS]$/.o/; # C and assembler $o =~ s/\.(cc|cpp)$/_cc.o/; # C++ $o = cleanfile($buildd, $o, $blddir); - $unified_info{sources}->{$ddest}->{$o} = 1; - $unified_info{sources}->{$o}->{$s} = 1; + $unified_info{sources}->{$ddest}->{$o} = -1; + $unified_info{sources}->{$o}->{$s} = -1; } elsif ($s =~ /\.rc$/) { # We also recognise resource files my $o = $_; $o =~ s/\.rc$/.res/; # Resource configuration my $o = cleanfile($buildd, $o, $blddir); - $unified_info{sources}->{$ddest}->{$o} = 1; - $unified_info{sources}->{$o}->{$s} = 1; + $unified_info{sources}->{$ddest}->{$o} = -1; + $unified_info{sources}->{$o}->{$s} = -1; } else { $unified_info{sources}->{$ddest}->{$s} = 1; } @@ -2058,20 +2067,20 @@ EOF $o =~ s/\.[csS]$/.o/; # C and assembler $o =~ s/\.(cc|cpp)$/_cc.o/; # C++ $o = cleanfile($buildd, $o, $blddir); - $unified_info{shared_sources}->{$ddest}->{$o} = 1; - $unified_info{sources}->{$o}->{$s} = 1; + $unified_info{shared_sources}->{$ddest}->{$o} = -1; + $unified_info{sources}->{$o}->{$s} = -1; } elsif ($s =~ /\.rc$/) { # We also recognise resource files my $o = $_; $o =~ s/\.rc$/.res/; # Resource configuration my $o = cleanfile($buildd, $o, $blddir); - $unified_info{shared_sources}->{$ddest}->{$o} = 1; - $unified_info{sources}->{$o}->{$s} = 1; - } elsif ($s =~ /\.(def|map|opt)$/) { - # We also recognise .def / .map / .opt files + $unified_info{shared_sources}->{$ddest}->{$o} = -1; + $unified_info{sources}->{$o}->{$s} = -1; + } elsif ($s =~ /\.ld$/) { + # We also recognise linker scripts (or corresponding) # We know they are generated files - my $def = cleanfile($buildd, $s, $blddir); - $unified_info{shared_sources}->{$ddest}->{$def} = 1; + my $ld = cleanfile($buildd, $_, $blddir); + $unified_info{shared_sources}->{$ddest}->{$ld} = 1; } else { die "unrecognised source file type for shared library: $s\n"; } @@ -2182,25 +2191,101 @@ EOF } } - # 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}}; + # Go through all intermediary files and change their names to something that + # reflects what they will be built for. Note that for some source files, + # this leads to duplicate object files because they are used multiple times. + # the goal is to rename all object files according to this scheme: + # {productname}-{midfix}-{origobjname}.[o|res] + # the {midfix} is a keyword indicating the type of product, which is mostly + # valuable for libraries since they come in two forms. + # + # This also reorganises the {sources} and {shared_sources} so that the + # former only contains ALL object files that are supposed to end up in + # static libraries and programs, while the latter contains ALL object files + # that are supposed to end up in shared libraries and DSOs. + # The main reason for having two different source structures is to allow + # the same name to be used for the static and the shared variants of a + # library. + { + # Take copies so we don't get interference from added stuff + my %unified_copy = (); + foreach (('sources', 'shared_sources')) { + $unified_copy{$_} = { %{$unified_info{$_}} } + if defined($unified_info{$_}); + delete $unified_info{$_}; + } + foreach my $prodtype (('programs', 'libraries', 'engines', 'scripts')) { + # $intent serves multi purposes: + # - give a prefix for the new object files names + # - in the case of libraries, rearrange the object files so static + # libraries use the 'sources' structure exclusively, while shared + # libraries use the 'shared_sources' structure exclusively. + my $intent = { + programs => { bin => { src => [ 'sources' ], + dst => 'sources' } }, + libraries => { lib => { src => [ 'sources' ], + dst => 'sources' }, + shlib => { prodselect => + sub { grep !/\.a$/, @_ }, + src => [ 'sources', + 'shared_sources' ], + dst => 'shared_sources' } }, + engines => { dso => { src => [ 'sources', + 'shared_sources' ], + dst => 'shared_sources' } }, + scripts => { script => { src => [ 'sources' ], + dst => 'sources' } } + } -> {$prodtype}; + foreach my $kind (keys %$intent) { + my @src = @{$intent->{$kind}->{src}}; + my $dst = $intent->{$kind}->{dst}; + my $prodselect = $intent->{$kind}->{prodselect} // sub { @_ }; + foreach my $prod ($prodselect->(keys %{$unified_info{$prodtype}})) { + # %prod_sources has all applicable objects as keys, and + # their corresponding sources as values + my %prod_sources = + map { $_ => [ keys %{$unified_copy{sources}->{$_}} ] } + map { keys %{$unified_copy{$_}->{$prod}} } + @src; + foreach (keys %prod_sources) { + # Only affect object files and resource files, + # the others simply get a new value + # (+1 instead of -1) + if ($_ =~ /\.(o|res)$/) { + (my $prodname = $prod) =~ s|\.a$||; + my $newobj = + catfile(dirname($_), + basename($prodname) + . '-' . $kind + . '-' . basename($_)); + $unified_info{$dst}->{$prod}->{$newobj} = 1; + foreach my $src (@{$prod_sources{$_}}) { + $unified_info{sources}->{$newobj}->{$src} = 1; + } + # Adjust dependencies + foreach my $deps (keys %{$unified_info{depends}->{$_}}) { + $unified_info{depends}->{$_}->{$deps} = -1; + $unified_info{depends}->{$newobj}->{$deps} = 1; + } + # Adjust includes + foreach my $k (('source', 'build')) { + next unless + defined($unified_info{includes}->{$_}->{$k}); + my @incs = @{$unified_info{includes}->{$_}->{$k}}; + $unified_info{includes}->{$newobj}->{$k} = [ @incs ]; + } + } else { + $unified_info{$dst}->{$prod}->{$_} = 1; + } + } } } } - delete $unified_info{includes}->{$dest}; } + # At this point, we have a number of sources with the value -1. They + # aren't part of the local build and are probably meant for a different + # platform, and can therefore be cleaned away. That happens when making + # %unified_info more efficient below. ### Make unified_info a bit more efficient # One level structures @@ -2210,8 +2295,15 @@ EOF # Two level structures foreach my $l1 (("install", "sources", "shared_sources", "ldadd", "depends")) { foreach my $l2 (sort keys %{$unified_info{$l1}}) { - $unified_info{$l1}->{$l2} = - [ sort keys %{$unified_info{$l1}->{$l2}} ]; + my @items = + sort + grep { $unified_info{$l1}->{$l2}->{$_} > 0 } + keys %{$unified_info{$l1}->{$l2}}; + if (@items) { + $unified_info{$l1}->{$l2} = [ @items ]; + } else { + delete $unified_info{$l1}->{$l2}; + } } } # Includes @@ -2226,9 +2318,11 @@ EOF push @{$unified_info{includes}->{$dest}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$dest}}; } - } else { + } elsif (defined($unified_info{includes}->{$dest}->{source})) { $unified_info{includes}->{$dest} = [ @{$unified_info{includes}->{$dest}->{source}} ]; + } else { + delete $unified_info{includes}->{$dest}; } } } @@ -2705,10 +2799,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** +*** *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** *** *** -*** perl configdata.pm --dump *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF