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

freebsd: fix bootstrapping tools under Linux/musl #15780

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

valpackett
Copy link
Contributor

Motivation and Context

musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools under musl distros has been failing with stat64 errors.

Description

Apply the aliases under non-glibc Linux to fix this problem.

How Has This Been Tested?

This is part of my work on making FreeBSD build under Chimera Linux; it builds :)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf added Type: Building Indicates an issue related to building binaries Status: Code Review Needed Ready for review and testing labels Jan 16, 2024
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of my work on making FreeBSD build under Chimera Linux; it builds :)

That's pretty cool.

Can you just address the make cstyle issue, then force update the PR.

musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools
under musl distros has been failing with stat64 errors.

Apply the aliases under non-glibc Linux to fix this problem.

Signed-off-by: Val Packett <[email protected]>
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jan 18, 2024
Copy link
Contributor

@ryao ryao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should cause build failures on older versions of musl due to -Werror (unless we are not using it on FreeBSD and I have yet to realize). We should use #ifundef as a guard against multiple definitions to avoid problems on them.

This also would likely cause build failures on systems using uclibc and klibc. At a glance, uclibc appears to mimic glibc while klibc is like musl, but defines these. I am not sure if anyone is using these libcs (or if we even build on them at present), but we probably should also include !defined(__UCLIBC__) in the linux check. klibc should not need an explicit check as long as it has the multiple definition protection meant for older musl libc versions.

@ryao
Copy link
Contributor

ryao commented Jan 18, 2024

@behlendorf Boostrapping FreeBSD on other Linux libcs is likely broken in other places (since I doubt anyone ever does it), so it would not be terrible if you merge this without minor corrections for the portability issues that I raised.

@behlendorf
Copy link
Contributor

@ryao I fully expect there are other compatibility issues out there lurking. We'll have to fix those as they're encountered.

@behlendorf behlendorf merged commit d9cb42d into openzfs:master Jan 19, 2024
23 of 25 checks passed
@valpackett valpackett deleted the patch-2 branch January 20, 2024 02:07
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jan 29, 2024
musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools
under musl distros has been failing with stat64 errors.

Apply the aliases under non-glibc Linux to fix this problem.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Closes openzfs#15780
behlendorf pushed a commit that referenced this pull request Jan 29, 2024
musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools
under musl distros has been failing with stat64 errors.

Apply the aliases under non-glibc Linux to fix this problem.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Closes #15780
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools
under musl distros has been failing with stat64 errors.

Apply the aliases under non-glibc Linux to fix this problem.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Closes openzfs#15780
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools
under musl distros has been failing with stat64 errors.

Apply the aliases under non-glibc Linux to fix this problem.

Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Closes openzfs#15780
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested) Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants