Is there a reason to not have a debug-linux-x86_64 entry in Configure?
I've tried adding such line (without libefence) and I only got 2
warnings.
Please find in attachment a working patch.
After applying the patch, on my x86_64 platform openssl compiles with:
./config [-shared] -d -Werror
The first warning is due to BN_CTX_DEBUG: an unsigned int printed as "%
08x". I don't know which is the best way to solve this issue according
to OSSL best practice, for this reason I have omitted -DBN_CTX_DEBUG in
the compiler flags.
The second one is a double definition of the sqr macro in bn.
#undef sqr
was missing at crypto/bn/asm/x86_64-gcc.c:66
Finally I've tested s_server-s_client with valgrind (and -DPURIFY) and I
got no errors, only 8 missing free(). The following is s_server:
==23185== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 2)
==23185== malloc/free: in use at exit: 480 bytes in 8 blocks.
==23185== malloc/free: 4,926 allocs, 4,918 frees, 390,160 bytes
allocated.
==23185== For counts of detected errors, rerun with: -v
==23185== searching for pointers to 8 not-freed blocks.
==23185== checked 286,800 bytes.
Best,
--
Emanuele Cesena <[email protected]>
Il corpo non ha ideali
diff -ur openssl-orig/Configure openssl-devel/Configure
--- openssl-orig/Configure 2009-04-06 16:31:34.000000000 +0200
+++ openssl-devel/Configure 2009-07-06 17:09:00.697041757 +0200
@@ -347,6 +347,7 @@
"linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
+"debug-linux-x86_64", "gcc:-m64 -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
#### SPARC Linux setups
# Ray Miller <[email protected]> has patiently
diff -ur openssl-orig/crypto/bn/asm/x86_64-gcc.c openssl-devel/crypto/bn/asm/x86_64-gcc.c
--- openssl-orig/crypto/bn/asm/x86_64-gcc.c 2009-01-11 17:17:26.000000000 +0100
+++ openssl-devel/crypto/bn/asm/x86_64-gcc.c 2009-07-06 17:09:00.634041755 +0200
@@ -63,6 +63,7 @@
#undef mul
#undef mul_add
+#undef sqr
/*
* "m"(a), "+m"(r) is the way to favor DirectPath �-code;