Re: compiling error of using MUSL libm.a in RTAI 5.1

Guo Yunfei <[email protected]> Sat, 10 Feb 2018 22:37:53 +0800
Newsgroups gmane.linux.real-time.rtai
Message-ID <CAN_Un=XFb8mxhLWbDNrSGhqSF0iVa5_4qqvn9RswemewiaCv5w@mail.gmail.com>
--===============5569042155728354267==
Content-Type: multipart/alternative; boundary="001a1143f9d0126c810564dc9755"

--001a1143f9d0126c810564dc9755
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Dear Paolo:

Just now I change my system to same with yours:
64bit-Ubuntu 16.04 with kernel-4.1.18 with RTAI 5.1. with MUSL 1.1.18

for the libm.a building, I input the command like below:
//------------------------------------
    cd musl-1.1.18
    cp Makefile Makefile.saved
    sed 's/-fPIC//' <Makefile >Makefile.tmp
    mv Makefile.tmp Makefile
    ./configure --disable-shared CFLAGS=3D"-mcmodel=3Dkernel -fno-common"
    make -j4
    ar -d lib/libc.a fwrite.o write.o fputs.o sprintf.o strcpy.o strlen.o
memcpy.o memset.o
    cp lib/libc.a lib/libm.a
//---------------------------------------------
Is above commands right?

When I make the RTAI 5.1, the warning message still coming, like below:

//------------------------------------------------------------
Making all in math
make[3]: Entering directory '/media/guoissac/13GDATA/rtai-5.1/base/math'
make[4]: Entering directory '/media/guoissac/13GDATA/linux-4.1.18'
  CC [M]  /media/guoissac/13GDATA/rtai-5.1/base/math/libm.o
  LD [M]  /media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "remquo" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "erfcf" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "ynf" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "erfc" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "frexp" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "logbf" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "y1" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "expm1f" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "__signbitd"
