<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019, 7:19 PM Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019 at 3:37 AM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank" rel="noreferrer">vaibhavgupta40@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div>I figured it out.</div><div>.</div><div>Below is the output given by shell<br></div><div><span style="font-family:"courier new",monospace">......</span></div><div><span style="font-family:"courier new",monospace">......</span></div><div><span style="font-family:"courier new",monospace">......<br>config: tools/rtems-gcc-7.4.0-newlib-1d35a003f.cfg<br>warning: rtems-gcc-7.4.0-newlib-1d35a003f.cfg:29: invalid format: '%setup patch newlib -p'<br><b>error: gcc-common-1.cfg:80: %patch already setup source: newlib -p1</b><br>Build FAILED<br>Build Set: Time 0:06:29.257451<br>Build FAILED</span></div><div><span style="font-family:"courier new",monospace">.</span></div><div><span style="font-family:"courier new",monospace">.</span></div><div><span style="font-family:"courier new",monospace">.<br></span></div><div><span style="font-family:"courier new",monospace">.</span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">I realized, the name of group of my patch and the source of newlib-source was same in        rtems-gcc-7.4.0-newlib-1d35a003f.cfg. Also, I had put "%patch setup" statement before "%patch add" .<br></font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">.</font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">.</font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">.</font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif">Here is the new git-diff. This got compiled successfully</font></span></div></div></blockquote><div><br></div><div>Great! How is the testing going?</div></div></div></blockquote></div></div><div dir="auto">I have placed ndbm.h in     newlib/libc/include    directory.</div><div dir="auto">.</div><div dir="auto">ndbm.h     requires    db.h (named as db_local.h in newlib), which is present in    newlib/libc/search   directory. </div><div dir="auto">This directory also contains     hash.h     and     hash.c  which is required by    ndbm.c</div><div dir="auto">.</div><div dir="auto">So gedare suggested me to place    ndbm.c     in this   libc/search     directory.</div><div dir="auto">.</div><div dir="auto">Here, when I compiled newlib for sparc, it was successful and generates function symbols.</div><div dir="auto">.</div><div dir="auto">But when I added this patch to RSB, and made a sample program calling ndbm functions, just to check if it is successful port or not, its showing me compile time error.</div><div dir="auto"><br></div><div dir="auto">Error: <a href="https://lists.rtems.org/pipermail/devel/2019-June/026271.html">https://lists.rtems.org/pipermail/devel/2019-June/026271.html</a><br></div><div dir="auto">.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>For the RSB until the patch is merged upstream in newlib, it is preferred to get patches from tickets or mailing list posts. Since there is a ticket (2972) for adding ndbm, adding your patch to that and letting the RSB fetch it from there is the right approach.<br></div><div><br></div><div>Also there is a ticket #2833 which lists POSIX .h files missing in newlib. It should be updated when all is merged.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif"><span style="font-family:"courier new",monospace">diff --git a/rtems/config/tools/rtems-gcc-7.4.0-newlib-1d35a003f.cfg b/rtems/config/tools/rtems-gcc-7.4.0-newlib-1d35a003f.cfg<br>index b28a4b1..5c5c346 100644<br>--- a/rtems/config/tools/rtems-gcc-7.4.0-newlib-1d35a003f.cfg<br>+++ b/rtems/config/tools/rtems-gcc-7.4.0-newlib-1d35a003f.cfg<br>@@ -23,6 +23,11 @@<br> %source set newlib --rsb-file=newlib-%{newlib_version}.tar.gz <a href="https://codeload.github.com/RTEMS/sourceware-mirror-newlib-cygwin/tar.gz/%%7Bnewlib_version%7D" target="_blank" rel="noreferrer">https://codeload.github.com/RTEMS/sourceware-mirror-newlib-cygwin/tar.gz/%{newlib_version}</a><br> %hash sha512 newlib-%{newlib_version}.tar.gz eb5943b207eca05fde4497c29491bbd3d07624e4becb410640ae8e177bd9212ca06cf726ee3882d6db5758cd03daf1462715e4b9b404abcc8f7cee5f811fd48b<br> <br>+%patch add newlib_ndbm file://0001-Port-ndbm.patch<br>+%hash sha512 0001-Port-ndbm.patch 0e05d97d0a6f8a436a233fe4fb3cbda7c0cfeab11cfda1c155d8aa5b80289f386896b0e8c28e5858e1d7409fd22c8d1cbaaccb181bc376845fe6d50b16359db6<br>+<br>+%patch setup newlib_ndbm -p1<br>+<br> %define isl_version 0.16.1<br> %hash sha512 isl-%{isl_version}.tar.bz2 c188667a84dc5bdddb4ab7c35f89c91bf15a8171f4fcaf41301cf285fb7328846d9a367c096012fec4cc69d244f0bc9e95d84c09ec097394cd4093076f2a041b<br> <br>@@ -40,3 +45,4 @@<br> %define with_iconv   1<br> <br> %include %{_configdir}/gcc-7.2-1.cfg</span><br></font></span></div><div><span style="font-family:"courier new",monospace"><font face="arial,sans-serif"><br></font></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019 at 4:25 AM Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank" rel="noreferrer">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 21/6/19 4:43 am, Gedare Bloom wrote:<br>
> On Thu, Jun 20, 2019 at 11:32 AM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank" rel="noreferrer">vaibhavgupta40@gmail.com</a>> wrote:<br>
>> + /bin/cat /home/varodek/development/rtems/rsb/rtems/patches/0001-Port-ndbm.patch<br>
>> + /usr/bin/patch -p3<br>
> <br>
> This is the problem, the -p3 is wrong. I don't know where this is<br>
> coming from though.<br>
<br>
This must be from a `%patch` statement. The RSB has no preset patch options and<br>
there is no `-p3` in my repo.<br>
<br>
I suggest you run with --trace and then look at the macro maps to see where is<br>
it is coming from.<br>
<br>
Chris<br>
</blockquote></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div>
</blockquote></div></div></div>