This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM68: Cannot link wayland-egl.so automatically

Part Number: SK-AM68

With the latest yocto build, the SDK does not automatically link wayland-egl.so without specifying the library file directly via:

set(CMAKE_EXE_LINKER_FLAGS " -lwayland-server -lwayland-client -lEGL -lGLESv2 -lcairo -lwayland-egl")

This would not be an issue, but I must also prepend:
LD_PRELOAD=/usr/lib/libwayland-egl.so
when running our application.
Could someone explain why this library file is not being included automatically in both the SDK build and during runtime?
Is it just missing from the default path? 
Thanks
  • Hi Evan,

    Which yocto image are you building?

    Best,
    Jared

  • Hi Jared,

    I've tried with

    tisdk-default-image and  tisdk-core-bundle
     
    I've tried the edgeai and adas builds, but they either aren't able to get out of u-boot or crash while the kernel is starting.

  • Hi Evan,

    Does this mean you are getting no serial output when you are booting the board?

    Best,
    Jared

  • Hi Jared,

    the tisdk-default-image and tisdk-core-bundle both boot fine.

    I'm specifically wondering why when linking (with the SDK) or running our program (during run time) cannot find a function residing in wayland-egl.so without manually including the library file.

  • Hi Jared,

    I traced the loaded objects on a "normal" run and found only these files:


    linux-vdso.so.1 (0x0000ffff8844e000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x0000ffff883f0000)
    libdl.so.2 => /lib/libdl.so.2 (0x0000ffff883d0000)
    libz.so.1 => /lib/libz.so.1 (0x0000ffff883a0000)
    libm.so.6 => /lib/libm.so.6 (0x0000ffff88300000)
    librt.so.1 => /lib/librt.so.1 (0x0000ffff882e0000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0000ffff882b0000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000ffff88090000)
    libc.so.6 => /lib/libc.so.6 (0x0000ffff87ee0000)
    /lib/ld-linux-aarch64.so.1 (0x0000ffff88415000)

    Using LD_PRELOAD with the file we need I see:
    linux-vdso.so.1 (0x0000ffff8fc7a000)
    /usr/lib/libwayland-egl.so (0x0000ffff8fc20000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x0000ffff8fc00000)
    libdl.so.2 => /lib/libdl.so.2 (0x0000ffff8fbe0000)
    libz.so.1 => /lib/libz.so.1 (0x0000ffff8fbb0000)
    libm.so.6 => /lib/libm.so.6 (0x0000ffff8fb10000)
    librt.so.1 => /lib/librt.so.1 (0x0000ffff8faf0000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0000ffff8fac0000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000ffff8f8a0000)
    libc.so.6 => /lib/libc.so.6 (0x0000ffff8f6f0000)
    /lib/ld-linux-aarch64.so.1 (0x0000ffff8fc41000)

    during the lookup during run-time I see it try nearby lib files, but skips the one that has it:
    760: symbol=wl_egl_window_create; lookup in file=/usr/lib/libwayland-server.so.0 [0]
    760: symbol=wl_egl_window_create; lookup in file=/usr/lib/libwayland-client.so.0 [0]

  • Hi Jared,

    I found I was missing -lwayland-egl from my cmake variable 

    CMAKE_SHARED_LINKER_FLAGS