[/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!
WARNING: "trunc" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
....
....
WARNING: "exp2f" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "lroundf"
[/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!
WARNING: "asinh" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "cosh" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "sqrt" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "log" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "fabs" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "fmodf" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
WARNING: "expm1" [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko]
undefined!
  CC      /media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.mod.o
  LD [M]  /media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko
make[4]: Leaving directory '/media/guoissac/13GDATA/linux-4.1.18'
mv rtai_math.ko rtai_math.ko.tmp
ld -r -static -o rtai_math.ko rtai_math.ko.tmp
/usr/lib/i386-linux-gnu/libm.a
rm -f rtai_math.ko.tmp

//----------------------------------------------


So, there are some difference of my RTAI-5.1 or kernel configuration with
yours. I guess.
Or my build libm.a process is something wrong with it?
Could you send me a copy of your RTAI 5.1 configuration file?

Thanks.


Guo Yunfei



On Sat, Feb 10, 2018 at 5:11 PM, Paolo Mantegazza <
[email protected]> wrote:

> For a further check I've just verified MUSL latest release,
> musl-1.1.18.tar.gz (sig).
> Made it following the list of commands listed in RTAI README.KLIBM.
> I have no problem, both in compiling and running the math test of showroo=
m.
> My environment: 64 bits,  gcc (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0
> 20160609,
>
> BTW, I'm happy to see users that like RTAI in kernel space, for better
> performances. Nonetheless I'd like to be sure that you are not one of tho=
se
> thinking tha RTAI can work hard real time in kernel space space only.  If
> that is your case, you must know that RTAI has been the first hard real
> time LINUX in user space, back to 17 years ago. User space may be easier
> for newcomers.
>
> Paolo
>
>
> ________________________________________
> From: Rtai [[email protected]] on behalf of Guo Yunfei [
> [email protected]]
> Sent: Saturday, February 10, 2018 8:29 AM
> To: [email protected]
> Subject: [Rtai] compiling error of using MUSL libm.a in RTAI 5.1
>
> Dear Paolo:
>
> I had config my system like below:
> Debian 8.9.0 --- kernel-3.16.7---RTAI-5.1
>
> I get the MUSL by command: git clone git://git.musl-libc.org/musl<h
> ttp://git.musl-libc.org/musl>
> I build the MUSL follow the steps in  README.KLIBM file which in
> rtai-5.1/base/math
> the libm.a was build successful.
>
> after I set the libm.a  path , and make the RTAI 5.1
>
> the error message pop out as below:
> //----------------------------------------------------------
> Making all in math
> make[3]: Entering directory '/media/guoissac/13GDATA/rtai-5.1/base/math'
> make[4]: Entering directory '/media/guoissac/13GDATA/linux-3.16.7'
>   CC [M]  /media/guoissac/13GDATA/rtai-5.1/base/math/libm.o
> /media/guoissac/13GDATA/rtai-5.1/base/math/libm.c: In function =E2=80=98c=
pow=E2=80=99:
> /media/guoissac/13GDATA/rtai-5.1/base/math/libm.c:169:2: error: implicit
> declaration of function =E2=80=98cexp=E2=80=99 [-Werror=3Dimplicit-functi=
on-declaration]
>   return cexp(y*clog(x));
>   ^
> /media/guoissac/13GDATA/rtai-5.1/base/math/libm.c:169:2: error: implicit
> declaration of function =E2=80=98clog=E2=80=99 [-Werror=3Dimplicit-functi=
on-declaration]
> cc1: some warnings being treated as errors
> scripts/Makefile.build:257: recipe for target
> '/media/guoissac/13GDATA/rtai-5.1/base/math/libm.o' failed
> make[5]: *** [/media/guoissac/13GDATA/rtai-5.1/base/math/libm.o] Error 1
> Makefile:1333: recipe for target '_module_/media/guoissac/13GDATA/rtai-5.=
1/base/math'
> failed
> make[4]: *** [_module_/media/guoissac/13GDATA/rtai-5.1/base/math] Error 2
> make[4]: Leaving directory '/media/guoissac/13GDATA/linux-3.16.7'
> GNUmakefile:652: recipe for target 'rtai_math.ko' failed
> make[3]: *** [rtai_math.ko] Error 2
> make[3]: Leaving directory '/media/guoissac/13GDATA/rtai-5.1/base/math'
> GNUmakefile:423: recipe for target 'all-recursive' failed
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory '/media/guoissac/13GDATA/rtai-5.1/base'
> GNUmakefile:486: recipe for target 'all-recursive' failed
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory '/media/guoissac/13GDATA/rtai-5.1'
> GNUmakefile:417: recipe for target 'all' failed
> make: *** [all] Error 2
>
> //----------------------------------------------------------------
>
> above message pop out either I using a 32bit Debian or 64bit Debian.
> did that MUSL version is something wrong with it?
>
> any suggestion for this?
>
>
> Guo Yunfei
>
>
>
>

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

<div dir=3D"ltr">Dear Paolo:<div><br></div><div>Just now I change my system=
 to same with yours:</div><div>64bit-Ubuntu 16.04 with kernel-4.1.18 with R=
TAI 5.1. with MUSL 1.1.18</div><div><br></div><div>for the libm.a building,=
 I input the command like below:</div><div>//------------------------------=
------</div><div><div>=C2=A0 =C2=A0 cd musl-1.1.18</div><div>=C2=A0 =C2=A0 =
cp Makefile Makefile.saved</div><div>=C2=A0 =C2=A0 sed &#39;s/-fPIC//&#39; =
&lt;Makefile &gt;Makefile.tmp</div><div>=C2=A0 =C2=A0 mv Makefile.tmp Makef=
ile</div><div>=C2=A0 =C2=A0 ./configure --disable-shared CFLAGS=3D&quot;-mc=
model=3Dkernel -fno-common&quot;</div><div>=C2=A0 =C2=A0 make -j4</div><div=
>=C2=A0 =C2=A0 ar -d lib/libc.a fwrite.o write.o fputs.o sprintf.o strcpy.o=
 strlen.o memcpy.o memset.o</div><div>=C2=A0 =C2=A0 cp lib/libc.a lib/libm.=
a</div></div><div>//---------------------------------------------</div><div=
>Is above commands right?</div><div><br></div><div>When I make the RTAI 5.1=
, the warning message still coming, like below:</div><div><br></div><div>//=
------------------------------------------------------------</div><div><div=
>Making all in math</div><div>make[3]: Entering directory &#39;/media/guois=
sac/13GDATA/rtai-5.1/base/math&#39;</div><div>make[4]: Entering directory &=
#39;/media/guoissac/13GDATA/linux-4.1.18&#39;</div><div>=C2=A0 CC [M] =C2=
=A0/media/guoissac/13GDATA/rtai-5.1/base/math/libm.o</div><div>=C2=A0 LD [M=
] =C2=A0/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.o</div><div>=
=C2=A0 Building modules, stage 2.</div><div>=C2=A0 MODPOST 1 modules</div><=
div>WARNING: &quot;remquo&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math=
/rtai_math.ko] undefined!</div><div>WARNING: &quot;erfcf&quot; [/media/guoi=
ssac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING:=
 &quot;ynf&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] =
undefined!</div><div>WARNING: &quot;erfc&quot; [/media/guoissac/13GDATA/rta=
i-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING: &quot;frexp&quo=
t; [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</di=
v><div>WARNING: &quot;logbf&quot; [/media/guoissac/13GDATA/rtai-5.1/base/ma=
th/rtai_math.ko] undefined!</div><div>WARNING: &quot;y1&quot; [/media/guois=
sac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING: =
&quot;expm1f&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko=
] undefined!</div><div>WARNING: &quot;__signbitd&quot; [/media/guoissac/13G=
DATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING: &quot;t=
runc&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefi=
ned!</div><div>....</div><div>....</div><div>WARNING: &quot;exp2f&quot; [/m=
edia/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><div=
>WARNING: &quot;lroundf&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/r=
tai_math.ko] undefined!</div><div>WARNING: &quot;asinh&quot; [/media/guoiss=
ac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING: &=
quot;cosh&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] u=
ndefined!</div><div>WARNING: &quot;sqrt&quot; [/media/guoissac/13GDATA/rtai=
-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING: &quot;log&quot; =
[/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><=
div>WARNING: &quot;fabs&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/r=
tai_math.ko] undefined!</div><div>WARNING: &quot;fmodf&quot; [/media/guoiss=
ac/13GDATA/rtai-5.1/base/math/rtai_math.ko] undefined!</div><div>WARNING: &=
quot;expm1&quot; [/media/guoissac/13GDATA/rtai-5.1/base/math/rtai_math.ko] =
undefined!</div><div>=C2=A0 CC =C2=A0 =C2=A0 =C2=A0/media/guoissac/13GDATA/=
rtai-5.1/base/math/rtai_math.mod.o</div><div>=C2=A0 LD [M] =C2=A0/media/guo=
issac/13GDATA/rtai-5.1/base/math/rtai_math.ko</div><div>make[4]: Leaving di=
rectory &#39;/media/guoissac/13GDATA/linux-4.1.18&#39;</div><div>mv rtai_ma=
th.ko rtai_math.ko.tmp</div><div>ld -r -static -o rtai_math.ko rtai_math.ko=
.tmp /usr/lib/i386-linux-gnu/libm.a</div><div>rm -f rtai_math.ko.tmp</div><=
/div><div><br></div><div>//----------------------------------------------</=
div><div><br></div><div><br></div><div>So, there are some difference of my =
RTAI-5.1 or kernel configuration with yours. I guess.</div><div>Or my build=
 libm.a process is something wrong with it?</div><div>Could you send me a c=
opy of your RTAI 5.1 configuration file? =C2=A0<br></div><div><br></div><di=
v>Thanks.</div><div><br></div><div><br></div><div>Guo Yunfei</div><div><br>=
</div><div><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gma=
il_quote">On Sat, Feb 10, 2018 at 5:11 PM, Paolo Mantegazza <span dir=3D"lt=
r">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">paol=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">For a further check I&#39;ve just verified MUSL latest release, musl-1.=
1.18.tar.gz (sig).<br>
Made it following the list of commands listed in RTAI README.KLIBM.<br>
I have no problem, both in compiling and running the math test of showroom.=
<br>
My environment: 64 bits,=C2=A0 gcc (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20=
160609,<br>
<br>
BTW, I&#39;m happy to see users that like RTAI in kernel space, for better =
performances. Nonetheless I&#39;d like to be sure that you are not one of t=
hose thinking tha RTAI can work hard real time in kernel space space only.=
=C2=A0 If that is your case, you must know that RTAI has been the first har=
d real time LINUX in user space, back to 17 years ago. User space may be ea=
sier for newcomers.<br>
<span class=3D""><br>
Paolo<br>
<br>
<br>
______________________________<wbr>__________<br>
From: Rtai [<a href=3D"mailto:[email protected]">[email protected]<=
/a>] on behalf of Guo Yunfei [<a href=3D"mailto:[email protected]">gu=
[email protected]</a>]<br>
Sent: Saturday, February 10, 2018 8:29 AM<br>
To: <a href=3D"mailto:[email protected]">[email protected]</a><br>
Subject: [Rtai] compiling error of using MUSL libm.a in RTAI 5.1<br>
<br>
</span><span class=3D"">Dear Paolo:<br>
<br>
I had config my system like below:<br>
Debian 8.9.0 --- kernel-3.16.7---RTAI-5.1<br>
<br>
</span>I get the MUSL by command: git clone git://<a href=3D"http://git.mus=
l-libc.org/musl" rel=3D"noreferrer" target=3D"_blank">git.musl-libc.org/mus=
l</a>&lt;<a href=3D"http://git.musl-libc.org/musl" rel=3D"noreferrer" targe=
t=3D"_blank">h<wbr>ttp://git.musl-libc.org/musl</a>&gt;<br>
<div class=3D"HOEnZb"><div class=3D"h5">I build the MUSL follow the steps i=
n=C2=A0 README.KLIBM file which in rtai-5.1/base/math<br>
the libm.a was build successful.<br>
<br>
after I set the libm.a=C2=A0 path , and make the RTAI 5.1<br>
<br>
the error message pop out as below:<br>
//----------------------------<wbr>------------------------------<br>
Making all in math<br>
make[3]: Entering directory &#39;/media/guoissac/13GDATA/rtai-<wbr>5.1/base=
/math&#39;<br>
make[4]: Entering directory &#39;/media/guoissac/13GDATA/<wbr>linux-3.16.7&=
#39;<br>
=C2=A0 CC [M]=C2=A0 /media/guoissac/13GDATA/rtai-<wbr>5.1/base/math/libm.o<=
br>
/media/guoissac/13GDATA/rtai-<wbr>5.1/base/math/libm.c: In function =E2=80=
=98cpow=E2=80=99:<br>
/media/guoissac/13GDATA/rtai-<wbr>5.1/base/math/libm.c:169:2: error: implic=
it declaration of function =E2=80=98cexp=E2=80=99 [-Werror=3Dimplicit-funct=
ion-<wbr>declaration]<br>
=C2=A0 return cexp(y*clog(x));<br>
=C2=A0 ^<br>
/media/guoissac/13GDATA/rtai-<wbr>5.1/base/math/libm.c:169:2: error: implic=
it declaration of function =E2=80=98clog=E2=80=99 [-Werror=3Dimplicit-funct=
ion-<wbr>declaration]<br>
cc1: some warnings being treated as errors<br>
scripts/Makefile.build:257: recipe for target &#39;/media/guoissac/13GDATA/=
rtai-<wbr>5.1/base/math/libm.o&#39; failed<br>
make[5]: *** [/media/guoissac/13GDATA/rtai-<wbr>5.1/base/math/libm.o] Error=
 1<br>
Makefile:1333: recipe for target &#39;_module_/media/guoissac/<wbr>13GDATA/=
rtai-5.1/base/math&#39; failed<br>
make[4]: *** [_module_/media/guoissac/<wbr>13GDATA/rtai-5.1/base/math] Erro=
r 2<br>
make[4]: Leaving directory &#39;/media/guoissac/13GDATA/<wbr>linux-3.16.7&#=
39;<br>
GNUmakefile:652: recipe for target &#39;rtai_math.ko&#39; failed<br>
make[3]: *** [rtai_math.ko] Error 2<br>
make[3]: Leaving directory &#39;/media/guoissac/13GDATA/rtai-<wbr>5.1/base/=
math&#39;<br>
GNUmakefile:423: recipe for target &#39;all-recursive&#39; failed<br>
make[2]: *** [all-recursive] Error 1<br>
make[2]: Leaving directory &#39;/media/guoissac/13GDATA/rtai-<wbr>5.1/base&=
#39;<br>
GNUmakefile:486: recipe for target &#39;all-recursive&#39; failed<br>
make[1]: *** [all-recursive] Error 1<br>
make[1]: Leaving directory &#39;/media/guoissac/13GDATA/rtai-<wbr>5.1&#39;<=
br>
GNUmakefile:417: recipe for target &#39;all&#39; failed<br>
make: *** [all] Error 2<br>
<br>
//----------------------------<wbr>------------------------------<wbr>-----=
-<br>
<br>
above message pop out either I using a 32bit Debian or 64bit Debian.<br>
did that MUSL version is something wrong with it?<br>
<br>
any suggestion for this?<br>
<br>
<br>
Guo Yunfei<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>

--001a1143f9d0126c810564dc9755--

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

_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
--===============5569042155728354267==--