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

Failure on Alpine Linux due to ELF parsing #2065

Closed
galdor opened this issue Aug 24, 2022 · 2 comments
Closed

Failure on Alpine Linux due to ELF parsing #2065

galdor opened this issue Aug 24, 2022 · 2 comments

Comments

@galdor
Copy link

galdor commented Aug 24, 2022

I am trying to run pkg on Alpine Linux to build FreeBSD packages containing cross-compiled binaires (meaning that I do not have to run a full FreeBSD VM just for builds, and can use a simple Linux container).

On Alpine 3.16, pkg 1.18.4 compiles just fine, but fails at runtime, e.g. when running pkg help:

pkg: failed to get the note section
pkg: failed to get the note section
pkg: Unable to determine ABI
pkg: Cannot parse configuration file!

A quick look at the code shows that pkg tries to read information from ELF binaries, but error messages do not indicate precisely what went wrong. Same thing with the message about a configuration file, I have not provided any so I do not see how it could not be parsed.

If someone has an idea, I would be more than happy to test a solution, and I could even try to provide a patch.

@bapt
Copy link
Member

bapt commented Aug 24, 2022

pkg will look locally for its ABI, pkg -o ABI_FILE=/some/freebsd/binary will fix your problem

@galdor
Copy link
Author

galdor commented Aug 24, 2022

Ok, got it. Apparently explicitely setting ABI = "freebsd:13:x86:64" in /usr/local/etc/pkg.conf also does the trick. Hopefully it will not cause other problems later.

Merci!

@galdor galdor closed this as completed Aug 24, 2022
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

No branches or pull requests

2 participants