<div dir="ltr"><div><div><div><div><div>@Chris , I used 'target_link_libraries' in mk_bin/CMakeLists.txt to link libc.a and libbsd.a to the monkey-bin target<br><br></div>@Joel, removing -O0 doesn't work too. <br><br> I needed libc for three function , initgroups, timegm, and sendfile. <br><br></div>Today I figured that monkey can function without 'initgroups' , if it is given all privileges, which I think will be the case when it runs on rtems (I tested on linux and when run from root, it can work without initgroups) . And I wrote a my_timegm function emulating what timegm does. So these two functions aren't needed anymore. (both were tested and working on linux) <br><br></div>The problem comes with sendfile. <br><br></div>So, just to get things working, I also wrote a make shift version of sendfile using read/write (which is working on linux, but is theoretically slow). <br><br></div>Doing the above removed the requirement of linking libc.a totally. <br><div><div><br>So yeah, we now have a working version of monkey on rtems using libbsd, which is ready to be tested on qemu. Though, this is not the ideal circumstances that we would have hoped for, and I certainly would want monkey to be using the default sendfile from the library. <br><br></div><div>Regards,<br></div><div>Sujay Raj<br></div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 21, 2015 at 5:00 AM, Joel Sherrill <span dir="ltr"><<a href="mailto:joel.sherrill@oarcorp.com" target="_blank">joel.sherrill@oarcorp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I suspect it is because he is compiling at -O0.<br>
<div class=""><div class="h5"><br>
On June 20, 2015 6:13:23 PM CDT, Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br>
>On 20/06/2015 2:34 am, Sujay Raj wrote:<br>
>> Hi ,<br>
>><br>
>> I am working on porting the monkey http server to rtems.<br>
>><br>
>> I am working on the bsp: xilinx_zynq_a9_qemu , target: arm-rtems4.11.<br>
>><br>
>> There are two libraries that I am supposed to link to create my final<br>
>> executable, one is libbsd.a and the other is libc.<br>
>><br>
>> libbsd.a links alright, but whenever I try to link libc to create the<br>
>> final executable , I get an error:<br>
>><br>
>><br>
>/home/raaj/development/rtems/4.11/bsps/arm-rtems4.11/xilinx_zynq_a9_qemu/lib/librtemscpu.a(default-configuration.o):<br>
>> In function `__getreent':<br>
>><br>
>><br>
>/home/raaj/development/rtems/xilinx_zynq_a9_qemu/arm-rtems4.11/c/xilinx_zynq_a9_qemu/cpukit/libmisc/../../cpukit/../../../xilinx_zynq_a9_qemu/lib/include/rtems/confdefs.h:2420:<br>
>> multiple definition of `__getreent'<br>
>><br>
>><br>
>/home/raaj/development/rtems/4.11/tools/lib/gcc/arm-rtems4.11/4.9.2/../../../../arm-rtems4.11/lib/thumb/armv7-a/neon/hard/libc.a(lib_a-getreent.o):<br>
>><br>
>><br>
>/home/raaj/development/rtems/rtems-source-builder/rtems/build/arm-rtems4.11-gcc-4.9.2-newlib-2.2.0.20150423-x86_64-linux-gnu-1/build/arm-rtems4.11/thumb/armv7-a/neon/hard/newlib/libc/reent/../../../../../../../../../gcc-4.9.2/newlib/libc/reent/getreent.c:13:<br>
>> first defined here<br>
>><br>
>><br>
>><br>
>> The CFLAGS I am using to compile are :<br>
>><br>
>> -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9<br>
>-O0<br>
>> -g -qrtems -B/home/raaj/development/rtems/4.11/bsps/arm-rtems4.11/lib<br>
>><br>
>-B/home/raaj/development/rtems/4.11/bsps/arm-rtems4.11/xilinx_zynq_a9_qemu/lib/<br>
>> --specs bsp_specs<br>
>><br>
>><br>
>><br>
>> note: I require libc for three function , initgroups, timegm, and<br>
>sendfile.<br>
>><br>
>> note: I am working on a cmake build system<br>
>><br>
>> If the information given here is insufficient, kindly ask.<br>
>><br>
><br>
>Can you please post the full command line you are using to link with ?<br>
><br>
>Thanks<br>
>Chris<br>
>_______________________________________________<br>
>devel mailing list<br>
><a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
><a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
<br>
</div></div><span class=""><font color="#888888">--joel<br>
</font></span><div class=""><div class="h5">_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div></div></div></div></div></div></div>