Commit fe5772e9 authored by Andy Polyakov's avatar Andy Polyakov
Browse files

util/fipslink.pl: allow for single-step link.

parent 8be18f34
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -33,14 +33,23 @@ check_hash($sha1_exe, "fipscanister.lib");

print "Integrity check OK\n";

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");