Re: [PATCH v1] Port ndbm
"Richard Earnshaw (lists)" <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
Right, having reviewed the contents of the Arm version of sys/param.h, I agree that there's no point in keeping that version. I've pushed the attached. R. On 26/07/2019 14:12, Richard Earnshaw (lists) wrote: > > > On 26/07/2019 13:58, Joel Sherrill wrote: >> On Fri, Jul 26, 2019 at 5:34 AM Vaibhav Gupta <[email protected]> >> wrote: >> >>> On Fri, Jul 26, 2019, 3:49 PM Richard Earnshaw (lists) < >>> [email protected]> wrote: >>> >>>> >>>> >>>> On 26/07/2019 10:09, Vaibhav Gupta wrote: >>>>> On Fri, Jul 26, 2019, 2:31 PM Richard Earnshaw (lists) < >>>>> [email protected]> wrote: >>>>> >>>>>> >>>>>> >>>>>> On 24/07/2019 17:49, Corinna Vinschen wrote: >>>>>>> On Jul 24 10:47, Joel Sherrill wrote: >>>>>>>> On Wed, Jul 24, 2019 at 2:23 AM Corinna Vinschen < >>> [email protected] >>>>> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> On Jul 10 14:25, Vaibhav Gupta wrote: >>>>>>>>>> --- >>>>>>>>>> newlib/libc/include/ndbm.h | 93 ++++++++++++++ >>>>>>>>>> newlib/libc/search/Makefile.am | 1 + >>>>>>>>>> newlib/libc/search/ndbm.c | 217 >>>>>> +++++++++++++++++++++++++++++++++ >>>>>>>>>> 3 files changed, 311 insertions(+) >>>>>>>>>> create mode 100644 newlib/libc/include/ndbm.h >>>>>>>>>> create mode 100644 newlib/libc/search/ndbm.c >>>>>>>>> >>>>>>>>> Pushed. >>>>>>>>> >>>>>>>> >>>>>>>> Thank you. >>>>>>>> >>>>>>>> It touched a Makefile.am. Doesn't something need to be regenerated? >>>>>>> >>>>>>> Oh, right. Done. >>>>>>> >>>>>>> >>>>>>> Corinna >>>>>>> >>>>>> >>>>>> I'm now seeing a build error on arm-eabi (though interestingly, not >>>>>> AArch64): >>>>>> >>>>>> /work/rearnsha/scratch/nightly/arm/trunk/./gcc/xgcc >>>>>> -B/work/rearnsha/scratch/nightly/arm/trunk/./gcc/ -nostdinc >>>>>> -B/work/rearnsha/scratch/nightly/arm/trunk/arm-eabi/thumb/newlib/ >>>>>> -isystem >>>>>> >>>> >>> /work/rearnsha/scratch/nightly/arm/trunk/arm-eabi/thumb/newlib/targ-include >>> >>>>>> >>>>>> -isystem >>>>>> /work/rearnsha/gnusrc/nightly/gcc-cross/trunk/newlib/libc/include >>>>>> -B/work/rearnsha/scratch/nightly/arm/trunk/arm-eabi/thumb/libgloss/arm >>>>>> >>>>>> >>>> >>> -L/work/rearnsha/scratch/nightly/arm/trunk/arm-eabi/thumb/libgloss/libnosys >>> >>>>>> >>>>>> -L/work/rearnsha/gnusrc/nightly/gcc-cross/trunk/libgloss/arm >>>>>> -B/work/rearnsha/scratch/nightly/arm/trunk/testinstall/arm-eabi/bin/ >>>>>> -B/work/rearnsha/scratch/nightly/arm/trunk/testinstall/arm-eabi/lib/ >>>>>> -isystem >>>>>> /work/rearnsha/scratch/nightly/arm/trunk/testinstall/arm-eabi/include >>>>>> -isystem >>>>>> >>>> /work/rearnsha/scratch/nightly/arm/trunk/testinstall/arm-eabi/sys-include >>>> >>>>>> -L/work/rearnsha/scratch/nightly/arm/trunk/./ld -mthumb >>>>>> -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" >>>>>> -DPACKAGE_VERSION=\"3.1.0\" -DPACKAGE_STRING=\"newlib\ 3.1.0\" >>>>>> -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. >>>>>> -I/work/rearnsha/gnusrc/nightly/gcc-cross/trunk/newlib/libc/search >>>>>> -fno-builtin -D_COMPILING_NEWLIB -DARM_RDI_MONITOR -DHAVE_INIT_FINI >>>>>> -g -O2 -mthumb -c -o lib_a-ndbm.o `test -f 'ndbm.c' || echo >>>>>> >>>> >>> '/work/rearnsha/gnusrc/nightly/gcc-cross/trunk/newlib/libc/search/'`ndbm.c >>> >>>>>> >>> /work/rearnsha/gnusrc/nightly/gcc-cross/trunk/newlib/libc/search/ndbm.c: >>>>>> In function ‘dbm_open’: >>>>>> >>>> >>> /work/rearnsha/gnusrc/nightly/gcc-cross/trunk/newlib/libc/search/ndbm.c:67:12: >>> >>>>>> >>>>>> error: ‘MAXPATHLEN’ undeclared (first use in this function) >>>>>> 67 | char path[MAXPATHLEN]; >>>>>> | ^~~~~~~~~~ >>>>>> >>>>>> Does this file need to include sys/param.h? >>>>>> >>>>> Yah. sys/param.h has the macro definition of MAXPATHLEN >>>>> . >>>>> I guess ndbm.c has included it. >>>> >>>> Well, not included it. >>>> >>> I checked my patch, ndbm.c is including sys/param.h >>> . >>> Or you mean that you have not included it? >>> >> >> I think the issue is that there is an arm specific sys/param.h which does >> not define MAXPATHLEN. >> >> $ find . -name param.h | xargs -e grep MAXPATHLEN >> ./libc/include/sys/param.h:#define MAXPATHLEN PATH_MAX >> ./libc/sys/phoenix/sys/param.h:#define MAXPATHLEN PATHSIZE >> ./libc/sys/rtems/include/sys/param.h: * MAXPATHLEN defines the longest >> permissible path length after expanding >> ./libc/sys/rtems/include/sys/param.h:#define MAXPATHLEN PATH_MAX >> >> $ find . -name param.h | grep sys/param >> ./libc/include/sys/param.h >> ./libc/sys/linux/sys/param.h >> ./libc/sys/phoenix/sys/param.h >> ./libc/sys/rtems/include/sys/param.h >> ./libc/sys/arm/sys/param.h >> >> Based on those commands, I the file ./libc/sys/arm/sys/param.h is the >> culprit. It is very minimal. It looks like a simple out of date copy of >> libc/include/sys/param.h. >> >> My proposed fix is to delete libc/include/sys/arm/param.h. Does that work >> for you Richard? >> > > Or move some or all of it to machine/param.h, which is currently a > placeholder. Need to think about this a bit, but off to a meeting right > now. > > R. > >> --joel >> >> >>> >>> Vaibhav Gupta >>> >>>> >>>> R. >>>>> >>>>> Vaibhav Gupta >>>>> >>>>>> >>>>>> >>>> >>>
0001-arm-remove-libc-sys-arm-sys-param.h.patch
(text/x-patch, 1.7 KB)
From bfcd73e3fbf106e68871da9ceffcb3c4526ee3d2 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw <[email protected]> Date: Fri, 26 Jul 2019 16:08:55 +0100 Subject: [PATCH] [arm] remove libc/sys/arm/sys/param.h MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.17.1" This is a multi-part message in MIME format. --------------2.17.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit The Arm sys/param.h does not define anything differently to the generic sys/param.h, but fails to define some things that that file provides. There does not appear to be any reason to keep this version and we should revert to using the common version. --- newlib/libc/sys/arm/sys/param.h | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 newlib/libc/sys/arm/sys/param.h --------------2.17.1 Content-Type: text/x-patch; name="0001-arm-remove-libc-sys-arm-sys-param.h.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-arm-remove-libc-sys-arm-sys-param.h.patch" diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h deleted file mode 100644 index 5b9464cca..000000000 --- a/newlib/libc/sys/arm/sys/param.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ARM configuration file; HZ is 100 rather than the default 60 */ - -#ifndef _SYS_PARAM_H -# define _SYS_PARAM_H - -#include <machine/param.h> -#include <machine/endian.h> - -#ifndef NBBY -# define NBBY 8 /* number of bits in a byte */ -#endif -#ifndef HZ -# define HZ (60) -#endif -#ifndef NOFILE -# define NOFILE (60) -#endif -#ifndef PATHSIZE -# define PATHSIZE (1024) -#endif - -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - -#endif --------------2.17.1--