fix Issue 22823 - dmd.root.file: File.read fails to read any file on PPC #13719
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The druntime fix is dlang/druntime#3762, but older releases of the compiler can't be used to bootstrap as-is. This provides a stub definition of
stat_twhich fixes the read routines for calling stat to get file sizes correct.stat_tis also used bydmd.lib, anddmd.common.file. But bothFileMapperandLibraryare only used by the dmd backend.Note, am using__VERSION__ < 2099here, as gdc is making the jump from 2.076 (C++) to 2.099 (D). For ldc, which switched to being self hosted a long while before, retroactively fixing self-hosted PPC will be more difficult.Edit: switched to
stat_t_imported.st_size.offsetof != 48. Also fixed thestat()andfstat()definitions to be friendly towards CRuntimes that aren't glibc.FYI @kinke.