Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libudev: add a non-system recipe #26162

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Dec 11, 2024

Summary

Changes to recipe: libudev/255.15

Motivation

libudev/system is used in several recipes on CCI, but like other system packages, it is not usable in a cross-compilation context.

Details

The libudev library is a part of systemd, but neither libsystemd or libudev depend on each other. I considered making it a component of libsystemd, but keeping them independent of each other seemed preferable, since they are not really used simultaneously in any recipes and it allows for a lighter libudev dependency. The only downside is slight duplication in the recipe.

The recipe cross-compiles successfully with aarch64-linux-gnu-gcc-14.


@vithalsm
Copy link

@valgur (in continuation of other thread on cross compiling libudev from x86_64 to x86_64).
We tried with applying the diffs from this PR. However, libudev build is failing as it can't find a file 'sys/capability.h'. However, libcap is cross built and available for host.
I don't see INC path getting included (explicity), wondering whether that could be the issue.

If you can help us with quick look please. May be by cross building for x86.
============================ Build logs (error part) ===============
Command line: /usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-gcc /home/aos-dev/.conan2/p/b/libud3200b2f38cb14/b/build-relwithdebinfo/meson-private/tmp3ule2c14/testfile.c -o /home/aos-dev/.conan2/p/b/libud3200b2f38cb14/b/build-relwithdebinfo/meson-private/tmp3ule2c14/output.obj -c --sysroot=/usr/myplat-sysroot -D_FILE_OFFSET_BITS=64 -O0 -std=gnu11 -> 0
Message: gperf len type is size_t
Running compile:
Working directory: /home/aos-dev/.conan2/p/b/libud3200b2f38cb14/b/build-relwithdebinfo/meson-private/tmp8pheyca2
Code:

    #ifdef __has_include
     #if !__has_include("sys/capability.h")
      #error "Header 'sys/capability.h' could not be found"
     #endif
    #else
     #include <sys/capability.h>
    #endif

Command line: /usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-gcc /home/aos-dev/.conan2/p/b/libud3200b2f38cb14/b/build-relwithdebinfo/meson-private/tmp8pheyca2/testfile.c -E -P --sysroot=/usr/myplat-sysroot -D_FILE_OFFSET_BITS=64 -P -O0 -std=gnu11 -> 1
stderr:
/home/aos-dev/.conan2/p/b/libud3200b2f38cb14/b/build-relwithdebinfo/meson-private/tmp8pheyca2/testfile.c:4:12: error: #error "Header 'sys/capability.h' could not be found"
4 | #error "Header 'sys/capability.h' could not be found"
| ^~~~~

Has header "sys/capability.h" : NO

../src/meson.build:729:8: ERROR: Problem encountered: POSIX caps headers not found

@valgur
Copy link
Contributor Author

valgur commented Dec 18, 2024

@vithalsm Should be fixed now. Give it another try.

@vithalsm
Copy link

vithalsm commented Dec 18, 2024

@vithalsm Should be fixed now. Give it another try.

@valgur Yes, its fixed and could build libudev successfully. Thanks again.
But, now, dpdk is failing as it can't find '-ludev'. Again, I don't see INC and LIB paths present in the command line. Something similar to libudev not finding libcap. Did you also observe and/or fixed same?

@vithalsm
Copy link

vithalsm commented Dec 18, 2024

@vithalsm Should be fixed now. Give it another try.

@valgur Yes, its fixed and could build libudev successfully. Thanks again. But, now, dpdk is failing as it can't find '-ludev'. Again, I don't see INC and LIB paths present in the command line. Something similar to libudev not finding libcap. Did you also observe and/or fixed same?

Finally, could build 'dpdk' with additional changes as below -

  1. Add 'libudev/255.15' in dependency list of dpdk recipe (require method)
  2. Then, libudev version conflicted between /system (from rdma-core) and 255.15. Have to build dpdk with option ':with_libibverbs=False'.
    Then build went fine.
    Hope above info helps you in someway for your dpdk recipe.

@valgur
Copy link
Contributor Author

valgur commented Dec 18, 2024

@vithalsm i think the with_libibverbs=False itself might have been what fixed it for you, somehow. libcap is only used in dpdk libraries that link against libmlx4 and libmlx5 from rdma-core.

If you want to keep using dpdk with rdma-core, I suggest adding

[replace_requires]
libudev/system: libudev/255.15

to your profile to override the version everywhere.

@vithalsm
Copy link

@vithalsm i think the with_libibverbs=False itself might have been what fixed it for you, somehow. libcap is only used in dpdk libraries that link against libmlx4 and libmlx5 from rdma-core.

If you want to keep using dpdk with rdma-core, I suggest adding

[replace_requires]
libudev/system: libudev/255.15

to your profile to override the version everywhere.

@valgur thank you for this suggestion, was looking for exactly like this. It helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libudev libs: Host dependency and cross compilation
2 participants