{"record":{"id":"aabbfba94f59e586","repo":"rust-lang/rust","slug":"not-implemented-aabbfb","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_codegen_gcc/src/base.rs","lineNumber":48,"sourceCode":"        Visibility::Hidden => gccjit::Visibility::Hidden,\n        Visibility::Protected => gccjit::Visibility::Protected,\n    }\n}\n\n#[cfg(feature = \"master\")]\npub fn symbol_visibility_to_gcc(visibility: SymbolVisibility) -> gccjit::Visibility {\n    match visibility {\n        SymbolVisibility::Hidden => gccjit::Visibility::Hidden,\n        SymbolVisibility::Protected => gccjit::Visibility::Protected,\n        SymbolVisibility::Interposable => gccjit::Visibility::Default,\n    }\n}\n\npub fn global_linkage_to_gcc(linkage: Linkage) -> GlobalKind {\n    match linkage {\n        Linkage::External => GlobalKind::Imported,\n        Linkage::AvailableExternally => GlobalKind::Imported,\n        Linkage::LinkOnceAny => unimplemented!(),\n        Linkage::LinkOnceODR => unimplemented!(),\n        Linkage::WeakAny => unimplemented!(),\n        Linkage::WeakODR => unimplemented!(),\n        Linkage::Internal => GlobalKind::Internal,\n        Linkage::ExternalWeak => GlobalKind::Imported, // FIXME(antoyo): should be weak linkage.\n        Linkage::Common => unimplemented!(),\n    }\n}\n\npub fn linkage_to_gcc(linkage: Linkage) -> FunctionType {\n    match linkage {\n        Linkage::External => FunctionType::Exported,\n        // FIXME(antoyo): set the attribute externally_visible.\n        Linkage::AvailableExternally => FunctionType::Extern,\n        Linkage::LinkOnceAny => unimplemented!(),\n        Linkage::LinkOnceODR => unimplemented!(),\n        Linkage::WeakAny => FunctionType::Exported, // FIXME(antoyo): should be similar to linkonce.\n        Linkage::WeakODR => unimplemented!(),","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_codegen_gcc/src/base.rs#L30-L66","documentation":"Raised by rustc_codegen_gcc's global_linkage_to_gcc when a global has Linkage::LinkOnceAny. The GCC backend maps most LLVM linkage kinds to gccjit GlobalKind values but has not implemented the link-once family, so the corresponding match arm panics with unimplemented!().","triggerScenarios":"Compiling code under the GCC backend where a global/static symbol is assigned LinkOnceAny linkage (typically COMDAT-like or template-instantiation globals emitted by upstream rustc). global_linkage_to_gcc at base.rs:48 panics.","commonSituations":"Cross-crate generics or monomorphization emit link-once globals; a codegen change in rustc starts emitting LinkOnceAny for a construct the GCC backend previously never saw; building std/core with the GCC backend.","solutions":["Map LinkOnceAny to an equivalent gccjit GlobalKind (Internal or Imported) as a downstream patch and verify ABI.","Avoid the code pattern that forces link-once linkage (e.g. avoid the crate/generic that monomorphizes into a link-once global).","Track upstream rustc_codegen_gcc issue for linkage coverage."],"exampleFix":"// before\nLinkage::LinkOnceAny => unimplemented!(),\n// after (downstream patch, verify ABI correctness)\nLinkage::LinkOnceAny => GlobalKind::Imported,\n","handlingStrategy":"validation","validationCode":"// Before relying on the GCC backend, confirm no global uses LinkOnceAny linkage\n// e.g. dump the crate and grep for linkonce symbols:\n// rustc --emit metadata crate.rs && inspect symbols for linkonce_any\n","typeGuard":"fn is_supported_global_linkage(l: Linkage) -> bool {\n    matches!(l, Linkage::External | Linkage::AvailableExternally\n             | Linkage::Internal | Linkage::ExternalWeak | Linkage::Common)\n}\n","tryCatchPattern":null,"preventionTips":["Avoid code patterns that produce linkonce globals when targeting the GCC backend.","Maintain a downstream patch mapping LinkOnceAny until upstream support lands."],"tags":["codegen","gcc-backend","linkage","rustc","unimplemented"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}