Windows build system: get uplink right.
authorAndy Polyakov <appro@openssl.org>
Fri, 18 Mar 2016 22:31:17 +0000 (23:31 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 21 Mar 2016 10:27:57 +0000 (11:27 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Configurations/00-base-templates.conf
Configurations/10-main.conf
crypto/build.info
ms/uplink-ia64.pl
ms/uplink-x86_64.pl
ms/uplink.c

index c284af6934080168174980aa25b5523462dfb302..5fe038cc02f3d32953d9ecf6d22d62e7d0955ee3 100644 (file)
        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" ],
index 8909700510910385119f6cf995acc40b66170f6c..459de9cd307e927e492cfcfffcc184029cf758cf 100644 (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" },
index 64bf2b47489962fe9297ab3189e9af6065efc260..217dc62430df3fc5648db20f2f08e2d0d308cc60 100644 (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
index 4204c73d586df17776591c7e94b038a80d62a261..089cd3913fb1b23bf290028331609ab9c815f1dc 100755 (executable)
@@ -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;
index 48bf559ee120d80196d2a1a021c4715d74a5caba..0cb0f1b3000fca1bc19d826e0a2275540f6789b4 100755 (executable)
@@ -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;
index e58ab9d8f58e14f799ffb69fdedd364d95c642a5..4f480a7981712dde22e522f6d6e3890ef243d8d6 100644 (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()
 {