Skip to content

Comments

druntime, musl: Remove unused __USE_FILE_OFFSET64 bindings#21639

Merged
dlang-bot merged 1 commit intodlang:masterfrom
ibuclaw:musl_largefile64
Aug 3, 2025
Merged

druntime, musl: Remove unused __USE_FILE_OFFSET64 bindings#21639
dlang-bot merged 1 commit intodlang:masterfrom
ibuclaw:musl_largefile64

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Aug 3, 2025

As pointed out in #21249, Musl doesn't implement *64 versions of these functions because off_t is always 64 bits. However there are aliases defined if _USE_LARGEFILE64_SOURCE is true.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#21639"

void* dli_saddr;
}
}
else version (CRuntime_Musl)
Copy link
Member Author

Choose a reason for hiding this comment

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

This version block already exists at line 192.

@thewilsonator thewilsonator added Druntime Specific to druntime Merge:auto-merge labels Aug 3, 2025
As pointed out in dlang#21249, Musl doesn't implement *64 versions of these
functions because off_t is always 64 bits. However there are aliases
defined if `_USE_LARGEFILE64_SOURCE` is true.
@ibuclaw
Copy link
Member Author

ibuclaw commented Aug 3, 2025

Overlooked sys.mman, removed that mess of static conditions.

Copy link
Contributor

@the-horo the-horo left a comment

Choose a reason for hiding this comment

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

This fixes the linking errors that one used to get on musl based on

enum __USE_FILE_OFFSET64 = false;
being either true or false. Tested on x86_64 and x86 musl with both boolean values.

To fully fix 32-bit arches #21249 is still needed as, currently, time64 musl functions are called with time32 structs which can lead to stack corruption and other such runtime errors.

@dlang-bot dlang-bot merged commit 415db75 into dlang:master Aug 3, 2025
43 checks passed
@ibuclaw ibuclaw deleted the musl_largefile64 branch August 3, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Druntime Specific to druntime Merge:auto-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants