<div dir="ltr"><div><div><div>in erts/<a href="http://configure.in">configure.in</a> there is a section:<br><br>openbsd*)<br>                DED_LD="$CC"<br>                DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"<br>
                DED_LDFLAGS="-shared"<br>        ;;<br><br></div>Spoke with guys on the <a href="mailto:misc@openbsd.org">misc@openbsd.org</a> maillist and they told me to run autoreconf, to regenerate configure from <a href="http://configure.in">configure.in</a> .<br>
<br></div>And indeed that did the trick and now is working fine.<br><br></div><div>There is no need to specify :<br>DED_LDFLAGS="-shared /usr/lib/crtbeginS.o /usr/lib/crtendS.o" <br></div><div>because this generates conflict on symbol '__guard_local'<br>
</div><div><br><br></div><div>Based on discussions in this topic and in <a href="mailto:misc@openbsd.org">misc@openbsd.org</a> maillist here is a small recipe for those who need to compile erlang R14B04 from sources on OpenBSD 5.3 amd64:<br>
<br></div><div>1. cd otp_src_R14B04<br></div><div>2. apply the patches founded in directory /usr/ports/lang/erlang/patches/<br></div><div>3. $ autoreconf<br></div><div>4. compile and install as usual<br><br></div>Thank you for your help,<br>
<br>Bogdan<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 11:50 PM, Stanislav Sedov <span dir="ltr"><<a href="mailto:stas@freebsd.org" target="_blank">stas@freebsd.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On May 23, 2013, at 2:46 AM, Bogdan Andu <<a href="mailto:bog495@gmail.com">bog495@gmail.com</a>> wrote:<br>

<br>
> I have applied the patches:<br>
> cd $OTP_SRC_DIR_R14B04<br>
> patch -p0 <<br>
> /usr/ports/lang/erlang/patches/patch-erts_configure_in<br>
> patch -p0 <<br>
> /usr/ports/lang/erlang/patches/patch-erts_emulator_Makefile_in<br>
> patch -p0 <<br>
> /usr/ports/lang/erlang/patches/patch-erts_lib_src_Makefile_in<br>
> patch -p0 <<br>
> /usr/ports/lang/erlang/patches/patch-lib_tools_c_src_Makefile_in<br>
> patch -p0 <<br>
> /usr/ports/lang/erlang/patches/patch-make_target_mk<br>
><br>
> *all patches succedded,<br>
> and then:<br>
><br>
> ./configure<br>
> sudo gmake install<br>
> the same error<br>
><br>
> I modified<br>
> erts/<a href="http://configure.in" target="_blank">configure.in</a>:<br>
> from:<br>
> openbsd*)<br>
>                 DED_LD="$CC"<br>
>                 DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"<br>
>                 DED_LDFLAGS="-shared"<br>
>         ;;<br>
> in:<br>
> openbsd*)<br>
><br>
> DED_LD="$CC"<br>
><br>
> DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"<br>
><br>
> DED_LDFLAGS="-shared /usr/lib/crtbeginS.o /usr/lib/crtbegin.o"<br>
>         ;;<br>
> because:<br>
> $ nm /usr/lib/crtbegin.o<br>
>          U _GLOBAL_OFFSET_TABLE_<br>
>          U<br>
> _Jv_RegisterClasses<br>
> 00000000 D __dso_handle<br>
> 00000000 T __fini<br>
> 00000000 D<br>
> __guard_local<br>
> 00000000 T __init<br>
> 00000000 W __register_frame_info<br>
>          U<br>
> atexit<br>
> $ nm /usr/lib/crtbeginS.o<br>
>          U _GLOBAL_OFFSET_TABLE_<br>
>          U<br>
> _Jv_RegisterClasses<br>
>          U __cxa_finalize<br>
> 00000000 D __dso_handle<br>
> 00000000<br>
> D __guard_local<br>
> 00000000 T _fini<br>
> 00000000 T _init<br>
><br>
> gmake clean<br>
> ./configure<br>
> sudo gmake install<br>
> the same error<br>
><br>
> Does anyone has an idea of how to solve this<br>
> issue, because I really need R14B04.<br>
><br>
> Please help. I am really out of ideas.<br>
> Maybe I should link against other libraries but I do not know what they are.<br>
> How can I dicover these libraries that I should link erlang against?<br>
><br>
<br>
</div></div>Did you try to link agains libcrtendS.o as well like openbsd guys do for CDE?<br>
Also, you need to make sure that crypto.o linking actually uses these flags you<br>
changes in erts/<a href="http://configure.in" target="_blank">configure.in</a> (also, btw, you need to rebuild configure if you<br>
changes <a href="http://configure.in" target="_blank">configure.in</a>).<br>
<br>
I don't have openbsd installed anywhere, so cannot provide more detailed help,<br>
unfortunately.  I'd recommend you to play with the linking flags for crypto.o:<br>
log the entire build, find where it links crypto.o and use the same command<br>
from the shell.  It will be easier to try different flags combinations that<br>
way.<br>
<br>
--<br>
ST4096-RIPE<br>
<br>
<br>
<br>
</blockquote></div><br></div></div>