#4021 closed defect (fixed)

PowerPC for libbsd does not build

Reported by: Chris Johns Owned by: Chris Johns <chrisj@…>
Priority: high Milestone: 5.1
Component: network/libbsd Version: 5
Severity: blocker Keywords:
Cc: Blocked By:
Blocking:

Description (last modified by Chris Johns)

Building a kernel and libbsd for the --with-rtems-bsp=mvme3100 libbsd fails with:

In file included from /build/rtems/releases/build/5.1.0-rc1/install/powerpc-rtems5/mvme3100/lib/include/bsp.h:27:0,
                 from ../../rtemsbsd/include/rtems/bsd/local/opt_usb.h:2,
                 from ../../freebsd/sys/dev/usb/usb.h:46,
                 from ../../freebsd/sys/dev/usb/usb_busdma.c:53:
/build/rtems/releases/build/5.1.0-rc1/install/powerpc-rtems5/mvme3100/lib/include/libcpu/io.h:53:20: error: redefinition of 'eieio'
 static inline void eieio(void)
                    ^~~~~
In file included from ../../freebsd/sys/sys/systm.h:45:0,
                 from ../../freebsd/sys/dev/usb/usb_busdma.c:39:
../../freebsd/sys/powerpc/include/machine/cpufunc.h:168:1: note: previous definition of 'eieio' was here
 eieio(void)
 ^~~~~

In file included from ../../freebsd/sys/sys/systm.h:45:0,
                 from ../../rtemsbsd/sys/arm/at91/at91_mci.c:38:
../../freebsd/sys/powerpc/include/machine/cpufunc.h:168:1: error: redefinition of 'eieio'
 eieio(void)
 ^~~~~
In file included from /build/rtems/releases/build/5.1.0-rc1/install/powerpc-rtems5/mvme3100/lib/include/bsp.h:27:0,
                 from /build/rtems/releases/build/5.1.0-rc1/install/powerpc-rtems5/mvme3100/lib/include/bsp/fdt.h:18,
                 from ../../rtemsbsd/include/rtems/bsd/local/opt_platform.h:1,
                 from ../../rtemsbsd/sys/arm/at91/at91_mci.c:32:
/build/rtems/releases/build/5.1.0-rc1/install/powerpc-rtems5/mvme3100/lib/include/libcpu/io.h:53:20: note: previous definition of 'eieio' was here
 static inline void eieio(void)
                    ^~~~~

This is using 5.1.0-rc1.

Change History (5)

comment:1 Changed on 06/30/20 at 07:49:56 by Chris Johns

Description: modified (diff)

comment:2 Changed on 07/25/20 at 05:50:55 by Chris Johns

There ae a number of version of eieio in RTEMS. The implementation in io.h is:

__asm__ __volatile__ ("eieio");

and the FreeBSD is:

 __asm __volatile ("eieio" : : : "memory");

I am not sure about the specifics of needing the memory constrain but I wonder if it is something we should do? I do not know the PowerPC well enough to know the effect of having memory as a constraint.

comment:3 Changed on 07/27/20 at 04:42:09 by Sebastian Huber

The "memory" clobber is important. Without it this instruction makes little sense.

I think the real issue is the <bsp.h> includes <libcpu/io.h>.

We also have an ppc_enforce_in_order_execution_of_io() in <libcpu/powerpc-utility.h>.

comment:4 in reply to:  3 Changed on 07/28/20 at 05:37:18 by Chris Johns

Replying to Sebastian Huber:

The "memory" clobber is important. Without it this instruction makes little sense.

OK. I will add it.

I think the real issue is the <bsp.h> includes <libcpu/io.h>.

We also have an ppc_enforce_in_order_execution_of_io() in <libcpu/powerpc-utility.h>.

There are a number of eieio instructions in various pieces of code. I have renamed the function in io.h and LibBSD builds. Given this is for a release I am looking to only make small changes.

comment:5 Changed on 08/12/20 at 03:03:06 by Chris Johns <chrisj@…>

Owner: set to Chris Johns <chrisj@…>
Resolution: fixed
Status: newclosed

In 5284e812/rtems:

powerpc/io: The eieio() function clashes with FreeBSD. Change.

Closes #4021

Note: See TracTickets for help on using tickets.