[openssl-dev] [openssl.org #3605] bug report: compilation error and fix for OpenSSL on Cygwin64
Corinna Vinschen via RT
rt at openssl.org
Sat Dec 6 07:53:58 EST 2014
On Dec 5 18:06, Andy Polyakov via RT wrote:
> > OpenSSL is currently not supported under Cygwin64.
>
> Support for Cygwin64 will appear in 1.0.2, so that I'd like to hear a
> little bit more about what kind of problem does it cause. The Cygwin64
> support was submitted by Cygwin maintainer, and no additional issues
> were reported.
So far we didn't encounter any issues, but the OP is right. The
__CYGWIN32__ definition is very old and was already deprecated in the
late 1990's in favor of __CYGWIN__. As long as there was only a 32 bit
Cygwin anyway, that was no problem, but it's now.
I inspected the remaining two places where __CYGWIN32__ is used, and
both shouldn't result in problems:
e_os2.h:
# if defined(__CYGWIN32__) || defined(OPENSSL_SYSNAME_CYGWIN32)
OPENSSL_SYSNAME_CYGWIN32 is set anyway, so the additional check for
__CYGWIN32__ is redundant.
crypto/des/read_pwd.c:
#if defined(OPENSSL_SYS_MSDOS) && !defined(__CYGWIN32__) && !defined(OPENSSL_SYS_WINCE)
OPENSSL_SYS_MSDOS is never set for Cygwin, so the test for !__CYGWIN32__
is redundant as well.
I suggest to remove both. Along the same lines, I'd like to suggest to
replace OPENSSL_SYSNAME_CYGWIN32 with OPENSSL_SYSNAME_CYGWIN, and to get
rid of old, unused Cygwin targets in Configure.
Patch attached.
I'm just not sure about "debug-ulf". If that's not required anymore, it
should be removed, but that's not part of my patch.
As a sidenote, the Cygwin 64 bit patch has also been backported to
1.0.1, and it's currently used in the official Cygwin OpenSSH package
available as part of the Cygwin distro, see
https://cygwin.com/ml/cygwin-announce/2014-10/msg00027.html
https://cygwin.com/packages/x86_64/openssl/
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
Subject: [PATCH] Drop redundant and outdated __CYGWIN32__ tests. Change
OPENSSL_SYSNAME_CYGWIN32 to OPENSSL_SYSNAME_CYGWIN. Drop outdated Cygwin
targets.
Signed-off-by: Corinna Vinschen <vinschen at redhat.com>
---
Configure | 8 +++---
TABLE | 74 +++------------------------------------------------
crypto/des/read_pwd.c | 2 +-
e_os2.h | 2 +-
4 files changed, 8 insertions(+), 78 deletions(-)
diff --git a/Configure b/Configure
index 5e9337c..80aa223 100755
--- a/Configure
+++ b/Configure
@@ -184,7 +184,7 @@ my %table=(
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
"debug-bodo", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"debug-erbridge", "gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
-"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll",
+"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN:::${no_asm}:win32:cygwin-shared:::.dll",
"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@@ -568,10 +568,8 @@ my %table=(
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
# Cygwin
-"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
-"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
-"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN32::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
-"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
+"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
+"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
# NetWare from David Ward (dsward at novell.com)
# requires either MetroWerks NLM development tools, or gcc / nlmconv
diff --git a/TABLE b/TABLE
index d778dac..bd4d43e 100644
--- a/TABLE
+++ b/TABLE
@@ -345,7 +345,7 @@ $cc = gcc
$cflags = -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall
$unistd =
$thread_cflag =
-$sys_id = CYGWIN32
+$sys_id = CYGWIN
$lflags =
$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
$cpuid_obj = x86cpuid.o
@@ -374,46 +374,12 @@ $ranlib =
$arflags =
$multilib =
-*** Cygwin-pre1.3
-$cc = gcc
-$cflags = -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall
-$unistd =
-$thread_cflag = (unknown)
-$sys_id = CYGWIN32
-$lflags =
-$bn_ops = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
-$cpuid_obj =
-$bn_obj =
-$ec_obj =
-$des_obj =
-$aes_obj =
-$bf_obj =
-$md5_obj =
-$sha1_obj =
-$cast_obj =
-$rc4_obj =
-$rmd160_obj =
-$rc5_obj =
-$wp_obj =
-$cmll_obj =
-$modes_obj =
-$engines_obj =
-$perlasm_scheme = void
-$dso_scheme = win32
-$shared_target=
-$shared_cflag =
-$shared_ldflag =
-$shared_extension =
-$ranlib =
-$arflags =
-$multilib =
-
*** Cygwin-x86_64
$cc = gcc
$cflags = -DTERMIOS -DL_ENDIAN -O3 -Wall
$unistd =
$thread_cflag =
-$sys_id = CYGWIN32
+$sys_id = CYGWIN
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL
$cpuid_obj = x86_64cpuid.o
@@ -1666,40 +1632,6 @@ $ranlib =
$arflags =
$multilib =
-*** debug-Cygwin
-$cc = gcc
-$cflags = -DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
-$unistd =
-$thread_cflag =
-$sys_id = CYGWIN32
-$lflags =
-$bn_ops =
-$cpuid_obj =
-$bn_obj =
-$ec_obj =
-$des_obj =
-$aes_obj =
-$bf_obj =
-$md5_obj =
-$sha1_obj =
-$cast_obj =
-$rc4_obj =
-$rmd160_obj =
-$rc5_obj =
-$wp_obj =
-$cmll_obj =
-$modes_obj =
-$engines_obj =
-$perlasm_scheme = void
-$dso_scheme = dlfcn
-$shared_target= cygwin-shared
-$shared_cflag = -D_WINDLL
-$shared_ldflag = -shared
-$shared_extension = .dll.a
-$ranlib =
-$arflags =
-$multilib =
-
*** debug-VC-WIN32
$cc = cl
$cflags = -W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE
@@ -3099,7 +3031,7 @@ $cc = gcc
$cflags = -DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations
$unistd =
$thread_cflag =
-$sys_id = CYGWIN32
+$sys_id = CYGWIN
$lflags =
$bn_ops =
$cpuid_obj =
diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c
index 7e3f902..be74e47 100644
--- a/crypto/des/read_pwd.c
+++ b/crypto/des/read_pwd.c
@@ -169,7 +169,7 @@
#include <sys/ioctl.h>
#endif
-#if defined(OPENSSL_SYS_MSDOS) && !defined(__CYGWIN32__) && !defined(OPENSSL_SYS_WINCE)
+#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WINCE)
#include <conio.h>
#define fgets(a,b,c) noecho_fgets(a,b,c)
#endif
diff --git a/e_os2.h b/e_os2.h
index bbb2ab6..e4f6f2d 100644
--- a/e_os2.h
+++ b/e_os2.h
@@ -91,7 +91,7 @@ extern "C" {
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WIN32_UWIN
#else
-# if defined(__CYGWIN32__) || defined(OPENSSL_SYSNAME_CYGWIN32)
+# if defined(OPENSSL_SYSNAME_CYGWIN)
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WIN32_CYGWIN
# else
--
1.9.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mta.opensslfoundation.net/pipermail/openssl-dev/attachments/20141206/0901402c/attachment.sig>
More information about the openssl-dev
mailing list