{"record":{"id":"422be7cb19c9d709","repo":"rust-lang/rust","slug":"from-uncompressed-file","errorCode":null,"errorMessage":"from uncompressed file","messagePattern":"from uncompressed file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_codegen_gcc/src/back/lto.rs","lineNumber":238,"sourceCode":"        // We add the object files and save in should_combine_object_files that we should combine\n        // them into a single object file when compiling later.\n        for (bc_decoded, name) in serialized_modules {\n            let _timer = prof\n                .generic_activity_with_arg_recorder(\"GCC_fat_lto_link_module\", |recorder| {\n                    recorder.record_arg(format!(\"{:?}\", name))\n                });\n            info!(\"linking {:?}\", name);\n            match bc_decoded {\n                SerializedModule::Local(ref module_buffer) => {\n                    module.module_llvm.lto_mode = LtoMode::Fat;\n                    module\n                        .module_llvm\n                        .context\n                        .add_driver_option(module_buffer.0.to_str().expect(\"path\"));\n                }\n                SerializedModule::FromRlib(_) => unimplemented!(\"from rlib\"),\n                SerializedModule::FromUncompressedFile(_) => {\n                    unimplemented!(\"from uncompressed file\")\n                }\n            }\n        }\n        save_temp_bitcode(cgcx, &module, \"lto.input\");\n\n        // Internalize everything below threshold to help strip out more modules and such.\n        /*unsafe {\n        let ptr = symbols_below_threshold.as_ptr();\n        llvm::LLVMRustRunRestrictionPass(\n            llmod,\n            ptr as *const *const libc::c_char,\n            symbols_below_threshold.len() as libc::size_t,\n        );*/\n\n        save_temp_bitcode(cgcx, &module, \"lto.after-restriction\");\n        //}\n    }\n","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_codegen_gcc/src/back/lto.rs#L220-L256","documentation":"Raised by rustc_codegen_gcc's fat-LTO path when a serialized module being linked is a SerializedModule::FromUncompressedFile variant. Like the FromRlib arm, the GCC backend has not implemented reading an uncompressed on-disk bitcode file for fat LTO, so it panics via unimplemented! to refuse the unsupported path.","triggerScenarios":"Running fat LTO under the GCC backend where the module set contains an uncompressed bitcode file input (e.g. an explicit .bc file fed to the linker). The match arm at lto.rs:237-238 panics.","commonSituations":"Build pipeline feeds raw .bc files into the link step; an incremental/incremental-LTO configuration routes modules through the uncompressed-file path; a custom build script passes precompiled bitcode.","solutions":["Avoid passing uncompressed .bc files to the GCC backend's LTO step; rebuild from source or compressed modules.","Disable fat LTO for the GCC backend (-C lto=off).","Implement or upstream the FromUncompressedFile handling in rustc_codegen_gcc."],"exampleFix":"# before: feeding raw bitcode into a fat-LTO link\nrustc -C lto=fat --foo.bc main.rs\n# after\nrustc -C lto=fat main.rs\n","handlingStrategy":"validation","validationCode":"# Reject builds that feed uncompressed .bc into the GCC backend's LTO step\nimport sys\nif any(a.endswith(\".bc\") for a in sys.argv):\n    sys.exit(\"rustc_codegen_gcc fat-LTO cannot consume uncompressed bitcode files\")\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not pass raw .bc inputs to the GCC backend link/LTO step.","Build from source so modules reach LTO via the Local path."],"tags":["codegen","gcc-backend","lto","rustc","unimplemented"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}