Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC #136338

Open
Zeckmathederg opened this issue Jan 31, 2025 · 6 comments
Assignees
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Zeckmathederg
Copy link

Zeckmathederg commented Jan 31, 2025

On my x86_64-unknown-linux-gnu system when compiling Rustc-1.84.1, I get the following warnings:

   Compiling rustc_parse v0.0.0 (/sources/mesa/rustc-1.84.1-src/compiler/rustc_parse)
   Compiling rustc_middle v0.0.0 (/sources/mesa/rustc-1.84.1-src/compiler/rustc_middle)
   Compiling rustc_ast_passes v0.0.0 (/sources/mesa/rustc-1.84.1-src/compiler/rustc_ast_passes)
   Compiling rustc_expand v0.0.0 (/sources/mesa/rustc-1.84.1-src/compiler/rustc_expand)
warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-flto=thin" is not supported by the currently used CC
warning: [email protected]: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
   Compiling rustc_builtin_macros v0.0.0 (/sources/mesa/rustc-1.84.1-src/compiler/rustc_builtin_macros)
   Compiling rustc_infer v0.0.0 (/sources/mesa/rustc-1.84.1-src/compiler/rustc_infer)

This occurs a few more times. This seems similar to issue #134657, although that issue involved MSVC, whereas I am using system LLVM-19.1.6 compiled by GCC-14.2.0 on a glibc-2.40 system. From what I understand of the linked issue, these warnings are harmless and have to do with the cc version in Cargo.lock and other similar files. Rustc compiled just fine and compiles Rust packages fine.

Thanks in advance!

@Zeckmathederg Zeckmathederg added the C-bug Category: This is a bug. label Jan 31, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 31, 2025
@jieyouxu jieyouxu added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-external-bug Category: issue that is caused by bugs in software beyond our control T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed C-external-bug Category: issue that is caused by bugs in software beyond our control needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 31, 2025
@jieyouxu
Copy link
Member

I believe this is due to trying to pass clang-specific flags via cc-the-crate, but the underlying C++ compiler is actually gcc (well, g++). For instance,

@jieyouxu
Copy link
Member

jieyouxu commented Jan 31, 2025

Hang on, that might not be it No that is it, in cc https://github.com/rust-lang/cc-rs/blob/8533e8cdb73a07ef4fc694c0c9c5b5d67f491ebe/src/flags.rs#L219-L221 here we try to inherit lto flags, but that flag interface is only available for clang, not gcc.

@jieyouxu jieyouxu self-assigned this Jan 31, 2025
@Zeckmathederg
Copy link
Author

Yeah I talked with another person and he said that GCC is the underlying compiler and doesn't support those flags, that Clang would have to be used to support them.

@jieyouxu
Copy link
Member

cc-side PR: rust-lang/cc-rs#1379

@jieyouxu jieyouxu added the C-external-bug Category: issue that is caused by bugs in software beyond our control label Jan 31, 2025
@jieyouxu
Copy link
Member

rust-lang/cc-rs#1379 was merged, so rust-lang/rust side we just need to wait for the next cc version to bump the bootstrap cc (er maybe also compiler cc, can't quite remember).

@jieyouxu jieyouxu removed the C-external-bug Category: issue that is caused by bugs in software beyond our control label Jan 31, 2025
@Zeckmathederg
Copy link
Author

Thanks for the quick responses and the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants