Windows build system: get uplink right.

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Andy Polyakov 2016-03-18 23:31:17 +01:00
parent d8292af423
commit acf1525966
6 changed files with 16 additions and 34 deletions

View file

@ -125,7 +125,7 @@
template => 1,
apps_aux_src => add("../ms/applink.c"),
uplink_aux_src => add("../ms/uplink.c"),
shared_defines => add("OPENSSL_USE_APPLINK", { separator => undef }),
defines => add("OPENSSL_USE_APPLINK"),
},
x86_uplink => {
inherit_from => [ "uplink_common" ],

View file

@ -1237,7 +1237,7 @@ sub vc_wince_info {
dso_scheme => "win32",
},
"VC-noCE-common" => {
inherit_from => [ "VC-common", "uplink_common" ],
inherit_from => [ "VC-common" ],
cflags => add(picker(default => "-DUNICODE -D_UNICODE",
debug =>
sub {
@ -1268,7 +1268,8 @@ sub vc_wince_info {
build_scheme => add("VC-W64", { separator => undef }),
},
"VC-WIN64I" => {
inherit_from => [ "VC-WIN64-common", asm("ia64_asm") ],
inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
sub { $disabled{shared} ? () : "ia64_uplink" } ],
as => "ias",
asflags => "-d debug",
asoutflag => "-o",
@ -1277,7 +1278,8 @@ sub vc_wince_info {
perlasm_scheme => "ias",
},
"VC-WIN64A" => {
inherit_from => [ "VC-WIN64-common", asm("x86_64_asm") ],
inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
sub { $disabled{shared} ? () : "x86_64_uplink" } ],
as => sub { vc_win64a_info()->{as} },
asflags => sub { vc_win64a_info()->{asflags} },
asoutflag => sub { vc_win64a_info()->{asoutflag} },
@ -1289,7 +1291,8 @@ sub vc_wince_info {
"VC-WIN32" => {
# x86 Win32 target defaults to ANSI API, if you want UNICODE,
# configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
inherit_from => [ "VC-noCE-common", asm("x86_asm") ],
inherit_from => [ "VC-noCE-common", asm("x86_asm"),
sub { $disabled{shared} ? () : "x86_uplink" } ],
as => sub { my $ver=`nasm -v 2>NUL`;
my $vew=`nasmw -v 2>NUL`;
return $ver ge $vew ? "nasm" : "nasmw" },

View file

@ -15,6 +15,8 @@ GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)"
DEPEND[buildinf.h]=../configdata.pm
GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME)
GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl $(PERLASM_SCHEME)
GENERATE[uplink-ia64.s]=../ms/uplink-ia64.pl $(PERLASM_SCHEME)
GENERATE[x86cpuid.s]=x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(LIB_CFLAGS) $(PROCESSOR)
DEPEND[x86cpuid.s]=perlasm/x86asm.pl

View file

@ -1,5 +1,8 @@
#!/usr/bin/env perl
$output = pop;
open STDOUT,">$output";
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
push(@INC,"${dir}.");
@ -48,3 +51,5 @@ for ($i=1;$i<=$N;$i++) { print " data8 \@fptr(lazy$i#)\n"; }
print <<___;
.size OPENSSL_UplinkTable,.-OPENSSL_UplinkTable#
___
close STDOUT;

View file

@ -1,6 +1,6 @@
#!/usr/bin/env perl
$output=shift;
$output=pop;
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
open OUT,"| \"$^X\" ${dir}../crypto/perlasm/x86_64-xlate.pl $output";
*STDOUT=*OUT;

View file

@ -90,34 +90,6 @@ void OPENSSL_Uplink(volatile void **table, int index)
table[index] = func;
}
#if defined(_MSC_VER) && defined(_M_IX86) && !defined(OPENSSL_NO_INLINE_ASM)
# define LAZY(i) \
__declspec(naked) static void lazy##i (void) { \
_asm push i \
_asm push OFFSET OPENSSL_UplinkTable \
_asm call OPENSSL_Uplink \
_asm add esp,8 \
_asm jmp OPENSSL_UplinkTable+4*i }
# if APPLINK_MAX>25
# error "Add more stubs..."
# endif
/* make some in advance... */
LAZY(1) LAZY(2) LAZY(3) LAZY(4) LAZY(5)
LAZY(6) LAZY(7) LAZY(8) LAZY(9) LAZY(10)
LAZY(11) LAZY(12) LAZY(13) LAZY(14) LAZY(15)
LAZY(16) LAZY(17) LAZY(18) LAZY(19) LAZY(20)
LAZY(21) LAZY(22) LAZY(23) LAZY(24) LAZY(25)
void *OPENSSL_UplinkTable[] = {
(void *)APPLINK_MAX,
lazy1, lazy2, lazy3, lazy4, lazy5,
lazy6, lazy7, lazy8, lazy9, lazy10,
lazy11, lazy12, lazy13, lazy14, lazy15,
lazy16, lazy17, lazy18, lazy19, lazy20,
lazy21, lazy22, lazy23, lazy24, lazy25,
};
#endif
#ifdef SELFTEST
main()
{