Joel Sherrill created an issue: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5617

Assignee: Matteo Concas

## Summary


The noel BSP family has multiple failures as reported in this [`build list 
post`](https://lists.rtems.org/pipermail/build/2026-June/074641.html). The 
nominal cause is that the riscv and noel BSPs both have copies of 
_<bsp/riscv.h>_ and they differ. The noel BSP version of this file is missing 
at least the prototype of _riscv_send_ipi()_. 

```
  38 smp-debug riscv/noel64imafdc build:
      configure: /home/joel/rtems-work/rtems/waf configure\
      --prefix=/home/joel/rtems-work/tools/7/bsps --top=/home/joel/rtems-\
      work/rtems --rtems-config=config-riscv-noel64imafdc-smp-debug.ini
     error: bsps/riscv/riscv/start/bspsmp.c:93:3: error: nested extern
            declaration of 'riscv_send_ipi' [-Werror=nested-externs]
     error: bsps/riscv/riscv/irq/irq.c:483:3: error: nested extern
            declaration of 'riscv_send_ipi' [-Werror=nested-externs]
```

I replicated the build error reported by _rtems-bsp-builder_ using this 
[config-riscv-noel64imafdc-smp-debug.ini](/uploads/6a37d868623376f3690dbc6543b97b72/config-riscv-noel64imafdc-smp-debug.ini).
 

The bigger underlying issue is that the noel BSP violates the BSP rule that a 
BSP should not reference source code in another BSP in its build. The best 
approach is to move the code to a shared location and let it support both. The 
alternative approach is to copy it into the second BSP and carry on from there. 
The alternative approach leads to more technical debt as duplication is not 
desirable.

Looking at the spec files for the noel BSP shows these files from the riscv BSP 
are directly referenced.

```
$ grep -r riscv/riscv spec/build/bsps/riscv/noel/
spec/build/bsps/riscv/noel/obj.yml:- bsps/riscv/riscv/clock/clockdrv.c
spec/build/bsps/riscv/noel/obj.yml:- bsps/riscv/riscv/irq/irq.c
spec/build/bsps/riscv/noel/obj.yml:- bsps/riscv/riscv/start/bspstart.c
spec/build/bsps/riscv/noel/objsmp.yml:- bsps/riscv/riscv/start/bspsmp.c
```

Tagging @gedare and @opticron as they may have further insight and input.

## Steps to reproduce

Configure with the configuration file attached earlier and build.

<!-- Pre-set options
- milestone
-->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5617
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to