Skip to content

flag_if_supported("-std=c++YY") seems to always fail with clang #730

@jonringer

Description

@jonringer

A long form report can be found here: dtolnay/cxx#952

cxx sets .flag_if_supports("-std=c++11") by default, yet this doesn't get passed to the underlying CC invocation:

Command "clang++" "-O0" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-ios" "-m64" "-mios-simulator-version-min=7.0" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk" "-fembed-bitcode" "-Wall" "-Wextra" "-o" ".../cxx/target/x86_64-apple-ios/debug/build/cxx-ccd15dd18add3b1b/out/src/cxx.o" "-c" "src/cxx.cc" with args "clang++" did not execute successfully (status code exit status: 1).

Summary

On MacOS (maybe all clang installations), usage of the .flag_if_supported() method seems to always fail as clang emits a number of "unused arguments" warnings to stderr. Many of the options such as -fPIC don't get used with the flag_check command and thus clang emits many warnings even without an explicit -v being present. Since stderr is checked for potential failures, all invocations of flag_if_supported() seem to be omitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions