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

fix Issue 22823 - dmd.root.file: File.read fails to read any file on PPC #13719

Merged
merged 1 commit into from
Feb 26, 2022

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Feb 25, 2022

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_t which fixes the read routines for calling stat to get file sizes correct.

stat_t is also used by dmd.lib, and dmd.common.file. But both FileMapper and Library are only used by the dmd backend.

Note, am using __VERSION__ < 2099 here, 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 the stat() and fstat() definitions to be friendly towards CRuntimes that aren't glibc.

FYI @kinke.

@dlang-bot
Copy link
Contributor

dlang-bot commented Feb 25, 2022

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
22823 blocker dmd.root.file: File.read fails to read any file on PPC

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#13719"

@dlang-bot dlang-bot merged commit e2df19a into dlang:master Feb 26, 2022
@ibuclaw ibuclaw deleted the issue22823 branch February 26, 2022 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants