Freescale / libimxdmabuffer

Library for allocating and managing physically contiguous memory ("DMA memory" or "DMA buffers") on i.MX devices
GNU Lesser General Public License v2.1
19 stars 12 forks source link

Getting "error: ‘imx_dwl_buffer’ undeclared" when building v1.1.2 #7

Closed Talkless closed 1 year ago

Talkless commented 1 year ago

I have some toolchain named fsl-imx-wayland-glibc-x86_64-core-image-base-cortexa53-crypto-imx8mmevk-toolchain-5.10-hardknott. Sysroot has old GStreamer 1.18 , so I'm building gstreamer-imx for GStreamer 1.22.3.

I've set imx headers path to /opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx, build starts but fails with:

[ 9/12] Compiling libimxdmabuffer.pc.in
In file included from ../imxdmabuffer/imxdmabuffer_g2d_allocator.c:1:
../imxdmabuffer/imxdmabuffer_g2d_allocator.c: In function ‘imx_dma_buffer_g2d_allocator_map’:
../imxdmabuffer/imxdmabuffer_g2d_allocator.c:142:11: error: ‘imx_dwl_buffer’ undeclared (first use in this function); did you mean ‘imx_g2d_buffer’?
  142 |   assert((imx_dwl_buffer->map_flags & flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK) == (flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK));
      |           ^~~~~~~~~~~~~~
../imxdmabuffer/imxdmabuffer_g2d_allocator.c:142:11: note: each undeclared identifier is reported only once for each function it appears in

Could this mean that imx linux headers are too old in that toolchain?

Full log:

``` Setting top to : /home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04 Setting out to : /home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build Checking for 'gcc' (C compiler) : aarch64-poky-linux-gcc -mcpu=cortex-a53 -march=armv8-a+crc+crypto -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux Testing compiler flags -O2 -pipe -g -feliminate-unused-debug-types Checking if building with these flags works : yes Checking for compiler switch -O2 : yes Checking for compiler switch -DPIC : yes Checking for compiler switch -fPIC : yes Checking for compiler switch -pedantic : yes Checking for compiler switch -std=gnu99 : yes Checking for compiler switch -Wall : yes Checking for compiler switch -Wextra : yes Checking for header linux/mxcfb.h : yes i.MX linux headers path: /opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx Checking for dma-heap allocator support by testing the presence of the DMA_HEAP_IOCTL_ALLOC ioctl : yes dma-heap device node path: /dev/dma_heap/linux,cma dma-heap allocates uncached memory : no Checking for ION allocator support by testing the presence of linux/ion.h : yes --hantro-decoder-version is not set; disabling DWL allocator Hantro decoder version: None Hantro headers path: checking for linux/fb.h and the IPU header linux/ipu.h : yes Checking for library g2d : yes Checking for header g2d.h : yes checking for linux/pxp_device.h : yes libimxdmabuffer version 1.1.2 'configure' finished successfully (0.635s) Waf: Entering directory `/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build' [ 1/12] Compiling imxdmabuffer/imxdmabuffer_pxp_allocator.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_pxp_allocator.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_pxp_allocator.c.1.o'] [ 2/12] Compiling imxdmabuffer/imxdmabuffer_ion_allocator.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_ion_allocator.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_ion_allocator.c.1.o'] [ 3/12] Compiling imxdmabuffer/imxdmabuffer.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer.c.1.o'] [ 4/12] Compiling imxdmabuffer/imxdmabuffer_g2d_allocator.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_g2d_allocator.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_g2d_allocator.c.1.o'] [ 5/12] Compiling imxdmabuffer/imxdmabuffer_ipu_priv.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_ipu_priv.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_ipu_priv.c.1.o'] [ 6/12] Compiling imxdmabuffer/imxdmabuffer_dma_heap_allocator.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_dma_heap_allocator.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_dma_heap_allocator.c.1.o'] [ 7/12] Compiling imxdmabuffer/imxdmabuffer_ipu_allocator.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_ipu_allocator.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_ipu_allocator.c.1.o'] [ 8/12] Compiling test/test-alloc.c 06:52:51 runner ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-I.', '-I..', '../test/test-alloc.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/test/test-alloc.c.4.o'] [ 9/12] Compiling libimxdmabuffer.pc.in In file included from ../imxdmabuffer/imxdmabuffer_g2d_allocator.c:1: ../imxdmabuffer/imxdmabuffer_g2d_allocator.c: In function ‘imx_dma_buffer_g2d_allocator_map’: ../imxdmabuffer/imxdmabuffer_g2d_allocator.c:142:11: error: ‘imx_dwl_buffer’ undeclared (first use in this function); did you mean ‘imx_g2d_buffer’? 142 | assert((imx_dwl_buffer->map_flags & flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK) == (flags & IMX_DMA_BUFFER_MAPPING_READWRITE_FLAG_MASK)); | ^~~~~~~~~~~~~~ ../imxdmabuffer/imxdmabuffer_g2d_allocator.c:142:11: note: each undeclared identifier is reported only once for each function it appears in Waf: Leaving directory `/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build' Build failed -> task in 'imxdmabuffer' failed with exit status 1: {task 139920145773280: c imxdmabuffer_g2d_allocator.c -> imxdmabuffer_g2d_allocator.c.1.o} ['aarch64-poky-linux-gcc', '-mcpu=cortex-a53', '-march=armv8-a+crc+crypto', '-fstack-protector-strong', '-O2', '-D_FORTIFY_SOURCE=2', '-Wformat', '-Wformat-security', '-Werror=format-security', '--sysroot=/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux', '-Wextra', '-Wall', '-std=gnu99', '-pedantic', '-fPIC', '-DPIC', '-O2', '-O2', '-pipe', '-g', '-feliminate-unused-debug-types', '-fPIC', '-I.', '-I..', '-I/opt/fsl-imx-wayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/imx', '../imxdmabuffer/imxdmabuffer_g2d_allocator.c', '-c', '-o/home/vincas/.conan/data/imxdmabuffer/1.1.2/mycompany/stable/build/88abcc74e28af662737a51ad32b4ade060691a04/build/imxdmabuffer/imxdmabuffer_g2d_allocator.c.1.o'] ```
Talkless commented 1 year ago

Right, it seems I can build 1.0.1 on that sysroot, not the latest...

dv1 commented 1 year ago

This was a typo in 1.1.2, fixed in commit 41825b11289be251fed64470893d18b89b0dd38b . I will release a version 1.1.3 soon that includes this. Until then, that commit can be put on top of 1.1.2.

Talkless commented 1 year ago

Thanks @dv1, it builds with fix.