On Tue, Jun 21, 2022 at 11:30:32AM +0200, Stanisław Kardach wrote: > On Tue, Jun 21, 2022 at 12:54 AM David Christensen > <d...@linux.vnet.ibm.com> wrote: > > > > > On Thu, Jun 9, 2022 at 2:17 PM Stanislaw Kardach <k...@semihalf.com> > > > wrote: > > >> > > >> As David noticed in [1] there is an issue with C++ compilation of the > > >> rte_vect.h header in RISC-V. Upon closer inspection, the problem appears > > >> on > > >> all architectures due to the type conversion rules in C++. > > >> More precisely a union type rte_xmm_t requires a conversion constructor > > >> from xmm_t type. > > >> The most obvious fix is to use a structure initializer for such copies > > >> (since rte_xmm_t union contains xmm_t anyway). The generated assembly > > >> at -O2 is exactly the same, so there's no real impact. > > >> > > >> The bigger question is whether accessing bits of the architecture > > >> specific > > >> xmm_t type in an array fashion is always correct? All current > > >> architectures > > >> define rte_xmm_t in the same manner implying that. > > > > > > Copying other arch maintainers. > > > > My read of the Altivec vector layout for LE systems says the existing > > union operator rte_xmm_t is correct, though my C++ experience is > > limited. How can I generate an error with C++ to expose this issue? > > > > Dave > To replicate this issue: > 1. Apply the patch below. In essence it forces the use of scalar lpm > and changes C++ compiler to g++ so that meson properly detects it. > Otherwise C++ checks won't be generated. > 2. Configure build with: meson build-ppc64le --werror --cross-file > config/ppc/ppc64le-power8-linux-gcc-ubuntu -Dcheck_includes=true > 3. Build with: ninja -C build-ppc64le buildtools/chkincs/chkincs-cpp > > Note that the build target only gets generated if C++ compiler is > properly discovered by meson. To be honest I'm not sure why > powerpc64le-linux-gnu-cpp doesn't get properly picked up by meson.
Generally the "cpp" binary is not the c-plus-plus one, but the C preprocessor one. Perhaps the original files are incorrect here, and should all refer to g++. /Bruce