summaryrefslogtreecommitdiffstats
path: root/Configurations/descrip.mms.tmpl
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 /Configurations/descrip.mms.tmpl
parentb44882a0bd0717e0aab84f5dc3ef81ab673155e9 (diff)
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 'Configurations/descrip.mms.tmpl')
-rw-r--r--Configurations/descrip.mms.tmpl21
1 files changed, 17 insertions, 4 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index b1c00b7dc3..7393e225bc 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -132,7 +132,10 @@ DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
{- output_on() if $disabled{makedepend}; "" -}
GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
GENERATED={- # common0.tmpl provides @generated
- join(", ", map { (my $x = $_) =~ s|\.[sS]$|.asm|; "-\n\t".$x }
+ join(", ", map { my $x = $_;
+ $x =~ s|\.[sS]$|.asm|;
+ $x =~ s|\.ld$|.OPT|;
+ "-\n\t".$x }
@generated) -}
INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
@@ -748,12 +751,19 @@ reconfigure reconf :
sub generatesrc {
my %args = @_;
- (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
my $generator = join(" ", @{$args{generator}});
my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
- if ($target !~ /\.asm$/) {
+ if ($args{src} =~ /\.ld$/) {
+ (my $target = $args{src}) =~ s/\.ld$/.OPT/;
+ my $mkdef = sourcefile('util', 'mkdef.pl');
+ return <<"EOF";
+$target : $args{generator}->[0] $deps
+ \$(PERL) $mkdef $args{generator}->[1] "VMS" > $target
+EOF
+ } elsif ($target !~ /\.[sS]$/) {
+ my $target = $args{src};
if ($args{generator}->[0] =~ m|^.*\.in$|) {
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
"util", "dofile.pl")),
@@ -770,6 +780,7 @@ $target : $args{generator}->[0] $deps
EOF
}
} else {
+ (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
if ($args{generator}->[0] =~ /\.pl$/) {
$generator = '$(PERL)'.$generator_incs.' '.$generator;
} elsif ($args{generator}->[0] =~ /\.S$/) {
@@ -913,7 +924,9 @@ EOF
my @objs = map { (my $x = $_) =~ s|\.o$|.OBJ|; $x }
grep { $_ =~ m|\.o$| }
@{$args{objs}};
- my @defs = grep { $_ =~ /\.opt$/ } @{$args{objs}};
+ my @defs = map { (my $x = $_) =~ s|\.ld$|.OPT|; $x }
+ grep { $_ =~ /\.ld$/ }
+ @{$args{objs}};
my @deps = compute_lib_depends(@{$args{deps}});
die "More than one symbol vector" if scalar @defs > 1;
my $deps = join(", -\n\t\t", @objs, @defs, @deps);