#4706 closed defect (fixed)

Installed header break C++

Reported by: Chris Johns Owned by: Chris Johns
Priority: normal Milestone: 6.1
Component: rtems Version: 6
Severity: normal Keywords: qualification
Cc: Blocked By:
Blocking:

Description

Some headers generate C++ errors and so cannot be included.

Change History (8)

comment:1 Changed on 08/19/22 at 04:54:06 by Chris Johns

To test create a C++ source file with all the installed headers and compile. The exact source to build needs some defines and some include ti show the real issues:

#define _DEFAULT_SOURCE 1
#define CONFIGURE_SCHEDULER_CBS 1
#define BSP_GPIO_PIN_COUNT 128
#define BSP_GPIO_PINS_PER_BANK 8
#include <sys/time.h>
#include <bsp.h>
#include <libfdt_env.h>

Only the beagle defines the GPIO pins.

comment:2 Changed on 08/19/22 at 06:31:52 by Chris Johns

Adding RTEMS_SMP generates the following:

In file included from ../cxx-headers.cc:28:
/opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/bsp/irq-generic.h: In function 'void bsp_interrupt_entry_store_release(rtems_interrupt_entry**, rtems_interrupt_entry*)':
/opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/bsp/irq-generic.h:405:71: error: invalid conversion from 'rtems_interrupt_entry*' to 'std::atomic<long unsigned int>::__integral_type' {aka 'long unsigned int'} [-fpermissive]
  405 |   _Atomic_Store_uintptr(
      |                                                                       ^    
      |                                                                       |
      |                                                                       rtems_interrupt_entry*
In file included from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/score/cpustdatomic.h:63,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/score/cpuatomic.h:40,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/score/atomic.h:40,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/score/smplockticket.h:44,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/score/smplock.h:67,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/score/isrlock.h:41,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems/rtems/intr.h:70,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/rtems.h:69,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/bsp/default-initial-extension.h:40,
                 from /opt/work/rtems/6-bsps/aarch64-rtems6/xilinx_versal_lp64_vck190/lib/include/bsp.h:49,
                 from ../cxx-headers.cc:12:
/opt/work/rtems/6/lib/gcc/aarch64-rtems6/12.1.1/include/c++/atomic:904:40: note:   initializing argument 1 of 'constexpr std::atomic<long unsigned int>::atomic(__integral_type)'
  904 |       constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
      |                        ~~~~~~~~~~~~~~~~^~~

It looks like the <Atomic_Uintptr*> cast is not working.

I will ignore SMP builds but I think this should be fixed for RTEMS 6.

comment:3 Changed on 08/21/22 at 23:30:18 by Chris Johns <chrisj@…>

In f5233fe/rtems:

cpukit/include: Fixes for C++

Updates #4706

comment:4 Changed on 08/21/22 at 23:30:20 by Chris Johns <chrisj@…>

In a329579/rtems:

cpukit/include: Fix including in C++

UPdates #4706

comment:5 Changed on 08/29/22 at 07:05:55 by Sebastian Huber <sebastian.huber@…>

In 23b42f7/rtems:

score: Fix format

Update #4706.

comment:6 Changed on 08/29/22 at 07:10:17 by Sebastian Huber <sebastian.huber@…>

In 9b16f24/rtems:

score: Fix format

Update #4706.

comment:7 Changed on 11/29/22 at 22:53:46 by Chris Johns

Resolution: fixed
Status: assignedclosed

comment:8 Changed on 10/31/23 at 11:51:59 by Sebastian Huber

Keywords: qualification added
Note: See TracTickets for help on using tickets.