aboutsummaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-09-30 14:44:59 +0200
committerRichard Levitte <levitte@openssl.org>2018-10-01 09:49:16 +0200
commitef2dfc9902e015de91f015177bdf235c9000839e (patch)
tree61e6c5535dbf8c44096f6322defd2c88fdf4dfbf /Configure
parentb44882a0bd0717e0aab84f5dc3ef81ab673155e9 (diff)
downloadopenssl-ef2dfc9902e015de91f015177bdf235c9000839e.zip
openssl-ef2dfc9902e015de91f015177bdf235c9000839e.tar.gz
openssl-ef2dfc9902e015de91f015177bdf235c9000839e.tar.bz2
Refactor linker script generation
The generation of linker scripts was badly balanced, as all sorts of platform dependent stuff went into the top build.info, when that part should really be made as simply and generic as possible. Therefore, we move a lot of the "magic" to the build files templates, since they are the place for platform dependent things. What remains is to parametrize just enough in the build.info file to generate the linker scripts correctly for each associated library. "linker script" is a term usually reserved for certain Unix linkers. However, we only use them to say what symbols should be exported, so we use the term loosely for all platforms. The internal extension is '.ld', and is changed by the build file templates as appropriate for each target platform. Note that this adds extra meaning to the value of the shared_target attribute. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7333)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure19
1 files changed, 11 insertions, 8 deletions
diff --git a/Configure b/Configure
index a1db916..de4ca68 100755
--- a/Configure
+++ b/Configure
@@ -1121,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});
@@ -2074,11 +2076,11 @@ EOF
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
+ } 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, $s, $blddir);
+ $unified_info{shared_sources}->{$ddest}->{$ld} = 1;
} else {
die "unrecognised source file type for shared library: $s\n";
}
@@ -2189,7 +2191,7 @@ EOF
}
}
- # Go through all object files and change their names to something that
+ # 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:
@@ -2246,8 +2248,9 @@ EOF
map { keys %{$unified_copy{$_}->{$prod}} }
@src;
foreach (keys %prod_sources) {
- # Only affect object or resource files, the others
- # simply get a new value (+1 instead of -1)
+ # 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 =