Issue |
134029
|
Summary |
Cross compiling with libc++ headers cause reference to unresolved using declaration
|
Labels |
libc++
|
Assignees |
|
Reporter |
neko-para
|
Refering #133934
I'm cross compiling to x86_64-linux-gnu on macos, with a sysroot containing linux 4.4 & glibc 2.23 (ubuntu 16.04). With the following commands strange errors shows.
MacOS clang 20.1.1 from HomeBrew
Sysroot built by crosstool-ng
Libcxx 16.0.6
According to [documents of 16.0.0](https://releases.llvm.org/16.0.0/projects/libcxx/docs/) and [documents of 17.0.0](https://releases.llvm.org/17.0.1/projects/libcxx/docs/), seems that libcxx of version below 17 should work for glibc 2.23. (In 17.0.1 `Only glibc-2.24 and later and no other libc is officially supported` appears)
However, I've already build clang 16.0.6 directly on linux (by an older version clang 12), which currently just works fine.
---
```
clang++ --target=x86_64-unknown-linux-gnu 1.cpp -o 1 --sysroot /Volumes/T8/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot -fuse-ld=lld --gcc-toolchain=/Volumes/T8/x-tools/x86_64-unknown-linux-gnu -isystem /Volumes/T8/clang-amd64-cross/include/c++/v1 -L/Volumes/T8/clang-amd64-cross/lib -stdlib=libc++
```
type A
```
In file included from 1.cpp:1:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/iostream:43:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/ios:221:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/__locale:18:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/mutex:191:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/__memory/shared_ptr.h:31:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/__memory/unique_ptr.h:17:
/Volumes/T8/clang-amd64-cross/include/c++/v1/__functional/hash.h:43:12: error: reference to unresolved using declaration
43 | _VSTD::memcpy(&__r, __p, sizeof(__r));
| ^
/Volumes/T8/clang-amd64-cross/include/c++/v1/cstring:80:1: note: using declaration annotated with 'using_if_exists' here
80 | using ::memcpy _LIBCPP_USING_IF_EXISTS;
| ^
```
type B
```
In file included from 1.cpp:1:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/iostream:43:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/ios:221:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/__locale:18:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/mutex:191:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/__memory/shared_ptr.h:42:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/atomic:2668:
In file included from /Volumes/T8/clang-amd64-cross/include/c++/v1/cmath:317:
/Volumes/T8/clang-amd64-cross/include/c++/v1/math.h:388:31: error: use of undeclared identifier 'FP_NAN'
388 | return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
|
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs