diff options
author | Richard Levitte <levitte@openssl.org> | 2019-09-12 23:58:07 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-09-16 16:29:57 +0200 |
commit | 593d5c2fadd3c1322fa995e9ac9ced3af4d6468d (patch) | |
tree | 923d5668965ea6e87226257dca540ab8481b8d8b /Configurations | |
parent | clearing the ecx private key memory (diff) | |
download | openssl-593d5c2fadd3c1322fa995e9ac9ced3af4d6468d.tar.xz openssl-593d5c2fadd3c1322fa995e9ac9ced3af4d6468d.zip |
Build files: Unify standard arguments for assembler generating scrips
- Make the last argument always be the output file.
- Make the first argument always be the flavour, even if there is no
flavour (i.e. it might become the empty string).
- Make the next to last argument to be $(PROCESSOR) if that one has a
value.
- Remaining arguments are C prepropressor arguments.
Perl scripts that should handle this may use the following code:
$output = pop;
$flavour = shift;
if ($ARGV[$#ARGV] eq '386') {
# Do 386 specific things
} else {
# Do whatever else, with the knowledge the @ARGV contains
# C preprocessor arguments
}
Some scripts don't care about anything than $output, and that's ok.
Some scripts do care, but handle it a little differently, and that's
ok too (notably, the x86 scripts call asm_init() with the first and
the last argument after having popped $output).
As long as they handle the argument order right, they are going to
be fine.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9884)
Diffstat (limited to 'Configurations')
-rw-r--r-- | Configurations/descrip.mms.tmpl | 24 | ||||
-rw-r--r-- | Configurations/unix-Makefile.tmpl | 16 | ||||
-rw-r--r-- | Configurations/windows-makefile.tmpl | 19 |
3 files changed, 34 insertions, 25 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index 6cbbb01565..892102dd91 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -787,15 +787,6 @@ $target : $args{generator}->[0] $deps EOF } } else { - my $target = platform->asm($args{src}); - if ($args{generator}->[0] =~ /\.pl$/) { - $generator = '$(PERL)'.$generator_incs.' '.$generator; - } elsif ($args{generator}->[0] =~ /\.S$/) { - $generator = undef; - } else { - die "Generator type for $src unknown: $generator\n"; - } - my $cppflags = { shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', @@ -812,6 +803,17 @@ EOF my $incs_on = join("\n\t\@ ", @{$incs_cmds[0]}) || '!'; my $incs_off = join("\n\t\@ ", @{$incs_cmds[1]}) || '!'; my $defs = join("", map { ",".$_ } @{$args{defs}}); + my $target = platform->asm($args{src}); + + if ($args{generator}->[0] =~ /\.pl$/) { + $generator = '$(PERL)'.$generator_incs.' '.$generator + .' '.$cppflags; + } elsif ($args{generator}->[0] =~ /\.S$/) { + $generator = undef; + } else { + die "Generator type for $src unknown: $generator\n"; + } + if (defined($generator)) { # If the target is named foo.S in build.info, we want to # end up generating foo.s in two steps. @@ -832,7 +834,11 @@ EOF # Otherwise.... return <<"EOF"; $target : $args{generator}->[0] $deps + \@ $incs_on + \@ extradefines = "$defs" $generator \$\@ + \@ DELETE/SYMBOL/LOCAL extradefines + \@ $incs_off EOF } return <<"EOF"; diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 1e8a84f946..36cb253bf2 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -980,8 +980,16 @@ $args{src}: $args{generator}->[0] $deps EOF } } else { + my $cppflags = { + shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', + lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', + dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', + bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' + } -> {$args{intent}}; + if ($args{generator}->[0] =~ /\.pl$/) { - $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator; + $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator + .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)'; } elsif ($args{generator}->[0] =~ /\.m4$/) { $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >' } elsif ($args{generator}->[0] =~ /\.S$/) { @@ -990,12 +998,6 @@ EOF die "Generator type for $args{src} unknown: $generator\n"; } - my $cppflags = { - shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', - lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', - dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', - bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' - } -> {$args{intent}}; if (defined($generator)) { return <<"EOF"; $args{src}: $args{generator}->[0] $deps diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index a211c2277d..bfe88f6cc9 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -570,22 +570,23 @@ $target: "$args{generator}->[0]" $deps EOF } } else { + my $cppflags = { + shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', + lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', + dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', + bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' + } -> {$args{intent}}; my $target = platform->asm($args{src}); + if ($args{generator}->[0] =~ /\.pl$/) { - $generator = '"$(PERL)"'.$generator_incs.' '.$generator; + $generator = '"$(PERL)"'.$generator_incs.' '.$generator + .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)'; } elsif ($args{generator}->[0] =~ /\.S$/) { $generator = undef; } else { die "Generator type for $src unknown: $generator\n"; } - my $cppflags = $incs; - $cppflags .= { - shlib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)', - lib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)', - dso => ' $(DSO_CFLAGS) $(DSO_CPPFLAGS)', - bin => ' $(BIN_CFLAGS) $(BIN_CPPFLAGS)' - } -> {$args{intent}}; if (defined($generator)) { # If the target is named foo.S in build.info, we want to # end up generating foo.s in two steps. @@ -594,7 +595,7 @@ EOF $target: "$args{generator}->[0]" $deps set ASM=\$(AS) $generator \$@.S - \$(CPP) $cppflags $defs \$@.S > \$@.i && move /Y \$@.i \$@ + \$(CPP) $incs $cppflags $defs \$@.S > \$@.i && move /Y \$@.i \$@ del /Q \$@.S EOF } |