<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Unknown type names 'size_t' and 'uint64_t'"
href="https://bugs.llvm.org/show_bug.cgi?id=40987">40987</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Unknown type names 'size_t' and 'uint64_t'
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++abi
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ca6c@bitmessage.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>[The original thread is here -
<a href="http://lists.llvm.org/pipermail/cfe-dev/2019-March/061492.html">http://lists.llvm.org/pipermail/cfe-dev/2019-March/061492.html</a>]
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]
---
The following CMake options are used:
-DDEFAULT_SYSROOT=/mnt/build/tools/amd64 \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_C_FLAGS_MINSIZEREL_INIT="-march=native" \
-DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="-march=native" \
-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL="-L/mnt/build/tools/amd64/lib" \
-DCMAKE_INSTALL_PREFIX=/mnt/build/builds/amd64/comp \
-DCMAKE_C_COMPILER=/mnt/build/tools/amd64/bin/musl-clang \
-DCMAKE_CXX_COMPILER=/mnt/build/tools/amd64/bin/clangpp \
-DCMAKE_CXX_FLAGS="-I/mnt/build/tools/amd64/include" \
-DCMAKE_LINKER=/mnt/build/tools/amd64/bin/ld.lld \
-DLLVM_TARGET_ARCH=X86 \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-pc-linux-musl \
-DLLVM_INSTALL_BINUTILS_SYMLINKS=ON \
-DLLVM_TOOL_LIBUNWIND_BUILD=ON \
-DCLANG_DEFAULT_RTLIB=compiler-rt \
-DCLANG_DEFAULT_CXX_STDLIB=libc++ \
-DCLANG_ENABLE_BOOTSTRAP=ON \
-DLIBCXX_USE_COMPILER_RT=ON \
-DLIBCXX_HAS_MUSL_LIBC=ON \
-DLIBCXXABI_USE_COMPILER_RT=ON \
-DLLVM_ENABLE_LLD=ON \
-DLLVM_ENABLE_LIBCXX=ON \
-DLLVM_INCLUDE_TESTS=NO \
-DCLANG_INCLUDE_TESTS=NO \
-DLIBCXX_INCLUDE_TESTS=NO \
-DLIBCXXABI_INCLUDE_TESTS=NO \
-DLIBCXXABI_SYSROOT=/mnt/build/tools/amd64 \
-DCMAKE_AR="/mnt/build/tools/amd64/bin/llvm-ar" \
-DCMAKE_AS="/mnt/build/tools/amd64/bin/llvm-as" \
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \
-DLIBUNWIND_USE_COMPILER_RT=ON \
-DLIBCXXABI_USE_LLVM_UNWINDER=ON
bin/musl-clang is this wrapper:
---
#!/bin/sh
cc="/mnt/build/tools/amd64/bin/clang"
libc="/mnt/build/tools/amd64"
libc_inc="/mnt/build/tools/amd64/include"
libc_lib="/mnt/build/tools/amd64/lib"
thisdir="`cd "$(dirname "$0")"; pwd`"
# prevent clang from running the linker (and erroring) on no input.
sflags=
eflags=
for x ; do
case "$x" in
-l*) input=1 ;;
*) input= ;;
esac
if test "$input" ; then
sflags="-l-user-start"
eflags="-l-user-end"
break
fi
done
exec $cc \
-B"$thisdir" \
-Wno-unused-command-line-argument \
-fuse-ld=musl-clang \
-nostdinc \
-rtlib=compiler-rt \
--sysroot "$libc" \
-isystem "$libc_inc" \
-L-user-start \
$sflags \
"$@" \
$eflags \
-L"$libc_lib" \
-L-user-end
---
and bin/clangpp is this 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
The clangpp wrapper is able to compile Hello World, and link it against musl,
libc++, libc++abi, and libunwind properly.
The underlying OS here is CentOS 7. LLVM version 7.0.1. There is also the
Fort compiler in the tree.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>