diff --git a/testing/clang/README b/testing/clang/README new file mode 100644 index 00000000..ddef9fb9 --- /dev/null +++ b/testing/clang/README @@ -0,0 +1,68 @@ +clang +________________________________________________________________________________ + +Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ +programming languages, as well as the OpenMP, OpenCL, RenderScript, CUDA and +HIP frameworks. It uses the LLVM compiler infrastructure as its back end and has +been part of the LLVM release cycle since LLVM 2.6. + +It is designed to act as a drop-in replacement for the GNU Compiler Collection +(GCC), supporting most of its compilation flags and unofficial language +extensions. Its contributors include Apple, Microsoft, Google, ARM, Sony, +Intel and Advanced Micro Devices (AMD). [0] + +Upstream: https://clang.llvm.org/ + + +[000] Index +________________________________________________________________________________ + +* Installation ........................................................... [001] +* Setup .................................................................. [002] +* Usage .................................................................. [003] +* Troubleshooting ........................................................ [004] +* References ............................................................. [005] + + +[001] Installation +________________________________________________________________________________ + ++------------------------------------------------------------------------------+ +| | +| $ kiss b clang | +| | ++------------------------------------------------------------------------------+ + + +[002] Setup +________________________________________________________________________________ + +To use clang as the system compiler, set the following environment variables in +your .profile or shell runtime configuration file. + ++------------------------------------------------------------------------------+ +| | +| $ export CC=clang | +| $ export CXX=clang++ | +| | ++------------------------------------------------------------------------------+ + + +[003] Usage +________________________________________________________________________________ + +Refer to the command help output. This package does not yet provide manual +pages. Documentation can also be found online. + + +[004] Troubleshooting +________________________________________________________________________________ + +If a package fails to build with clang, open an issue at $/kisslinux/repo + + +[005] References +________________________________________________________________________________ + +[0] https://en.wikipedia.org/wiki/Clang + diff --git a/testing/clang/build b/testing/clang/build new file mode 100755 index 00000000..d8b7cd09 --- /dev/null +++ b/testing/clang/build @@ -0,0 +1,34 @@ +#!/bin/sh -e + +export DESTDIR="$1" + +cd clang +cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_EH=ON \ + -DLLVM_ENABLE_LIBXML2=OFF \ + -DCLANG_BUILD_EXAMPLES=OFF \ + -DCLANG_INCLUDE_DOCS=OFF \ + -DCLANG_INCLUDE_TESTS=OFF \ + -DLIBCLANG_BUILD_STATIC=ON \ + -Wno-dev + +cmake --build build +cmake --install build + +# Fix up libexec location. This can't be done during +# the configure stage of the build as it is hardcoded. +{ + mv -f \ + "$1/usr/libexec/"*analyze* \ + "$1/usr/libexec/"*intercept* \ + "$1/usr/lib/clang" + + rmdir "$1/usr/libexec" + + sed 's|libexec|lib/clang|' "$1/usr/bin/scan-build" > _ + mv -f _ "$1/usr/bin/scan-build" + chmod +x "$1/usr/bin/scan-build" +} diff --git a/testing/clang/checksums b/testing/clang/checksums new file mode 100644 index 00000000..b85a5ac2 --- /dev/null +++ b/testing/clang/checksums @@ -0,0 +1,2 @@ +d4ca2b1fe727cd98f8bf17b90533e80fde90637162245c6e4ed0fd6669cb293dd0 +40a6c658591f26fe23ad5e5b3e6645eea2476e31b9adbcce139949ee17f17b1dea diff --git a/testing/clang/depends b/testing/clang/depends new file mode 100644 index 00000000..7a0f0b0e --- /dev/null +++ b/testing/clang/depends @@ -0,0 +1,5 @@ +cmake make +llvm +python make +xz +zlib diff --git a/testing/clang/sources b/testing/clang/sources new file mode 100644 index 00000000..675532fa --- /dev/null +++ b/testing/clang/sources @@ -0,0 +1,2 @@ +https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.3/clang-16.0.3.src.tar.xz clang +https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.3/cmake-16.0.3.src.tar.xz cmake diff --git a/testing/clang/version b/testing/clang/version new file mode 100644 index 00000000..63f837a6 --- /dev/null +++ b/testing/clang/version @@ -0,0 +1 @@ +16.0.3 1