[erlang-questions] R16 + Centos + Crypto + ESL Package

Per Hedeland per@REDACTED
Wed Jul 30 22:07:08 CEST 2014

Данила Федящин <danilagamma@REDACTED> wrote:
>After some digging we found that `CFLAGS="-DOPENSSL_NO_EC=1"` rewrites
>`CFLAGS="-g -O2"`, which was the culprit of slowdown.

Ouch, I knew there was a reason I always try to avoid passing C compiler
flags to OTP's 'configure'.:-)

>So the question is: what is the best way to 'append' CFLAGS option, rather
>then providing '-DOPENSSL_NO_EC=1 -g -O2' assuming that we've appended
>correct default options?

The general, semi-ugly method I use when I need to pass some C compiler
flags is to create a wrapper, a la

$ cat /usr/local/softfloat/bin/gcc

exec /usr/local/gcc-4.2.4/bin/gcc -msoft-float "$@"

- and then make sure to have the directory with the wrapper early on in
$PATH. If I'm really ambitious I may name the wrapper gcc-<foo>-<bar>
and pass that as CC (IIRC) to 'configure'.

For this particular case though, if you aren't afraid to touch the
source, you can apply this diff instead:

--- lib/crypto/c_src/crypto.c   (revision 69183)
+++ lib/crypto/c_src/crypto.c   (revision 69184)
@@ -77,7 +77,8 @@
 #if OPENSSL_VERSION_NUMBER >= 0x009080ffL \
        && !defined(OPENSSL_NO_EC) \
        && !defined(OPENSSL_NO_ECDH) \
-       && !defined(OPENSSL_NO_ECDSA)
+       && !defined(OPENSSL_NO_ECDSA) \
+       && !defined(OPENSSL_NO_EC2M)
 # define HAVE_EC

I was actually about to report it as a bug fix, but found that R17 - uh,
17? - has much better one (it disables *only* the EC2M stuff which is
all that is missing on "current" CentOS/RHEL at least) - thanks to the
OTP team for that! - "in advance", we're not ready for "17" yet. If you
are, I suggest that you try it.

--Per Hedeland

More information about the erlang-questions mailing list