<font size=2 face="sans-serif">Dear colleagues, </font>
<br>
<br><font size=2 face="sans-serif"> When including SSL support, I'm
still having an issue during the build of Erlang from the source
under SUSE SLES 11 SP1 S390 platform. The error remains in the Erlang crypto
module (openssl) and relates to a missing -fPIC compiler flag. I've
tried to set the following flags to force the -fPIC flag.
</font>
<br>
<br><tt><font size=2>export CFLAGS="$CFLAGS -fPIC"</font></tt>
<br><tt><font size=2>export CXXFLAGS="$CXXFLAGS -fPIC"</font></tt>
<br><tt><font size=2>export CC="gcc -fPIC"</font></tt>
<br>
<br><font size=2 face="sans-serif">The -fPIC flag shows shows up in the
previous gcc executions, but in this step it gets overwritten by the -shared
option. Is there any option that configures the compile of the crypto module,
or a place where I could modify this argument? </font><tt><font size=2>
</font></tt>
<br>
<br><tt><font size=2>make </font></tt>
<br><tt><font size=2>...</font></tt>
<br><tt><font size=2>make[3]: Entering directory `/opt/erlang/otp_src_R14B03/lib/crypto/c_src'</font></tt>
<br><tt><font size=2>make -f s390x-ibm-linux-gnu/Makefile TYPE=opt</font></tt>
<br><tt><font size=2>make[4]: Entering directory `/opt/erlang/otp_src_R14B03/lib/crypto/c_src'</font></tt>
<br><tt><font size=2>/usr/bin/install -c -d ../priv/lib/s390x-ibm-linux-gnu</font></tt>
<br><tt><font size=2>gcc -fPIC -shared -Wl,-Bsymbolic -o ../priv/lib/s390x-ibm-linux-gnu/crypto.so
../priv/obj/s390x-ibm-linux-gnu/crypto.o -Wl,-R/usr/local/ssl/lib
-Wl,-R/usr/local/lib64 -Wl,-R/usr/sfw/lib64 -Wl,-R/opt/local/lib64 -Wl,-R/usr/lib64
-Wl,-R/usr/pkg/lib64 -Wl,-R/usr/local/openssl/lib64 -Wl,-R/usr/lib/openssl/lib64
-Wl,-R/usr/openssl/lib64 -Wl,-R/usr/local/ssl/lib64 -Wl,-R/usr/lib/ssl/lib64
-Wl,-R/usr/ssl/lib64 -Wl,-R/usr/local/lib -Wl,-R/usr/sfw/lib -Wl,-R/opt/local/lib
-Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/local/openssl/lib -Wl,-R/usr/lib/openssl/lib
-Wl,-R/usr/openssl/lib -Wl,-R/usr/lib/ssl/lib -Wl,-R/usr/ssl/lib -L/usr/local/ssl/lib
-lcrypto</font></tt>
<br><tt><font size=2>/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:
/usr/local/ssl/lib/libcrypto.a(mem_clr.o): relocation R_390_PC32DBL against
`memchr@@GLIBC_2.2' can not be used when making a shared object; </font></tt><tt><font size=2 color=#800000><b>recompile
with -fPIC</b></font></tt>
<br><tt><font size=2>/usr/lib64/gcc/s390x-suse-linux/4.3/../../../../s390x-suse-linux/bin/ld:
final link failed: Bad value</font></tt>
<br><tt><font size=2>collect2: ld returned 1 exit status</font></tt>
<br><tt><font size=2>make[4]: *** [../priv/lib/s390x-ibm-linux-gnu/crypto.so]
Error 1</font></tt>
<br><tt><font size=2>make[4]: Leaving directory `/opt/erlang/otp_src_R14B03/lib/crypto/c_src'</font></tt>
<br><tt><font size=2>make[3]: *** [opt] Error 2</font></tt>
<br><tt><font size=2>make[3]: Leaving directory `/opt/erlang/otp_src_R14B03/lib/crypto/c_src'</font></tt>
<br><tt><font size=2>make[2]: *** [opt] Error 2</font></tt>
<br><tt><font size=2>make[2]: Leaving directory `/opt/erlang/otp_src_R14B03/lib/crypto'</font></tt>
<br><tt><font size=2>make[1]: *** [opt] Error 2</font></tt>
<br><tt><font size=2>make[1]: Leaving directory `/opt/erlang/otp_src_R14B03/lib'</font></tt>
<br><tt><font size=2>make: *** [libs] Error 2</font></tt>
<br>
<br>
<br><font size=2 face="sans-serif">Thanks in advance for your support.
</font>
<br>
<br><font size=2 face="sans-serif">Regards, </font>
<br><font size=2 face="sans-serif">Claude</font>
<br><font size=2 face="sans-serif"><br>
</font><font size=1 color=#a2a2a2 face="Arial"><b><br>
Claude Falbriard <br>
Certified IT Specialist L2 - Middleware<br>
AMS Hortolândia / SP - Brazil<br>
phone: +55 19 9837 0789<br>
cell: +55 13 8117 3316<br>
e-mail: claudef@br.ibm.com<br>
</b></font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">CGS <cgsmcmlxxv@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">claudef@br.ibm.com</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">erlang-questions@erlang.org</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">26/04/2012 18:27</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [erlang-questions]
Issues with Erlang Build under SUSE SLES 11 SP 1 on S390</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>I suppose you can pass --with-ssl-lib=SSL_LIBRARY_PATH
and --with-ssl-include=SSL_INCLUDE_PATH.<br>
<br>
And, yes, there should be libopenssl-devel under SuSE.<br>
<br>
CGS<br>
<br>
<br>
<br>
</font>
<br><font size=3>On Thu, Apr 26, 2012 at 8:20 PM, <</font><a href=mailto:claudef@br.ibm.com target=_blank><font size=3 color=blue><u>claudef@br.ibm.com</u></font></a><font size=3>>
wrote:</font>
<br><font size=3 face="sans-serif">Dear colleagues, </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
Thanks, for the quick reply. The issue with the </font><tt><font size=3>crypto.c</font></tt><font size=3 face="sans-serif">
clearly relates to OpenSSL. Unfortunately an openssl-devel package
is not available from Novell SUSE. I've downloaded the latest source
packages of Kerberos 5 (MIT) and as well as OpenSSL. Remains some doubts
how to use the configuration arguments described in the Erlang install
process </font><font size=3><br>
</font><tt><font size=3><br>
--with-ssl=PATH</font></tt><font size=3> - Specify location of OpenSSL
include and lib <br>
</font><font size=3 face="sans-serif"><br>
Is there an example how to setup this PATH? </font><font size=3>
<br>
</font><font size=3 face="sans-serif"><u><br>
Questions: </u></font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
1 - What exactly goes into the PATH argument of </font><tt><font size=3>with-ssl=</font></tt><font size=3 face="sans-serif">
? Is there an example how to use it? </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
2 - Why does the /configure shell search for the </font><tt><font size=3>krb5.h</font></tt><font size=3 face="sans-serif">
only under the location of </font><tt><font size=3> /usr/include</font></tt><font size=3 face="sans-serif">
</font><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
Those are the locations generated by Kerberos5: </font><font size=3>
</font><tt><font size=3><br>
/usr/local/include/krb5.h</font></tt><font size=3> </font><tt><font size=3><br>
/usr/local/include/krb5/krb5.h</font></tt><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
and for the openssl package</font><font size=3> </font><tt><font size=3><br>
/usr/local/ssl/bin/openssl</font></tt><font size=3> </font><tt><font size=3><br>
/usr/local/ssl/include/openssl</font></tt><font size=3> <br>
</font><tt><font size=3><br>
3. </font></tt><font size=3 face="sans-serif">Any modules need to be placed
under </font><tt><font size=3>/usr/include</font></tt><font size=3 face="sans-serif">
(default path of ./configure) ? </font><font size=3><br>
</font><font size=3 face="sans-serif"><br>
Thanks in advance for your support to add crypto (ssl) suport to Erlang.
</font>
<br><font size=3 face="sans-serif"><br>
Regards, <br>
Claude</font><font size=3> </font><font size=3 face="sans-serif"><br>
</font><font size=1 color=#a2a2a2 face="Arial"><b><br>
<br>
Claude Falbriard <br>
Certified IT Specialist L2 - Middleware<br>
AMS Hortolândia / SP - Brazil<br>
phone: +55 19 9837 0789<br>
cell: +55 13 8117 3316<br>
e-mail: </b></font><a href=mailto:claudef@br.ibm.com target=_blank><font size=1 color=blue face="Arial"><b><u>claudef@br.ibm.com</u></b></font></a><font size=3><br>
<br>
<br>
<br>
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">CGS <</font><a href=mailto:cgsmcmlxxv@gmail.com target=_blank><font size=1 color=blue face="sans-serif"><u>cgsmcmlxxv@gmail.com</u></font></a><font size=1 face="sans-serif">></font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
To: </font><a href=mailto:claudef@br.ibm.com target=_blank><font size=1 color=blue face="sans-serif"><u>claudef@br.ibm.com</u></font></a><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Cc: </font><font size=1 face="sans-serif">Erlang-Questions
Questions <</font><a href="mailto:erlang-questions@erlang.org" target=_blank><font size=1 color=blue face="sans-serif"><u>erlang-questions@erlang.org</u></font></a><font size=1 face="sans-serif">></font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Date: </font><font size=1 face="sans-serif">26/04/2012
10:03</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
Subject: </font><font size=1 face="sans-serif">Re:
[erlang-questions] Issues with Erlang Build under SUSE SLES 11 SP 1 on
S390</font><font size=3> <br>
</font>
<hr noshade>
<br><font size=3><br>
<br>
<br>
Hi,<br>
<br>
I suppose you need to install OpenSSL-dev (from the error it looks like
you are missing some OpenSSL headers).<br>
<br>
CGS<br>
<br>
<br>
<br>
<br>
<br>
On Thu, Apr 26, 2012 at 2:17 PM, <</font><a href=mailto:claudef@br.ibm.com target=_blank><font size=3 color=blue><u>claudef@br.ibm.com</u></font></a><font size=3>>
wrote: </font><font size=3 face="sans-serif"><br>
Dear colleagues,</font><font size=3> </font><font size=3 face="sans-serif"><br>
<br>
I'm compiling an Erlang environment under the SUSE SLES 11
SP1 on a S390 platform building it from the source. I'm facing an error
condition when adding the support for OpenSSL and Erlang "crypto"
support using the following configuration: <br>
<br>
.</font><tt><font size=3>/configure --with-ssl --with-ssl=/usr/lib64/openssl</font></tt><font size=3>
</font><font size=3 face="sans-serif"><br>
<br>
The configure completes normal, but the subsequent "make" step
throws a sequence of errors like this: <br>
.. </font><tt><font size=3><br>
crypto.c: In function âhmac_md5â:</font></tt><font size=3> </font><tt><font size=3><br>
crypto.c:1713: error: âMD5_CTXâ undeclared (first use in this function)</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c:1713: error: expected â;â before âctxâ</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c:1714: warning: ISO C90 forbids mixed declarations and code</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c:1737: error: âctxâ undeclared (first use in this function)</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c: In function âhmac_sha1â:</font></tt><font size=3> </font><tt><font size=3><br>
crypto.c:1752: error: âSHA_CTXâ undeclared (first use in this function)</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c:1752: error: expected â;â before âctxâ</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c:1753: warning: ISO C90 forbids mixed declarations and code</font></tt><font size=3>
</font><tt><font size=3><br>
crypto.c:1776: error: âctxâ undeclared (first use in this function)</font></tt><font size=3>
</font><tt><font size=3><br>
make[4]: *** [../priv/obj/s390x-ibm-linux-gnu/crypto.o] Error 1</font></tt><font size=3>
</font><tt><font size=3><br>
make[4]: Leaving directory `/opt/erlang/otp_src_R14B03/lib/crypto/c_src'</font></tt><font size=3>
</font><tt><font size=3><br>
make[3]: *** [opt] Error 2</font></tt><font size=3> </font><tt><font size=3><br>
make[3]: Leaving directory `/opt/erlang/otp_src_R14B03/lib/crypto/c_src'</font></tt><font size=3>
</font><tt><font size=3><br>
make[2]: *** [opt] Error 2</font></tt><font size=3> </font><tt><font size=3><br>
make[2]: Leaving directory `/opt/erlang/otp_src_R14B03/lib/crypto'</font></tt><font size=3>
</font><tt><font size=3><br>
make[1]: *** [opt] Error 2</font></tt><font size=3> </font><tt><font size=3><br>
make[1]: Leaving directory `/opt/erlang/otp_src_R14B03/lib'</font></tt><font size=3>
</font><tt><font size=3><br>
make: *** [libs] Error 2</font></tt><font size=3> </font><tt><font size=3><br>
..</font></tt><font size=3> </font><font size=3 face="sans-serif"><br>
<br>
Without OpenSSL support, the Erlang package compiles successfully
and I've tested it with the console prompt. <br>
Thanks in advance for your hints how to fix this issue with the crypto
module. <br>
<br>
Regards, <br>
Claude </font><font size=1 color=#a2a2a2 face="Arial"><b><br>
<br>
<br>
Claude Falbriard <br>
Certified IT Specialist L2 - Middleware<br>
AMS Hortolândia / SP - Brazil<br>
phone: +55 19 9837 0789<br>
cell: +55 13 8117 3316<br>
e-mail: </b></font><a href=mailto:claudef@br.ibm.com target=_blank><font size=1 color=blue face="Arial"><b><u>claudef@br.ibm.com</u></b></font></a><font size=3><br>
<br>
_______________________________________________<br>
erlang-questions mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:erlang-questions@erlang.org" target=_blank><font size=3 color=blue><u>erlang-questions@erlang.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="http://erlang.org/mailman/listinfo/erlang-questions" target=_blank><font size=3 color=blue><u>http://erlang.org/mailman/listinfo/erlang-questions</u></font></a><font size=3><br>
<br>
</font>
<br>
<br>