Skip to content

libunwind fails to compile with clang-9 as C/C++ compiler #73690

Closed
@fogti

Description

@fogti
Contributor

I was using xargo to cross-compile a project (to a musl target) which required the Rust std crate, and it failed while linking building libunwind, because clang-9 doesn't like the combination -std=c99 -std=c++11 used in src/libunwind/build.rs. I was able to work around this by simply commenting out the respective lines, but I think the build.rs script should be able to determine the compiler&version, and skip adding these flags if it detects a recent clang version, which seem to be more strict about this than recent GCC versions (which, as I've read, only produce a warning in that case).

It may help to separate compilation of libunwind's C (-std=c99) and C++ (-std=c++11) code, but I'm unsure how to inform the cc crate that it should use different flags for C and C++, and still linking them into the same static lib...

related:

Activity

fogti

fogti commented on Jun 24, 2020

@fogti
ContributorAuthor

closed as DUP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @fogti

        Issue actions

          libunwind fails to compile with clang-9 as C/C++ compiler · Issue #73690 · rust-lang/rust