Re: undefined reference to `CRYPTO_set_id_callback'

Flo Rance <[email protected]> Thu, 28 Nov 2019 12:09:20 +0100
Newsgroups gmane.network.stunnel.user
Message-ID <CAHogYcUsAXKUTr8P4vvUE6W5_Ywz=ddYp+tvhWhXhAjQf-0_xw@mail.gmail.com>
--===============5913932358713295142==
Content-Type: multipart/alternative; boundary="000000000000504770059866278a"

--000000000000504770059866278a
Content-Type: text/plain; charset="UTF-8"

If I understand correctly, CRYPTO_set_id_callback has been deprecated since
version 1.0

So you don't use the right version of openssl or deprecated code is
compiled in (OPENSSL_NO_DEPRECATED is not set).

#if OPENSSL_VERSION_NUMBER<0x10000000L || !defined(OPENSSL_NO_DEPRECATED)
    CRYPTO_set_id_callback(stunnel_thread_id);
#endif

On Thu, 28 Nov 2019 at 05:13, Somchai Smythe <[email protected]>
wrote:

> Version 5.56 of stunnel, but I got the same error on 5.55.  I didn't
> report it for 5.55 since 5.56 came out and I had hoped that would fix
> it.
>
> The configure line was this:
> CC=gcc \
> CFLAGS='-O3 -m64 -march=x86-64 -mtune=generic -pipe -std=gnu17' \
> ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
> --mandir=/usr/man --disable-libwrap --with-pic
>
> Then I did a make -j4.  Should I avoid parallel builds?
>
>
> On 11/27/19, Flo Rance <[email protected]> wrote:
> > Which version of stunnel ?
> >
> > On Wed, 27 Nov 2019 at 11:56, Somchai Smythe <
> [email protected]>
> > wrote:
> >
> >> How do I fix this?
> >>
> >> gcc -DHAVE_CONFIG_H -I.  -I/usr/kerberos/include -I/usr/include
> >> -DLIBDIR='"/usr/lib/stunnel"' -DCONFDIR='"/etc/stunnel"'   -O3 -m64
> >> -march=x86-64 -mtune=generic -pipe -std=gnu17 -pthread -Wall -Wextra
> >> -Wpedantic -Wformat=2 -Wconversion -Wno-long-long
> >> -Wno-deprecated-declarations -fPIE -fstack-protector
> >> -D_FORTIFY_SOURCE=2 -MT stunnel-sthreads.o -MD -MP -MF
> >> .deps/stunnel-sthreads.Tpo -c -o stunnel-sthreads.o `test -f
> >> 'sthreads.c' || echo './'`sthreads.c
> >> sthreads.c: In function 'thread_id_init':
> >> sthreads.c:116:5: warning: implicit declaration of function
> >> 'CRYPTO_set_id_callback'; did you mean 'CRYPTO_set_locking_callback'?
> >> [-Wimplicit-function-declaration]
> >>   116 |     CRYPTO_set_id_callback(stunnel_thread_id);
> >>       |     ^~~~~~~~~~~~~~~~~~~~~~
> >>       |     CRYPTO_set_locking_callback
> >>
> >> ...
> >>
> >> libtool: link: ( cd ".libs" && rm -f "libstunnel.la" && ln -s
> >> "../libstunnel.la" "libstunnel.la" )
> >>
> >>
> /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
> >> stunnel-sthreads.o: in function `sthreads_init':
> >> sthreads.c:(.text+0xb0): undefined reference to `CRYPTO_set_id_callback'
> >>
> >>
> /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
> >> stunnel-sthreads.o: in function `thread_id_init':
> >> sthreads.c:(.text+0x3a): undefined reference to `CRYPTO_set_id_callback'
> >> collect2: error: ld returned 1 exit status
> >> make[2]: *** [Makefile:550: stunnel] Error 1
> >>
> >> I'm using openssl-1.1.1d if it matters.
> >> _______________________________________________
> >> stunnel-users mailing list
> >> [email protected]
> >> https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
> >>
> >
>

--000000000000504770059866278a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>If I understand correctly, CRYPTO_set_id_callback has=
 been deprecated since version 1.0</div><div><br></div><div>So you don&#39;=
t use the right version of openssl or deprecated code is compiled in (OPENS=
SL_NO_DEPRECATED is not set).<br></div><div><br></div><div>#if OPENSSL_VERS=
ION_NUMBER&lt;0x10000000L || !defined(OPENSSL_NO_DEPRECATED)<br>=C2=A0 =C2=
=A0 CRYPTO_set_id_callback(stunnel_thread_id);<br>#endif</div></div><br><di=
v class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, 28 No=
v 2019 at 05:13, Somchai Smythe &lt;<a href=3D"mailto:buraphalinuxserver@gm=
ail.com">[email protected]</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">Version 5.56 of stunnel, but I got the=
 same error on 5.55.=C2=A0 I didn&#39;t<br>
report it for 5.55 since 5.56 came out and I had hoped that would fix<br>
it.<br>
<br>
The configure line was this:<br>
CC=3Dgcc \<br>
CFLAGS=3D&#39;-O3 -m64 -march=3Dx86-64 -mtune=3Dgeneric -pipe -std=3Dgnu17&=
#39; \<br>
./configure --prefix=3D/usr --sysconfdir=3D/etc --localstatedir=3D/var<br>
--mandir=3D/usr/man --disable-libwrap --with-pic<br>
<br>
Then I did a make -j4.=C2=A0 Should I avoid parallel builds?<br>
<br>
<br>
On 11/27/19, Flo Rance &lt;<a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>&gt; wrote:<br>
&gt; Which version of stunnel ?<br>
&gt;<br>
&gt; On Wed, 27 Nov 2019 at 11:56, Somchai Smythe &lt;<a href=3D"mailto:bur=
[email protected]" target=3D"_blank">[email protected]</=
a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;&gt; How do I fix this?<br>
&gt;&gt;<br>
&gt;&gt; gcc -DHAVE_CONFIG_H -I.=C2=A0 -I/usr/kerberos/include -I/usr/inclu=
de<br>
&gt;&gt; -DLIBDIR=3D&#39;&quot;/usr/lib/stunnel&quot;&#39; -DCONFDIR=3D&#39=
;&quot;/etc/stunnel&quot;&#39;=C2=A0 =C2=A0-O3 -m64<br>
&gt;&gt; -march=3Dx86-64 -mtune=3Dgeneric -pipe -std=3Dgnu17 -pthread -Wall=
 -Wextra<br>
&gt;&gt; -Wpedantic -Wformat=3D2 -Wconversion -Wno-long-long<br>
&gt;&gt; -Wno-deprecated-declarations -fPIE -fstack-protector<br>
&gt;&gt; -D_FORTIFY_SOURCE=3D2 -MT stunnel-sthreads.o -MD -MP -MF<br>
&gt;&gt; .deps/stunnel-sthreads.Tpo -c -o stunnel-sthreads.o `test -f<br>
&gt;&gt; &#39;sthreads.c&#39; || echo &#39;./&#39;`sthreads.c<br>
&gt;&gt; sthreads.c: In function &#39;thread_id_init&#39;:<br>
&gt;&gt; sthreads.c:116:5: warning: implicit declaration of function<br>
&gt;&gt; &#39;CRYPTO_set_id_callback&#39;; did you mean &#39;CRYPTO_set_loc=
king_callback&#39;?<br>
&gt;&gt; [-Wimplicit-function-declaration]<br>
&gt;&gt;=C2=A0 =C2=A0116 |=C2=A0 =C2=A0 =C2=A0CRYPTO_set_id_callback(stunne=
l_thread_id);<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~~=
~~~<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0CRYPTO_set_locking_=
callback<br>
&gt;&gt;<br>
&gt;&gt; ...<br>
&gt;&gt;<br>
&gt;&gt; libtool: link: ( cd &quot;.libs&quot; &amp;&amp; rm -f &quot;<a hr=
ef=3D"http://libstunnel.la" rel=3D"noreferrer" target=3D"_blank">libstunnel=
.la</a>&quot; &amp;&amp; ln -s<br>
&gt;&gt; &quot;../<a href=3D"http://libstunnel.la" rel=3D"noreferrer" targe=
t=3D"_blank">libstunnel.la</a>&quot; &quot;<a href=3D"http://libstunnel.la"=
 rel=3D"noreferrer" target=3D"_blank">libstunnel.la</a>&quot; )<br>
