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

std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions. #21177

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Aug 23, 2024

These are fundamentally incapable of producing accurate information for reasons I've laid out in #20771. Since our only use of these functions is to check that object files have the correct machine type, and since #21020 made std.Target.to{Coff,Elf}Machine() more accurate, just switch these checks over to that and compare the machine type tags instead.

Closes #20771.

src/link/Elf/Object.zig Outdated Show resolved Hide resolved
@alexrp alexrp force-pushed the elf-coff-conv branch 2 times, most recently from bca68db to a878785 Compare August 23, 2024 16:20
These are fundamentally incapable of producing accurate information for reasons
I've laid out in ziglang#20771. Since our only use of these functions is to check that
object files have the correct machine type, and since ziglang#21020 made
`std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over
to that and compare the machine type tags instead.

Closes ziglang#20771.
@alexrp
Copy link
Member Author

alexrp commented Aug 24, 2024

x86_64-windows-release timeout looks unrelated.

@andrewrk andrewrk merged commit 849c31a into ziglang:master Aug 25, 2024
10 checks passed
@alexrp alexrp deleted the elf-coff-conv branch August 25, 2024 21:52
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.

Conversion functions to/from ELF/COFF machine types need rethinking
3 participants