From fe5772e9d0b8ec75087baaff2f6cdd961b36e253 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sat, 27 Oct 2012 21:16:45 +0000 Subject: [PATCH] util/fipslink.pl: allow for single-step link. --- util/fipslink.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/util/fipslink.pl b/util/fipslink.pl index 8b6fbad7d8..2eb033b7c5 100644 --- a/util/fipslink.pl +++ b/util/fipslink.pl @@ -33,14 +33,23 @@ check_hash($sha1_exe, "fipscanister.lib"); print "Integrity check OK\n"; -print "$fips_cc $fips_cc_args $fips_libdir/fips_premain.c\n"; -system "$fips_cc $fips_cc_args $fips_libdir/fips_premain.c"; -die "First stage Compile failure" if $? != 0; +if (grep /fips_premain\.obj/,@ARGV) { + print "$fips_cc $fips_cc_args $fips_libdir/fips_premain.c\n"; + system "$fips_cc $fips_cc_args $fips_libdir/fips_premain.c"; + die "First stage Compile failure" if $? != 0; +} elsif (!defined($ENV{FIPS_SIG})) { + die "no fips_premain.obj"; +} print "$fips_link @ARGV\n"; system "$fips_link @ARGV"; die "First stage Link failure" if $? != 0; +if (defined($ENV{FIPS_SIG})) { + system "$ENV{FIPS_SIG} $fips_target\n" + die "$ENV{FIPS_SIG} $fips_target failed" if $? != 0; + exit; +} print "$fips_premain_dso $fips_target\n"; system("$fips_premain_dso $fips_target >$fips_target.sha1"); -- 2.25.1