On Tue, Jun 25, 2019 at 6:13 AM Joel Sherrill <j...@rtems.org> wrote: > > > > On Fri, Jun 21, 2019 at 9:22 AM Vaibhav Gupta <vaibhavgupt...@gmail.com> > wrote: >> >> >> >> On Fri, Jun 21, 2019, 7:19 PM Joel Sherrill <j...@rtems.org> wrote: >>> >>> >>> >>> On Fri, Jun 21, 2019 at 3:37 AM Vaibhav Gupta <vaibhavgupt...@gmail.com> >>> wrote: >>>> >>>> Hello, >>>> I figured it out. >>>> . >>>> Below is the output given by shell >>>> ...... >>>> ...... >>>> ...... >>>> config: tools/rtems-gcc-7.4.0-newlib-1d35a003f.cfg >>>> warning: rtems-gcc-7.4.0-newlib-1d35a003f.cfg:29: invalid format: '%setup >>>> patch newlib -p' >>>> error: gcc-common-1.cfg:80: %patch already setup source: newlib -p1 >>>> Build FAILED >>>> Build Set: Time 0:06:29.257451 >>>> Build FAILED >>>> . >>>> . >>>> . >>>> . >>>> 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" . >>>> . >>>> . >>>> . >>>> Here is the new git-diff. This got compiled successfully >>> >>> >>> Great! How is the testing going? >> >> I have placed ndbm.h in newlib/libc/include directory. >> . >> ndbm.h requires db.h (named as db_local.h in newlib), which is >> present in newlib/libc/search directory. >> This directory also contains hash.h and hash.c which is >> required by ndbm.c >> . >> So gedare suggested me to place ndbm.c in this libc/search >> directory. >> . >> Here, when I compiled newlib for sparc, it was successful and generates >> function symbols. >> . >> 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. >> >> Error: https://lists.rtems.org/pipermail/devel/2019-June/026271.html > > > > Any header files which are included by ndbm.h directly or indirectly must be > available after it is installed. So putting them in libc/search isn't going > to work. > > So move the .h files as needed to libc/include and try again.
I'm not sure this is the best solution, and it might face resistance in newlib (hard to say without sending a working patch, though). My thought was that the ndbm.h file should be stripped down to just the publicly necessary prototypes as per http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ndbm.h.html I suspect cross-checking the POSIX spec with the ndbm.h from FreeBSD will allow to identify which pieces to keep there, which might be moved to a private header inside search/, or which may be removed entirely. (e.g., I don't think dmb_pagfno() is necessary?) Gedare _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel