From dbda156217c532a7e1a65e8c216e593a64c0b8fc Mon Sep 17 00:00:00 2001 From: Martin Nowack <m.nowack@imperial.ac.uk> Date: Thu, 23 Jan 2020 15:25:45 +0000 Subject: Update ubuntu build dependencies for KLEE Build dependencies for different components were tied to a specific Ubuntu version (16.04). Although, they are the same for newer versions as well. By renaming `p-component-linux-ubuntu-16.04.inc` to `p-component-linux-ubuntu.inc`, the script can be used for newer Ubuntu versions as well. Do some minor cleaning up. --- scripts/build/p-clang-linux-ubuntu.inc | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/build/p-clang-linux-ubuntu.inc (limited to 'scripts/build/p-clang-linux-ubuntu.inc') diff --git a/scripts/build/p-clang-linux-ubuntu.inc b/scripts/build/p-clang-linux-ubuntu.inc new file mode 100644 index 00000000..b3159d3c --- /dev/null +++ b/scripts/build/p-clang-linux-ubuntu.inc @@ -0,0 +1,44 @@ +install_binary_artifact_clang() { + local LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}" + local LLVM_VERSION_MINOR="${LLVM_VERSION/*./}" + + local version="" + [[ "${LLVM_VERSION_MAJOR}" -le 6 ]] && version="-${LLVM_VERSION}" + [[ "${LLVM_VERSION_MAJOR}" -ge 7 ]] && version="-${LLVM_VERSION_MAJOR}" + + # apt.llvm packages for Trusty clang 5.0 package is broken with atomics. Don't use it. + if [[ "${LLVM_VERSION_MAJOR}" -gt 6 ]]; then + # Add certificate + apt update -y + dependencies=( + ca-certificates + wget + lsb-release + gnupg + ) + + apt -y --no-install-recommends install "${dependencies[@]}" + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - + + # Add repository + codename="$(lsb_release --codename --short)" + apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main" + if [[ ! $(grep -q "${apt_entry}") ]]; then + echo "${apt_entry}" >> /etc/apt/sources.list + apt update -y + fi + fi + + apt update -y + dependencies=( + "llvm${version}" + "clang${version}" + ) + + #Install essential dependencies + apt -y --no-install-recommends install "${dependencies[@]}" || return 1 +} + +get_docker_config_id_clang() { + return 0 +} -- cgit 1.4.1