-
Notifications
You must be signed in to change notification settings - Fork 280
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
Generalize and extend unit tests working with binary files #2372
Conversation
kevemueller
commented
Dec 1, 2024
- Fix shlib_list_from_elf_hints to work with FreeBSD files on non-FreeBSD systems.
- Introduce unit test helper function to describe golden values of bundled test binaries.
- Simplify abi unit test to use helper
- Introduce create-parsebin unit test that packages binaries and validates their manifest.
This is a draft PR to start the discussion on shlibs handling. The added IMO if a library is referenced, it should go into Happy to discuss here. |
The test passes on FreeBSD by chance only. E.g. on a FreeBSD14 Aarch64 binary it would "match" the FreeBSD14 amd64 library provided by the runner and go on. |
I agree with this. I think the only reason to filter shlibs is to respect the While working on that I encountered many issues with pkg's internal handling of ABI information, which I have nearly finished cleaning up. (sneak peek here, need to fix a few regressions and clean up the comments) When that's done (hopefully tomorrow), I plan to return to my implementation of #2331 which will be made significantly easier to implement through my internal ABI handling improvements. Having tests for shlib tracking sounds amazing! |
Well, I sees the clarifications in ABI processing. Would have benefited from them :)
Just FYI I am now making the change to remove pkg_macho.c, so we will have some merges to be done. The code to create shlib regression tests is already in this commit and it is "early" stage. |
* Fix shlib_list_from_elf_hints to work with FreeBSD files on non-FreeBSD systems. * Introduce unit test helper function to describe golden values of bundled test binaries. * Simplify abi unit test to use helper * Introduce create-parsebin unit test that packages binaries and validates their manifest.
* Add analyse_macho to read and populate shared libraries * Remove legacy pkg_macho code.
I have now added to this draft the Mach-O shlibs code as well as the removal of the legacy Mach-o code. Please advise if you want to disable the failing ELF tests or keep them failing so the code is being picked up. I have temporarily added the shlibs enabled MacOS test binaries built using the Makefile from #2373. |
Sure, will do. I don't think I really understand what these architectures are though. Don't all amd64 processors have 32 bit compatibility support? What's the difference between amd64 and amd64-x32?
No worries, I don't mind resolving conflicts if you get your code finished first :) |
X32 or more generally ILP32 is using the advanced instruction sets available on the modern (64bit) architecture, but only 32bit adresses. E.g. https://wiki.debian.org/X32Port Will unlikely happen in FreeBSD, but it is there. More common under RISCV and PPC, but in general people have accustomed themselves to 64bit address spaces. The Mach-O code is in the PR. |