&gt;&gt;<br>
&gt;&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux=
-gnu/bin/ld:<br>
&gt;&gt; stunnel-sthreads.o: in function `sthreads_init&#39;:<br>
&gt;&gt; sthreads.c:(.text+0xb0): undefined reference to `CRYPTO_set_id_cal=
lback&#39;<br>
&gt;&gt;<br>
&gt;&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux=
-gnu/bin/ld:<br>
&gt;&gt; stunnel-sthreads.o: in function `thread_id_init&#39;:<br>
&gt;&gt; sthreads.c:(.text+0x3a): undefined reference to `CRYPTO_set_id_cal=
lback&#39;<br>
&gt;&gt; collect2: error: ld returned 1 exit status<br>
&gt;&gt; make[2]: *** [Makefile:550: stunnel] Error 1<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m using openssl-1.1.1d if it matters.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; stunnel-users mailing list<br>
&gt;&gt; <a href=3D"mailto:[email protected]" target=3D"_blank">stu=
[email protected]</a><br>
&gt;&gt; <a href=3D"https://www.stunnel.org/cgi-bin/mailman/listinfo/stunne=
l-users" rel=3D"noreferrer" target=3D"_blank">https://www.stunnel.org/cgi-b=
in/mailman/listinfo/stunnel-users</a><br>
&gt;&gt;<br>
&gt;<br>
</blockquote></div>

--000000000000504770059866278a--

--===============5913932358713295142==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
stunnel-users mailing list
[email protected]
https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users

--===============5913932358713295142==--