..and convert clang-*-examples from Architecture: any -> all.
Identified by the multiarch hinter:
* clang-17-examples could be converted to Architecture: all and marked Multi-Arch: foreign
* clang-17-doc could be marked Multi-Arch: foreign
* libomp-17-doc could be marked Multi-Arch: foreign
* llvm-17-doc could be marked Multi-Arch: foreign
sparc/sparc-D98574-clang-def.patch and
sparc/sparc-D98575-compiler-rt.patch are not in debian/patches/series so
it's safe to drop them. D98574 is now merged, D98575 is abandoned, due
to it being fixed elsewhere, so there's no chance they're going to be
revived either.
This commit does two things in one go:
1) Enable COMPILER_RT_DEFAULT_TARGET_ONLY for i386 and amd64:
Right now i386/amd64 are building compiler-rt for each other, in
addition to themselves.:
- libclang-rt-17-dev:amd64 is also shipping the i386 builtins, and
Depending on libc6-i386:amd64/lib32stdc++:amd64.
- libclang-rt-17-dev:i386 is also shipping the x86_64 built-ins, and
Depending on libc6-amd64:i386/lib64stdc++6:i386/lib64atomic1:i386.
Beyond the extra cruft in files and dependencies, this means that the
amd64/i386 packages are shipping conflicting files, and dpkg is refusing
to unpack one in the presence of the other (an RC bug in itself). This
is also identified by the multiarch hinter with the following message:
libclang-rt-17-dev conflicts on 78 files starting with /usr/lib/llvm-17/lib/clang/17/lib/linux/ on amd64 <-> i386
Let users who want to build e.g. 32-bit binaries in amd64 use multi-arch
for this use case, by installing libclang-rt-17-dev:i386. The
alternative would be to support multi-lib, and ship additional packages
such as libclang-rt-17-dev-i386:amd64 (and vice-versa), but this feels
like an overkill. Multi-lib remains still a possibility with (Debian's)
clang's default, libgcc (lib32gcc/lib64gcc) as well.
2) Enable COMPILER_RT_DEFAULT_TARGET_ONLY unconditionally:
This was being passed in an opt-in basis, via STAGE_ALL_CMAKE_EXTRA for
the following architectures:
* armel
* armhf
* powerpc
* sparc
* sparc64
* s390x
* mips64el
* hurd-i386
So, with i386/amd64 also opting-in, this leaves only a few remaining
Debian architectures.
Furthermore, upon inspecting compiler-rt/cmake/base-config-ix.cmake, it
looks like the only architectures that are actually building for
additional (non-default) targets are i386, amd64, powerpc (note: not
ppc64el!), mips*, and arm. Turns out we've disabled that for all of them
now.
Therefore, pass COMPILER_RT_DEFAULT_TARGET_ONLY=ON to all architectures
unconditionally, and thus reduce an additional variation factor.
libc++abi-*-dev is necessary when using libc++-*-dev:
$ apt install clang-17 libc++-17-dev
$ clang++-17 -stdlib=libc++ -o hello hello.cpp
/usr/bin/ld: cannot find -lc++abi: No such file or directory
clang++-17: error: linker command failed with exit code 1 (use -v to see invocation)
Note that the libc++1-* -> libc++abi-* dependency already exists.