Compiler-explorer: Missing <string> when using -m32 with x86-x64 clang

Created on 17 May 2017  路  5Comments  路  Source: compiler-explorer/compiler-explorer

compiler-issue question

Most helpful comment

Try adding -stdlib=libc++ - this will use clang's built-in libc++ standard library instead of GCC's. I'm not sure why this is required, but hopefully you don't need to compare GCC's string implementation.

All 5 comments

Try adding -stdlib=libc++ - this will use clang's built-in libc++ standard library instead of GCC's. I'm not sure why this is required, but hopefully you don't need to compare GCC's string implementation.

Thanks, works!

As a side note, I don't see ARM+clang listed. Clang is currently default compiler for ios/android AFAIK.

Yup, that works for #include <atomic> with clang -m32 as well.

Does that mean that with -m64, clang is also using gcc's headers instead of its own? Could this affect code-gen vs. what you'd get from a normal install of clang on a desktop?

Does that mean that with -m64, clang is also using gcc's headers instead of its own? Could this affect code-gen vs. what you'd get from a normal install of clang on a desktop?

Yes; it does.

However, a "normal install" of clang, as best I can tell, uses the GCC toolchain's libstdc, at least on Linux. Apple's builds I believe bundle libc++, but it's a separate project and repository for clang and so requires extra building.

Fixed since clang 5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VivekChugh picture VivekChugh  路  3Comments

mattgodbolt picture mattgodbolt  路  4Comments

CryZe picture CryZe  路  3Comments

mathbunnyru picture mathbunnyru  路  4Comments

phuclv90 picture phuclv90  路  4Comments