Coder Social home page Coder Social logo

Android xmake fails about libbpf-bootstrap HOT 10 CLOSED

 avatar commented on June 26, 2024
Android xmake fails

from libbpf-bootstrap.

Comments (10)

waruqi avatar waruqi commented on June 26, 2024 3

I have fixed this error. #237

we can use bpftool 7.2.0 now.

from libbpf-bootstrap.

waruqi avatar waruqi commented on June 26, 2024 1

I have fixed this issue, see this patch. #236

This is because after the elfutils package in xmake-repo was installed, its make install script did not automatically install elf.h, so elfutils/libelf.h automatically found elf.h on the system, resulting in some header file conflicts.

incorrect search paths:

bpf -> elfutils/libelf.h -> system/elf.h 

now:

bpf -> elfutils/libelf.h -> elfutils/elf.h 

system/libelf is too old, we should not use it. and I have updated elfutils to 0.189

I've fixed this, try reinstalling the elfutils package to fix this.

xrepo update-repo
xrepo remove --all -y elfutils
xmake f -p android -c --require-bpftool=y
xmake

from libbpf-bootstrap.

waruqi avatar waruqi commented on June 26, 2024 1

When I do --require-bpftool=y which means that bpftool is fetched from xmake repo it works! thanks! But when I try to install bfptool from Github on the system, for example latest 7.2.0 it fails same way.

I need to be able to specify package versions by commit or something

Due to some issues with system bpftool 7.2.0, it is recommended to pull the specified version of bpftool from the remote by default until these issues are fixed. It always works fine.

Also, we can specify the bpftool version in the add_requires() of xmake.lua

#237

Now we can only run xmake f -p android to configure and build it.

And I'm going to improve the fetch script for the bpftool package inside xmake-repo to also enable version checking of the system bpftool, so that if the system bpftool is the one we need, we can still prioritise the use of the system bpftool instead of downloading and installing it every time.

from libbpf-bootstrap.

anakryiko avatar anakryiko commented on June 26, 2024

xmake support is best-effort, unfortunately. It seems like your libelf is too old, unfortunately. Can you try updating it on your system?

from libbpf-bootstrap.

anakryiko avatar anakryiko commented on June 26, 2024

actually, I think we might need to just fix it on libbpf side to avoid this problem, I'll look into that

from libbpf-bootstrap.

anakryiko avatar anakryiko commented on June 26, 2024

hm... it seems like SHT_GNU_versym has been defined since at least 2005, so either you have super ancient version of libelf, or it's wrong one. You need elfutils package, I believe.

from libbpf-bootstrap.

guri87-byte avatar guri87-byte commented on June 26, 2024

I have the same case as the OP, when running xmake f -p android on the first time following packages are installed:

  -> ndk 22.0
  -> zlib v1.3 [toolchains:"@ndk", from:elfutils]
  -> libintl 0.21 [toolchains:"@ndk", from:elfutils]
  -> argp-standalone 1.3 [toolchains:"@ndk", from:elfutils]
  -> elfutils 0.183

It installed elfutils 0.183, I guess we all should have the same version, isn't?

dpkg -s libelf1

Package: libelf1
Status: install ok installed
Priority: important
Section: libs
Installed-Size: 192
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Multi-Arch: same
Source: elfutils
Version: 0.186-1build1
Depends: libc6 (>= 2.33), zlib1g (>= 1:1.1.4)

from libbpf-bootstrap.

guri87-byte avatar guri87-byte commented on June 26, 2024

Updated to the latest elfutils available on Ubuntu 22.04 but same.

from libbpf-bootstrap.

guri87-byte avatar guri87-byte commented on June 26, 2024

When I do --require-bpftool=y which means that bpftool is fetched from xmake repo it works! thanks!
But when I try to install bfptool from Github on the system, for example latest 7.2.0 it fails same way.

I need to be able to specify package versions by commit or something

from libbpf-bootstrap.

guri87-byte avatar guri87-byte commented on June 26, 2024

Sounds good, thank you!

from libbpf-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.