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

Introduce hints to ABI_FILE to select fat binary entries #2353

Closed
wants to merge 1 commit into from

Conversation

kevemueller
Copy link

With this change ABI_FILE accepts an optional suffix separated by '#' from the path, this suffix is an architecture description, the same format as ALTABI after :.

The architecture hint is used to select a matching architecture from a Mach-O universal binary file.

Extend the pkg_abi_macho to use the provided architecture (hint) to select the right binary from an universal binary.
Add unit tests for this use case.
Also improve error handling and remove a memory leak.

@kevemueller
Copy link
Author

Closes #2345

NB: If there is no hint provided, I have opted to continue to select the first entry. Emitting a notice here breaks many unit tests, so I do this silently.
Putting together the 'native' ALTABI string seemed a big overhead and is in general against the new philosophy that it should not matter where you run pkg.

@kevemueller kevemueller force-pushed the fatabi branch 2 times, most recently from 4af6502 to 0b24a0f Compare November 22, 2024 15:52
@kevemueller
Copy link
Author

Sorry for the multi-force push, there was a last minute code-formatter introduced include re-ordering as well as the obvious -o IGNORE_OSMAJOR=1 needed on FreeBSD.

@kevemueller
Copy link
Author

This is now merged to reflect your changes with ABI and ALTABI.
Based on those changes I guess I need to rewrite this to use ABI (3rd, TARGET_ARCH entry) as the selector and not ALTABI (3rd &4th entry, a.k.a ELF architecture) which I use right now.
Please confirm and I will do the small change.

@bapt
Copy link
Member

bapt commented Nov 24, 2024

I confirm

…l binary

With this change ABI_FILE accepts an optional suffix separated by '#' from the path, this suffix is an architecture description, the same format as ABI after <os>:<version>. The architecture hint is used to select a matching architecture from a Mach-O universal binary file.
Extend the pkg_abi_macho to use the provided architecture (hint) to select the right binary from an universal binary.
Add unit tests for this use case.
Also improve error handling and remove memory leak.
@kevemueller
Copy link
Author

Using now ABI, logic remains the same.
Added multiple ATF-checks for all sort of corner cases.
The shlibs parsing remains empty. I will write that after the new shlibs is implemented with ELF.

@bapt
Copy link
Member

bapt commented Nov 25, 2024

I have introduce another conflict which I hope I have properly fixed before merging this.

@bapt bapt closed this Nov 25, 2024
@kevemueller kevemueller deleted the fatabi branch November 28, 2024 12:30
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.

2 participants