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

macOS: Building profiler runtime with system clang 15 gives warning: argument unused during compilation: '-stdlib=libc++' #116552

Closed
Zalathar opened this issue Oct 9, 2023 · 3 comments
Labels
C-bug Category: This is a bug. O-macos Operating system: macOS T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Zalathar
Copy link
Contributor

Zalathar commented Oct 9, 2023

On macOS, if I have profiler = true in my config.toml and I run x build library, the build succeeds but I see dozens of console warnings:

warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
(full console output)
$ x build library
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.03s
Building stage0 library artifacts (aarch64-apple-darwin)
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
    Finished release [optimized] target(s) in 0.07s
Building compiler artifacts (stage0 -> stage1, aarch64-apple-darwin)
    Finished release [optimized] target(s) in 0.13s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 library artifacts (aarch64-apple-darwin)
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
warning: clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
    Finished release [optimized] target(s) in 0.07s
Build completed successfully in 0:00:01

This started happening after I accepted a system update to Command Line Tools for Xcode version 15.0.

The warnings appear to occur when building library/profiler_runtime. This component is not built by default (hence the profiler = true), but is needed when building coverage-instrumented binaries, and is included in actual releases of rustc.


System info

$ sw_vers
ProductName:		macOS
ProductVersion:		13.6
BuildVersion:		22G120

$ clang --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
# config.toml
profile = "compiler"
change-id = 115898

[build]
profiler = true
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 9, 2023
@Zalathar
Copy link
Contributor Author

Zalathar commented Oct 9, 2023

I tracked this down to a C++ flag being unconditionally added to CFLAGS, and wrote a candidate fix in #116017, but I'm not sure what needs to be done to move forward with that.

@Zalathar
Copy link
Contributor Author

The same warning also appears when building C files as part of building LLVM from source.

@Noratrieb Noratrieb added O-macos Operating system: macOS T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 31, 2023
@Zalathar
Copy link
Contributor Author

This was fixed by #116017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-macos Operating system: macOS 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