diff options
author | Martin Nowack <m.nowack@imperial.ac.uk> | 2023-02-23 22:01:12 +0000 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2023-03-17 22:38:16 +0000 |
commit | ca60811f5d55254bec378919430dd0e7e6e5cdd1 (patch) | |
tree | dbd4f7a78929eb959e26755c22e5157808a09862 /scripts/build/p-clang-linux-ubuntu.inc | |
parent | dd492f8763f13312c17eb67af33e3e90217a30e1 (diff) | |
download | klee-ca60811f5d55254bec378919430dd0e7e6e5cdd1.tar.gz |
Update build scripts
* Support for Ubuntu 22.04 * Remove support for Python2 * Better separation between sanitizer builds and non-sanitizer builds * Fix build of metaSMT on newer Ubuntu versions * Use ninja to build LLVM * Simplifying building arbitrary LLVM configurations, e.g. different LLVM sanitizer builds (MemSan, UBSan, ASan) * Use MemSan with origin tracking * Build sqlite3 container correctly * Add support to provide sqlite3 version number
Diffstat (limited to 'scripts/build/p-clang-linux-ubuntu.inc')
-rw-r--r-- | scripts/build/p-clang-linux-ubuntu.inc | 69 |
1 files changed, 44 insertions, 25 deletions
diff --git a/scripts/build/p-clang-linux-ubuntu.inc b/scripts/build/p-clang-linux-ubuntu.inc index 286246ca..85f02c14 100644 --- a/scripts/build/p-clang-linux-ubuntu.inc +++ b/scripts/build/p-clang-linux-ubuntu.inc @@ -3,40 +3,59 @@ install_binary_artifact_clang() { local version="-${LLVM_VERSION_MAJOR}" source "${DIR}/common-functions" + with_sudo apt-get update -y + + # Check if package in standard repository otherwise use upstream + if ! apt-cache show "llvm${version}"; then + if [[ -z "$(which wget)" ]]; then + # Add certificate + with_sudo apt-get update -y + dependencies=( + ca-certificates + wget + lsb-release + gnupg + ) + with_sudo apt-get -y --no-install-recommends install "${dependencies[@]}" + fi - # Add certificate - with_sudo apt update -y - dependencies=( - ca-certificates - wget - lsb-release - gnupg - ) - with_sudo apt -y --no-install-recommends install "${dependencies[@]}" - - # Add LLVM upstream repository if available - codename="$(lsb_release --codename --short)" - if wget -q "https://apt.llvm.org/${codename}/dists/llvm-toolchain-${codename}${version}/"; then - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| with_sudo apt-key add - - - apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main" - if ! grep -rq "${apt_entry}" /etc/apt; then - echo "${apt_entry}" | with_sudo tee -a /etc/apt/sources.list - with_sudo apt update -y + # Add LLVM upstream repository if available + codename="$(lsb_release --codename --short)" + if wget -q "https://apt.llvm.org/${codename}/dists/llvm-toolchain-${codename}${version}/"; then + apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main" + if ! grep -rq "${apt_entry}" /etc/apt; then + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| with_sudo apt-key add - + echo "${apt_entry}" | with_sudo tee -a /etc/apt/sources.list + with_sudo apt-get update -y + fi fi fi - - with_sudo apt update -y dependencies=( "llvm${version}" "clang${version}" ) #Install essential dependencies - with_sudo apt -y --no-install-recommends install "${dependencies[@]}" || return 1 + with_sudo apt-get -y --no-install-recommends install "${dependencies[@]}" || return 1 } -get_docker_config_id_clang() { - return 0 -} +setup_artifact_variables_clang() { + local LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}" + local version="-${LLVM_VERSION_MAJOR}" + + # Only set LLVM_CONFIG if not set yet + if [[ -z "${LLVM_CONFIG:-}" ]]; then + LLVM_CONFIG=$(which "llvm-config${version}") + fi + + local bin_path="" + bin_path=$(which "clang${version}") + [[ -z "${bin_path}" ]] && return 1 + + bin_path="$(dirname "$(readlink -f "${bin_path}")")" + [[ -z "${bin_path}" ]] && return 1 + + BITCODE_CC="${bin_path}/clang" + BITCODE_CXX="${bin_path}/clang++" +} \ No newline at end of file |