Skip to content

Ignore code model setting for m68k - #958

Open
techmetx11 wants to merge 1 commit into
rust-lang:masterfrom
techmetx11:m68k-ignore-code-model
Open

Ignore code model setting for m68k#958
techmetx11 wants to merge 1 commit into
rust-lang:masterfrom
techmetx11:m68k-ignore-code-model

Conversation

@techmetx11

@techmetx11 techmetx11 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

m68k-unknown-none-elf's target spec has the code model set to medium which causes rustc_codegen_gcc to insert -mcmodel=medium in the GCC command-line options. Since GCC m68k doesn't support this option, it prematurely errors with libgccjit.so: error: unrecognized command-line option '-mcmodel=medium'

This PR fixes the issue by making rustc_codegen_gcc ignore the code model setting if the target architecture is m68k

@antoyo

antoyo commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Would it make more sense to fix the issue upstream in the Rust repo?
(i.e. can cg_llvm set the code model on that target?)
Perhaps by removing the code model from this target spec?

@techmetx11

techmetx11 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Would it make more sense to fix the issue upstream in the Rust repo? (i.e. can cg_llvm set the code model on that target?) Perhaps by removing the code model from this target spec?

Probably would, since the m68k-unknown-linux-gnu target spec has no code model set. I don't know why the code model is set specifically for this target

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.

2 participants