From: Andy Polyakov Date: Fri, 18 Mar 2016 22:31:17 +0000 (+0100) Subject: Windows build system: get uplink right. X-Git-Tag: OpenSSL_1_1_0-pre5~272 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=acf1525966161dc5d0f875d92ae3def5df628245 Windows build system: get uplink right. Reviewed-by: Richard Levitte --- diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index c284af6934..5fe038cc02 100644 --- a/Configurations/00-base-templates.conf +++ b/Configurations/00-base-templates.conf @@ -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" ], diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 8909700510..459de9cd30 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -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" }, diff --git a/crypto/build.info b/crypto/build.info index 64bf2b4748..217dc62430 100644 --- a/crypto/build.info +++ b/crypto/build.info @@ -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 diff --git a/ms/uplink-ia64.pl b/ms/uplink-ia64.pl index 4204c73d58..089cd3913f 100755 --- a/ms/uplink-ia64.pl +++ b/ms/uplink-ia64.pl @@ -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; diff --git a/ms/uplink-x86_64.pl b/ms/uplink-x86_64.pl index 48bf559ee1..0cb0f1b300 100755 --- a/ms/uplink-x86_64.pl +++ b/ms/uplink-x86_64.pl @@ -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; diff --git a/ms/uplink.c b/ms/uplink.c index e58ab9d8f5..4f480a7981 100644 --- a/ms/uplink.c +++ b/ms/uplink.c @@ -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() {