[cfe-dev] [clang + libcxxabi] Unknown type names 'size_t' and 'uint64_t'

Cág via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 1 01:42:49 PST 2019


Hi everybody,

The issue was briefly mentioned here[0], but
received no attention, probably because it wasn't
the main one.

During the compilation of libcxxabi this happens:
---
/mnt/build/src/llvm/llvm/projects/libcxxabi/include/cxxabi.h:43:26: 
error: unknown type name
       'size_t'
__cxa_allocate_exception(size_t thrown_size) throw();
                          ^
/mnt/build/src/llvm/llvm/projects/libcxxabi/include/cxxabi.h:86:52: 
error: unknown type name
       'uint64_t'
extern _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(uint64_t *);

[...and it repeats]
---

 From what I understand, cxxabi.h can't source stddef.h
and stdint.h of the libc (musl that is in my case), can it?

I'm pretty sure my use case is a lil different from
the one mentioned, llvm is being build with the wrapper:
---
/mnt/build/tools/amd64/bin/clang++ $@ -rtlib=compiler-rt \
         -Wno-unused-command-line-argument \
         -nostdinc++ \
         --sysroot /mnt/build/tools/amd64 \
         -I /mnt/build/tools/amd64/include/c++/v1 \
         -stdlib=libc++ \
         -L-user-start \
         -L /mnt/build/tools/amd64/lib \
         -L-user-end \
         
-Wl,-dynamic-linker,/mnt/build/tools/amd64/lib/ld-musl-x86_64.so.1 \
         -dynamic-linker /mnt/build/tools/amd64/lib/ld-musl-x86_64.so.1 \
         -nodefaultlibs \
         -fuse-ld=lld -lc++ -lunwind -lc++abi -s
---
and clang++ there itself is a cross-compiler, linked
against libstc++ and libgcc.  But I don't think this
itself is the root of problem.  Could it be the flags
the wrapper uses?  Adding -nostdinc makes Clang compain
about missing stddef.h.

The wrapper is able to compile Hello World, and link
it against musl, libc++, libc++abi, and libunwind
properly.

Thanks in advance for reading and helping.  Please
CC me, I'm not subscribed to the list.

Cheers

[0]: http://lists.llvm.org/pipermail/cfe-dev/2017-August/055126.html

--
caóc




More information about the cfe-dev mailing list