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

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

Closed
fogti opened this issue Jun 24, 2020 · 1 comment
Closed

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

fogti opened this issue Jun 24, 2020 · 1 comment

Comments

@fogti
Copy link
Contributor

fogti commented Jun 24, 2020

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:

@fogti
Copy link
Contributor Author

fogti commented Jun 24, 2020

closed as DUP.

@fogti fogti closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant