Error while building rtems-libbsd

Hi, I am trying to build rtems-libbsd from the latest source for pc386 bsp, but I am getting errors:

In file included from ../../freebsd/sys/sys/systm.h:46,
                 from ../../freebsd/sys/dev/extres/regulator/regulator_fixed.c:32:
../../freebsd/sys/i386/include/machine/cpufunc.h:52:1: error: static declaration of 'breakpoint' follows non-static declaration
   52 | breakpoint(void)
      | ^~~~~~~~~~
In file included from /home/arnav/source-codes/rtems-libbsd-sandbox/rtems/7/i386-rtems7/pc386/lib/include/bsp/fdt.h:31,
                 from ../../rtemsbsd/include/rtems/bsd/local/opt_platform.h:1,
                 from ../../freebsd/sys/dev/extres/regulator/regulator_fixed.c:30:
/home/arnav/source-codes/rtems-libbsd-sandbox/rtems/7/i386-rtems7/pc386/lib/include/bsp.h:238:6: note: previous declaration of 'breakpoint' with type 'void(void)'
  238 | void breakpoint(void);
      |      ^~~~~~~~~~

Waf: Leaving directory `/home/arnav/source-codes/rtems-libbsd-sandbox/rtems-libbsd/build/i386-rtems7-pc386-default'
Build failed

It looks like the pc386 BSP defines breakpoint() and this is clashing. I think it is simpler for RTEMS to not use names that could clash. I suggest raising an MR on the pc386 BSP to change it’s name to something that would not clash, for example rtems_p386_breakpoint()?

While I have fixed that conflict, I found another one:

[1835/2404] Compiling rtemsbsd/sys/net/ppp_tty.c
../../freebsd/sys/x86/pci/pci_bus.c:609:1: error: conflicting types for 'legacy_pcib_adjust_resource'; have 'int(struct _device *, struct _device *, struct resource *, rman_res_t,  rman_res_t)' {aka 'int(struct _device *, struct _device *, struct resource *, long long unsigned int,  long long unsigned int)'}
  609 | legacy_pcib_adjust_resource(device_t dev, device_t child,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../rtemsbsd/include/x86/legacyvar.h:1,
                 from ../../freebsd/sys/x86/pci/pci_bus.c:50:
../../freebsd/sys/x86/include/machine/legacyvar.h:61:9: note: previous declaration of 'legacy_pcib_adjust_resource' with type 'int(struct _device *, struct _device *, int,  struct resource *, rman_res_t,  rman_res_t)' {aka 'int(struct _device *, struct _device *, int,  struct resource *, long long unsigned int,  long long unsigned int)'}
   61 | int     legacy_pcib_adjust_resource(device_t dev, device_t child, int type,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../../freebsd/sys/x86/pci/pci_bus.c:619:1: error: conflicting types for 'legacy_pcib_release_resource'; have 'int(struct _device *, struct _device *, struct resource *)'
  619 | legacy_pcib_release_resource(device_t dev, device_t child, struct resource *r)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../freebsd/sys/x86/include/machine/legacyvar.h:63:9: note: previous declaration of 'legacy_pcib_release_resource' with type 'int(struct _device *, struct _device *, int,  int,  struct resource *)'
   63 | int     legacy_pcib_release_resource(device_t dev, device_t child, int type,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Waf: Leaving directory `/home/arnav/source-codes/rtems-libbsd-sandbox/rtems-libbsd/build/i386-rtems7-pc386-default'
Build failed

I will try to fix this.