1
Fork 0

Rollup merge of #137830 - LuigiPiucco:incompatible-isa-fix, r=workingjubilee

Fix link failure on AVR (incompatible ISA error)

Fixes #137739. A reproducer of the issue is present there. I believe the root cause was introducing the avr-none target (which has no CPU by default) while also trying to get the ISA revision from the target spec. This commit uses the `target-cpu` option instead, which is already required to be present for the target.

r? compiler
cc ``@Patryk27``
This commit is contained in:
Matthias Krüger 2025-03-01 16:03:20 +01:00 committed by GitHub
commit 878f383118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -373,7 +373,11 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
Architecture::Avr => { Architecture::Avr => {
// Resolve the ISA revision and set // Resolve the ISA revision and set
// the appropriate EF_AVR_ARCH flag. // the appropriate EF_AVR_ARCH flag.
ef_avr_arch(&sess.target.options.cpu) if let Some(ref cpu) = sess.opts.cg.target_cpu {
ef_avr_arch(cpu)
} else {
bug!("AVR CPU not explicitly specified")
}
} }
Architecture::Csky => { Architecture::Csky => {
let e_flags = match sess.target.options.abi.as_ref() { let e_flags = match sess.target.options.abi.as_ref() {