From 898abaf7bea2a7aa0f6cb620a1fe7220aef51620 Mon Sep 17 00:00:00 2001 From: techmetx11 Date: Sat, 15 Aug 2026 21:33:29 +0100 Subject: [PATCH] Ignore code model setting for m68k --- src/gcc_util.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gcc_util.rs b/src/gcc_util.rs index fe26e3d8fe5..7f85864710b 100644 --- a/src/gcc_util.rs +++ b/src/gcc_util.rs @@ -204,13 +204,16 @@ pub fn new_context<'gcc>(sess: &Session) -> Context<'gcc> { if let Some(model) = sess.code_model() { use rustc_target::spec::CodeModel; - context.add_command_line_option(match model { - CodeModel::Tiny => "-mcmodel=tiny", - CodeModel::Small => "-mcmodel=small", - CodeModel::Kernel => "-mcmodel=kernel", - CodeModel::Medium => "-mcmodel=medium", - CodeModel::Large => "-mcmodel=large", - }); + // NOTE: GCC m68k has no option for configuring the code model, so this should be ignored. + if sess.target.arch != Arch::M68k { + context.add_command_line_option(match model { + CodeModel::Tiny => "-mcmodel=tiny", + CodeModel::Small => "-mcmodel=small", + CodeModel::Kernel => "-mcmodel=kernel", + CodeModel::Medium => "-mcmodel=medium", + CodeModel::Large => "-mcmodel=large", + }); + } } match sess.stack_protector() {