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 libs: Host dependency and cross compilation #26161

Open
vithalsm opened this issue Dec 11, 2024 · 9 comments · May be fixed by #26162
Open

libudev libs: Host dependency and cross compilation #26161

vithalsm opened this issue Dec 11, 2024 · 9 comments · May be fixed by #26162
Labels
question Further information is requested

Comments

@vithalsm
Copy link

What is your question?

Hi !, my question is regarding building libudev libs for linking to host - for cross compilation purposes.
Existing libudev only seem to install/check 'system' udev libs, but doesn't pull source code and build. As a result even cross compilation of 'libudev' itself fails (in test_package) as it doesn't find right '.h' files.

So, for cross compilation case, wherein linker requires corresponding udev libs, what is the suggested option?

@vithalsm vithalsm added the question Further information is requested label Dec 11, 2024
@valgur
Copy link
Contributor

valgur commented Dec 11, 2024

I have a pending PR for exactly this case: master...valgur:conan-center-index:cross/libudev
It adds non-system libudev to enable cross-compilation of packages that depend on it.

For the time being you can copy the recipe or use my repo as an additional remote: https://github.com/valgur/conan-center-index?tab=readme-ov-file#setup

@valgur valgur linked a pull request Dec 11, 2024 that will close this issue
3 tasks
@valgur
Copy link
Contributor

valgur commented Dec 11, 2024

Created a PR as well now: #26162.

@vithalsm
Copy link
Author

Thanks @valgur.
Will look forward for the merge/release.

@jcar87
Copy link
Contributor

jcar87 commented Dec 11, 2024

Hi @vithalsm -in some scenarios the recipes are already able to resolve this without further changes. Could you provide the following details:

  • which distro, distro version and architecture are you targetting?
  • which distro, distro version and architecture are you building on?
  • could you paste your host conan profile including all confs?
    thanks!

@vithalsm
Copy link
Author

Hi @jcar87, could you please elaborate on how the recipes are able to handle the cross compilation case?
I am cross compiling from x86 machine to x86 target. I have installed 'libudev-dev' on my build machine (thats what libudev intends to do). Please find the conan profiles as below:

======= Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=RelWithDebInfo
compiler=gcc
compiler.cppstd=gnu14
compiler.libc=glibc
compiler.libc.version=2.34
compiler.libcxx=libstdc++
compiler.version=10.3
os=Linux
os.platform=myplat
os.version=5.10.209

[options]
*:fPIC=True
*:shared=True

[conf]
tools.build.cross_building:can_run=False
tools.build.cross_building:cross_build=True
tools.build:skip_test=True
tools.build:sysroot=/usr/myplat-sysroot
tools.cmake.cmake_layout:build_folder_vars=['settings.os.platform']
tools.gnu:host_triplet=x86_64-myplat-linux-gnu

[buildenv]
CONAN_CMAKE_FIND_ROOT_PATH=/usr/x86-10.3-glibc-2.34
CONAN_CMAKE_SYSROOT=/usr/myplat-sysroot
CC=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-gcc
CXX=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-g++
STRIP=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-strip
AR=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-ar
AS=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-as
LD=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-ld
RANLIB=/usr/x86-10.3-glibc-2.34/bin/x86_64-myplat_buildroot-linux-gnu-ranlib

Profile build:

[settings]
arch=x86_64
build_type=RelWithDebInfo
compiler=gcc
compiler.cppstd=gnu14
compiler.libc=glibc
compiler.libc.version=2.31
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux
os.platform=native
os.version=5.15

[options]
*:fPIC=True
*:shared=True

[conf]
tools.build:compiler_executables={'c': '/usr/bin/gcc'}
tools.cmake.cmake_layout:build_folder_vars=['settings.os.platform']

@vithalsm
Copy link
Author

Using the changes from PR mentioned above by @valgur. Build still fails with libudev not able to find one of the dependency

header file.In file included from ../src/src/libsystemd/sd-bus/bus-control.c:16:
../src/src/basic/capability-util.h:6:10: fatal error: sys/capability.h: No such file or directory
6 | #include <sys/capability.h>
| ^~~~~~~~~~~~~~~~~~

libcap is included as dependency both in conanfile.py and meson.build of libudev. I see that, libcap.pc file is generated and looks fine. But what I see is, INCLUDE and LIB paths (as exported from libpcap.pc file) are not being included and hence could be the reason for not able to find above file.

Can someone please give me some hints on what could be issue and where to look at please? At the moment stuck/blocked with this issue.
@valgur @memsharded @uilianries

@valgur
Copy link
Contributor

valgur commented Dec 18, 2024

I added a fix for the libcap issue to my PR.

@jcar87
Copy link
Contributor

jcar87 commented Dec 18, 2024

Hi @vithalsm - which recipes from Conan center are you trying to build?

@valgur
Copy link
Contributor

valgur commented Dec 18, 2024

@jcar87
@vithalsm said that he's trying to build DPDK from #24817 in the related PR.

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

Successfully merging a pull request may close this issue.

3 participants