diff --git a/docker/Dockerfile.native b/docker/Dockerfile.native deleted file mode 100644 index 0fb62309..00000000 --- a/docker/Dockerfile.native +++ /dev/null @@ -1,123 +0,0 @@ -FROM debian:stretch -RUN echo "deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/20220630T220025Z/ stretch main" > /etc/apt/sources.list -RUN echo "deb-src [check-valid-until=no] http://snapshot.debian.org/archive/debian/20220630T220025Z/ stretch main" >> /etc/apt/sources.list -RUN echo "deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/20220630T220025Z/ stretch-updates main" >> /etc/apt/sources.list -RUN echo "deb-src [check-valid-until=no] http://snapshot.debian.org/archive/debian/20220630T220025Z/ stretch-updates main" >> /etc/apt/sources.list -RUN echo "deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/20220630T220025Z/ stretch-backports main" >> /etc/apt/sources.list -RUN echo "deb-src [check-valid-until=no] http://snapshot.debian.org/archive/debian/20220630T220025Z/ stretch-backports main" >> /etc/apt/sources.list -RUN apt-get update && apt-get -y dist-upgrade && \ - apt-get remove -y libnettle6 libelf1 && \ - apt-get install -y --allow-downgrades zlib1g=1:1.2.8.dfsg-5 && \ - apt-get autoremove -y -RUN apt-get install -y sudo build-essential python wget cmake gdb gawk mlocate \ - vim libc++-dev g++-multilib g++ ninja-build \ - git jq bc python python-colorama zsh \ - python-pexpect python-psutil \ - python-numpy python-argparse python-pip python-dev libpq-dev \ - sudo gdb gawk zlib1g-dev autoconf libtool pkg-config locales \ - genisoimage postgresql-client-9.6 \ - libglib2.0-dev libpixman-1-dev groff-base libdwarf-dev libcapstone-dev wireshark-dev libelf-dev \ - flex bison -ENV release 3.6.2 -ENV llvm_version llvm-${release} - -RUN wget --no-check-certificate https://llvm.org/releases/$release/$llvm_version.src.tar.xz -RUN tar -xJf $llvm_version.src.tar.xz - -RUN mv $llvm_version.src $llvm_version -RUN cd $llvm_version - -WORKDIR /$llvm_version/tools -ENV clang_version cfe-$release -RUN wget --no-check-certificate https://llvm.org/releases/$release/$clang_version.src.tar.xz -RUN tar -xJf $clang_version.src.tar.xz -RUN mv $clang_version.src clang - -WORKDIR /$llvm_version/tools/clang/tools -RUN wget --no-check-certificate https://llvm.org/releases/$release/clang-tools-extra-$release.src.tar.xz -RUN tar -xJf clang-tools-extra-$release.src.tar.xz -RUN mv clang-tools-extra-$release.src extra - -WORKDIR /$llvm_version -#RUN ./configure --enable-optimized --disable-assertions --enable-targets=x86 --enable-shared --enable-pic --host=i486-linux-gnu --build=i486-linux-gnu -RUN mkdir /$llvm_version/build -RUN mkdir /$llvm_version/Release -WORKDIR /$llvm_version/build -RUN cmake ../ -DCMAKE_INSTALL_PREFIX=/$llvm_version/Release -DLLVM_TARGETS_TO_BUILD=X86 \ - -DBUILD_SHARED_LIBS=true -DLLVM_ENABLE_ASSERTIONS=false -DLLVM_ENABLE_RTTI=true \ -#-DLLVM_BUILD_32_BITS=true \ - -DLLVM_ENABLE_PIC=true -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGET_ARCH=i486-linux-gnu \ - -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \ - -G "Ninja" -RUN ninja install - -WORKDIR / -RUN wget http://codesynthesis.com/download/odb/2.4/odb_2.4.0-1_amd64.deb -RUN dpkg -i odb_2.4.0-1_amd64.deb -#RUN wget http://codesynthesis.com/download/odb/2.4/odb-2.4.0.tar.gz -RUN wget http://codesynthesis.com/download/odb/2.4/libodb-2.4.0.tar.gz -RUN tar xf libodb-2.4.0.tar.gz -WORKDIR /libodb-2.4.0 -RUN CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure --enable-shared && make -j $(nproc) && make install -WORKDIR / -RUN wget http://codesynthesis.com/download/odb/2.4/libodb-pgsql-2.4.0.tar.gz -RUN tar xf libodb-pgsql-2.4.0.tar.gz -WORKDIR /libodb-pgsql-2.4.0 -RUN CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure --enable-shared && make -j $(nproc) && make install - -RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local-lib.conf -RUN ldconfig - -RUN pip install --upgrade -v pip -i https://pypi.python.org/simple/ -RUN pip install subprocess32 lockfile sqlalchemy==1.0.14 -i https://pypi.python.org/simple - -RUN pip install pyyaml pycparser psycopg2 -RUN updatedb - -RUN echo "LLVM_DIR=/$llvm_version/Release/share/llvm/cmake" >> /etc/environment -RUN echo "LD_LIBRARY_PATH=/$llvm_version/Release/lib" >> /etc/environment -RUN echo "LIBRARY_PATH=/usr/local/lib" >> /etc/environment -RUN echo "PATH=$PATH:/$llvm_version/Release/bin" >> /etc/environment - -RUN apt-get install -y sudo gdb gawk zlib1g-dev autoconf libtool pkg-config - -# Set locale to C.UTF-8 instead of us_EN.UTF-8 -RUN apt-get install -y locales -RUN locale-gen C.UTF-8 -RUN locale -a -RUN update-locale LANG=C.UTF-8 - -# Install libjsoncpp -WORKDIR / -RUN wget https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.7.4.tar.gz -RUN tar -xzf 1.7.4.tar.gz -WORKDIR jsoncpp-1.7.4 -RUN cmake -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" . && make -j && make install && ldconfig - -# Install protobuf -WORKDIR / -RUN git clone https://github.com/protocolbuffers/protobuf.git -WORKDIR protobuf -RUN git checkout 3.6.x -RUN ./autogen.sh && CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure && make -j $(nproc) && make install && ldconfig -WORKDIR / -RUN wget https://github.com/protobuf-c/protobuf-c/releases/download/v1.3.1/protobuf-c-1.3.1.tar.gz && tar -xzf protobuf-c-1.3.1.tar.gz -WORKDIR protobuf-c-1.3.1 -RUN CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure && make -j $(nproc) && make install && ldconfig - -# Setup PANDA -RUN apt-get install -y libglib2.0-dev libpixman-1-dev groff-base libdwarf-dev libcapstone-dev wireshark-dev libelf-dev flex bison -WORKDIR / -RUN wget https://releases.llvm.org/3.3/llvm-3.3.src.tar.gz -RUN tar -xzf llvm-3.3.src.tar.gz -RUN wget https://releases.llvm.org/3.3/cfe-3.3.src.tar.gz -RUN tar -xzf cfe-3.3.src.tar.gz && mv cfe-3.3.src /llvm-3.3.src/tools/clang -WORKDIR /llvm-3.3.src -RUN CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure --prefix=/llvm-3.3-install && make -j $(nproc) && make install - -# Setting up remote Postgres(host) && PANDA Aux Packages -RUN apt-get install -y genisoimage postgresql-client-9.6 -# pg_hba.conf: -# host all all 172.17.0.1/16 md5 -# postgresql.conf: -# listen_addresses = 'localhost, 172.17.0.1' diff --git a/docker/debug/Dockerfile b/docker/debug/Dockerfile deleted file mode 100644 index a9d4a5a6..00000000 --- a/docker/debug/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM lava32 - -RUN apt-get update -RUN apt-get -y install locales - -RUN echo en_US.UTF-8 UTF-8 | tee /etc/locale.gen -RUN locale-gen - -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US -ENV LC_ALL en_US.utf8 - -RUN apt-get -y install sudo gdb vim emacs exuberant-ctags hexedit - -WORKDIR /$llvm_version -RUN ./configure --disable-optimized --enable-assertions --enable-targets=x86 --enable-shared --enable-pic --host=i486-linux-gnu --build=i486-linux-gnu -RUN REQUIRES_RTTI=1 make -j $(nproc) diff --git a/docker/rebuild-notes b/docker/rebuild-notes deleted file mode 100644 index d493d1e2..00000000 --- a/docker/rebuild-notes +++ /dev/null @@ -1,2 +0,0 @@ -cd docker -docker build . -t lava32 diff --git a/docker/sources.list b/docker/sources.list deleted file mode 100644 index c4c9a64e..00000000 --- a/docker/sources.list +++ /dev/null @@ -1,35 +0,0 @@ -# - -# deb cdrom:[Debian GNU/Linux 7.8.0 _Wheezy_ - Official i386 NETINST Binary-1 20150110-13:31]/ wheezy main - -#deb cdrom:[Debian GNU/Linux 7.8.0 _Wheezy_ - Official i386 NETINST Binary-1 20150110-13:31]/ wheezy main - -# The below repositories are now archived and unavailable -#deb http://ftp.us.debian.org/debian/ wheezy main -#deb-src http://ftp.us.debian.org/debian/ wheezy main -# -#deb http://security.debian.org/ wheezy/updates main -## Line commented out by installer because it failed to verify: -##deb-src http://security.debian.org/ wheezy/updates main -# -## wheezy-updates, previously known as 'volatile' -#deb http://ftp.us.debian.org/debian/ wheezy-updates main -#deb-src http://ftp.us.debian.org/debian/ wheezy-updates main -# -#deb http://ftp.us.debian.org/debian/ wheezy-backports main -#deb-src http://ftp.us.debian.org/debian/ wheezy-backports main - -# Updated snapshot repositories (of all repos above) -deb http://snapshot.debian.org/archive/debian/20211106T025313Z/ wheezy main -deb-src http://snapshot.debian.org/archive/debian/20211106T025313Z/ wheezy main - -deb http://snapshot.debian.org/archive/debian-security/20211106T025313Z/ wheezy/updates main -# Line commented out by installer because it failed to verify: -#deb-src http://snapshot.debian.org/archive/debian-security/20211106T025313Z/ wheezy/updates main - -# wheezy-updates, previously known as 'volatile' -deb http://snapshot.debian.org/archive/debian/20211106T025313Z/ wheezy-updates main -deb-src http://snapshot.debian.org/archive/debian/20211106T025313Z/ wheezy-updates main - -deb http://snapshot.debian.org/archive/debian/20211106T025313Z/ wheezy-backports main -deb-src http://snapshot.debian.org/archive/debian/20211106T025313Z/ wheezy-backports main diff --git a/docs/how-to-lava.md b/docs/how-to-lava.md index 6da33a80..1b4c059a 100644 --- a/docs/how-to-lava.md +++ b/docs/how-to-lava.md @@ -76,7 +76,7 @@ Fortunately, we've created a tool to help with this process- `lavaInitTool`. the preprocessed c files. 2.5.5 In each directory with your source code, run -`/llvm-3.6.2/Release/bin/clang-apply-replacements .` +`/usr/lib/llvm-11/bin/clang-apply-replacements .` 2.5.6 If you search through your code for `={0};` you should see variables that were previously unitialized now being initialized to null. diff --git a/docs/setup.md b/docs/setup.md deleted file mode 100644 index c86c43c8..00000000 --- a/docs/setup.md +++ /dev/null @@ -1,24 +0,0 @@ -# Setup LAVA - -## Ubuntu 64-bit 16.04.4 -The following install steps worked on 6/29/2019 with LAVA commit [c55bf1826ef9855a621f2652b30f16ac75b19cb6](https://github.com/panda-re/lava/commit/c55bf1826ef9855a621f2652b30f16ac75b19cb6). - -- Download and install [Ubuntu 64-bit 16.04.6](http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso) (SHA1 A09607901183AB25C675626024AA402663FA2558, MD5: 5416371CC0E990871746DDAAC89F1A5E). -- `sudo add-apt-repository ppa:phulin/panda` -- `sudo cp /etc/apt/sources.list /etc/apt/sources.list~` -- `sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list` -- `sudo apt-get update` -- `sudo apt-get install python-pip git protobuf-compiler protobuf-c-compiler libprotobuf-c0-dev libprotoc-dev python-protobuf libelf-dev libcapstone-dev libdwarf-dev python-pycparser llvm-3.3 clang-3.3 libc++-dev libwiretap-dev libwireshark-dev odb` -- `sudo apt-get build-dep qemu` -- `pip install colorama` -- `cd ~/Desktop` -- `git clone https://github.com/panda-re/lava.git` -- `cd ~/Desktop/lava` -- `python2 setup.py` - -## Updated - -- build Docker container with `docker/Dockerfile` -- use `scripts/docker-shell.sh` to enter docker container -- inside Docker container, run `python setup_container.py` to build lavaTools -- exit Docker container, and run `python setup_postgres.py` and `init-host.py` diff --git a/scripts/add_queries.sh b/scripts/add_queries.sh index 4e0284be..cfebcc44 100755 --- a/scripts/add_queries.sh +++ b/scripts/add_queries.sh @@ -86,8 +86,8 @@ progress "queries" 0 "Configuring..." mkdir -p lava-install configure_file=${configure_cmd%% *} if [ -e "$configure_file" ]; then - CC=/llvm-3.6.2/Release/bin/clang \ - CXX=/llvm-3.6.2/Release/bin/clang++ \ + CC=/usr/lib/llvm-11/bin/clang \ + CXX=/usr/lib/llvm-11/bin/clang++ \ CFLAGS="-O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/" \ $configure_cmd --prefix=$(pwd)/lava-install fi @@ -103,8 +103,8 @@ for i in ${MAKES[@]}; do IFS=' ' read -ra ARGS <<< $i echo "$lava/tools/btrace/sw-btrace ${ARGS[@]}" - CC=/llvm-3.6.2/Release/bin/clang \ - CXX=/llvm-3.6.2/Release/bin/clang++ \ + CC=/usr/lib/llvm-11/bin/clang \ + CXX=/usr/lib/llvm-11/bin/clang++ \ CFLAGS="-O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/" \ $lava/tools/btrace/sw-btrace ${ARGS[@]} IFS='&&' @@ -116,14 +116,10 @@ progress "queries" 0 "Installing..." bash -c $install -# figure out where llvm is -llvm_src=$(grep LLVM_SRC_PATH $lava/tools/lavaTool/config.mak | cut -d' ' -f3) - - progress "queries" 0 "Creating compile_commands.json..." # Delete any pre-existing compile commands.json (could be in archive by mistake) rm -f compile_commands.json -$lava/tools/btrace/sw-btrace-to-compiledb $llvm_src/Release/lib/clang/3.6.2/include +$lava/tools/btrace/sw-btrace-to-compiledb /usr/lib/llvm-11/lib/clang/11/include if [ -e "$directory/$name/extra_compile_commands.json" ]; then sed -i '$d' compile_commands.json echo "," >> compile_commands.json diff --git a/scripts/competition.py b/scripts/competition.py index ea86b34f..7f5fa767 100755 --- a/scripts/competition.py +++ b/scripts/competition.py @@ -395,7 +395,7 @@ def main(): # ' '.join([ # 'gcc', '-E', '-std=gnu99', # '-I.', '-I..', - # '-I/llvm-3.6.2/Release/lib/clang/3.6.2/include', + # '-I/usr/lib/llvm-11/lib/clang/11/include', # '-o', # '{}.pre'.format(c_file), # c_file])) diff --git a/scripts/get-clang.sh b/scripts/get-clang.sh deleted file mode 100755 index 3b980a5a..00000000 --- a/scripts/get-clang.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -#release="3.8.0" -release="3.6.2" -llvm_version="llvm-$release" - -wget http://llvm.org/releases/$release/$llvm_version.src.tar.xz -tar -xJf $llvm_version.src.tar.xz - -mv $llvm_version.src $llvm_version -cd $llvm_version - -pushd tools - -clang_version="cfe-$release" -wget http://llvm.org/releases/$release/$clang_version.src.tar.xz -tar -xJf $clang_version.src.tar.xz -mv $clang_version.src clang - -pushd clang/tools -wget http://llvm.org/releases/$release/clang-tools-extra-$release.src.tar.xz -tar -xJf clang-tools-extra-$release.src.tar.xz -mv clang-tools-extra-$release.src extra -popd - -popd - -./configure --enable-optimized --disable-assertions --enable-targets=x86,arm --enable-shared --enable-pic --host=$(gcc -dumpmachine) --build=$(gcc -dumpmachine) -REQUIRES_RTTI=1 make -j $(nproc) diff --git a/scripts/lava.py b/scripts/lava.py index 6ff10b26..7c395ed2 100644 --- a/scripts/lava.py +++ b/scripts/lava.py @@ -699,8 +699,8 @@ def run(args, **kwargs): and 'configure' in project.keys(): print('Re-configuring...') run(shlex.split(project['configure']) + ['--prefix=' + lp.bugs_install]) - envv = {'CC': '/llvm-3.6.2/Release/bin/clang', - 'CXX': '/llvm-3.6.2/Release/bin/clang++', + envv = {'CC': '/usr/lib/llvm-11/bin/clang', + 'CXX': '/usr/lib/llvm-11/bin/clang++', 'CFLAGS': '-O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/'} if project['configure']: run_cmd(' '.join(shlex.split(project['configure']) + ['--prefix=' + lp.bugs_install]), @@ -714,8 +714,8 @@ def run(args, **kwargs): # Silence warnings related to adding integers to pointers since we already # know that it's unsafe. - envv = {'CC': '/llvm-3.6.2/Release/bin/clang', - 'CXX': '/llvm-3.6.2/Release/bin/clang++', + envv = {'CC': '/usr/lib/llvm-11/bin/clang', + 'CXX': '/usr/lib/llvm-11/bin/clang++', 'CFLAGS': '-Wno-int-conversion -O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/'} if competition: envv["CFLAGS"] += " -DLAVA_LOGGING" @@ -736,21 +736,10 @@ def run(args, **kwargs): except Exception: # arg_dataflow missing from args which is okay pass - llvm_src = None - # find llvm_src dir so we can figure out where clang #includes are for btrace - config_mak = join(lp.lava_dir, 'tools', 'lavaTool', 'config.mak') - print("config.mak = [%s]" % config_mak) - for line in open(config_mak): - llvm_regex_match = re.search("LLVM_SRC_PATH := (.*)$", line) - if llvm_regex_match: - llvm_src = llvm_regex_match.groups()[0] - break - assert llvm_src is not None - print("llvm_src = [%s]" % llvm_src) - + if not os.path.exists(join(lp.bugs_build, 'compile_commands.json')): run([join(lp.lava_dir, 'tools', 'btrace', 'sw-btrace-to-compiledb'), - llvm_src + "/Release/lib/clang/3.6.2/include"]) + "/usr/lib/llvm-11/lib/clang/11/include"]) # also insert instr for main() fn in all files that need it process_compile_commands( @@ -905,8 +894,8 @@ def modify_source(dirname): # Silence warnings related to adding integers to pointers since we already # know that it's unsafe. make_cmd = project["make"] - envv = {'CC': '/llvm-3.6.2/Release/bin/clang', - 'CXX': '/llvm-3.6.2/Release/bin/clang++', + envv = {'CC': '/usr/lib/llvm-11/bin/clang', + 'CXX': '/usr/lib/llvm-11/bin/clang++', 'CFLAGS': '-Wno-int-conversion -O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/'} if competition: envv["CFLAGS"] += " -DLAVA_LOGGING" diff --git a/scripts/lava.sh b/scripts/lava.sh index 8ff12db0..d8508db5 100755 --- a/scripts/lava.sh +++ b/scripts/lava.sh @@ -183,7 +183,7 @@ if [ $make -eq 1 ]; then progress "everything" 1 "Make step -- making 32-bit version with queries" lf="$logs/make.log" truncate "$lf" - run_remote "$buildhost" "cd $sourcedir && CC=/llvm-3.6.2/Release/bin/clang CXX=/llvm-3.6.2/Release/bin/clang++ CFLAGS='-O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/' $makecmd" "$lf" + run_remote "$buildhost" "cd $sourcedir && CC=/usr/lib/llvm-11/bin/clang CXX=/usr/lib/llvm-11/bin/clang++ CFLAGS='-O0 -m32 -DHAVE_CONFIG_H -g -gdwarf-2 -fno-stack-protector -D_FORTIFY_SOURCE=0 -I. -I.. -I../include -I./src/' $makecmd" "$lf" run_remote "$buildhost" "cd $sourcedir && rm -rf lava-install" "$lf" if [ "$install_simple" == "null" ]; then diff --git a/scripts/shell.sh b/scripts/shell.sh index bfa9d271..ae92ef29 100755 --- a/scripts/shell.sh +++ b/scripts/shell.sh @@ -36,5 +36,5 @@ docker run --rm -it \ -v /home:/home:ro \ --add-host=database:172.17.0.1 \ $docker_map_args \ - $1 sh -c "trap '' PIPE; su -l $(whoami) -c \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/llvm-3.6.2/Release/lib; $command\"" \ - #$1 sh -c "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/llvm-3.6.2/Release/lib; bash" \ + $1 sh -c "trap '' PIPE; su -l $(whoami) -c \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/llvm-11/lib; $command\"" \ + diff --git a/setup_container.py b/setup_container.py index 2c7d268c..217c899f 100644 --- a/setup_container.py +++ b/setup_container.py @@ -7,20 +7,10 @@ from colorama import Style -LLVM_VERSION = "11" - LAVA_DIR = os.path.dirname(os.path.abspath(sys.argv[0])) os.chdir(LAVA_DIR) -LLVM_MAK = """ -# This is an autogenerated file from lava/setup.py. -LLVM_SRC_PATH := {LLVM_SRC_PATH} -LLVM_BUILD_PATH := {LLVM_BUILD_PATH} -LLVM_BIN_PATH := $(LLVM_BUILD_PATH)/bin -""" - - def progress(msg): print('') # PANDA_UBUNTU = "https://goo.gl/GNMNmJ" @@ -55,13 +45,7 @@ def run(cmd): run(['bash', '-c', subprocess.list2cmdline(compile_cmd)]) # Compile lavaTool inside the docker container. progress("Creating $LAVA_DIR/tools/lavaTool/config.mak") - with open("tools/lavaTool/config.mak", "w") as f: - #LLVM_DOCKER_DIR = '/llvm-{}'.format(LLVM_VERSION) - LLVM_DOCKER_DIR = subprocess.check_output(["llvm-config-{}".format(LLVM_VERSION), "--prefix"]) - if sys.version_info[0] == 3: - LLVM_DOCKER_DIR = LLVM_DOCKER_DIR.decode('latin-1') - f.write(LLVM_MAK.format(LLVM_BUILD_PATH=LLVM_DOCKER_DIR, - LLVM_SRC_PATH=LLVM_DOCKER_DIR)) + run(['rm', '-rf', os.path.join(LAVA_DIR, 'tools/build')]) run(['mkdir', '-p', os.path.join(LAVA_DIR, 'tools/build')]) run(['mkdir', '-p', os.path.join(LAVA_DIR, 'tools/install')]) @@ -81,12 +65,6 @@ def run(cmd): # then setup.py will parse it and configure the environmet to those specs os.chdir(LAVA_DIR) - if not os.path.isfile(os.path.join(LAVA_DIR, "lava.mak")): - progress("Creating $LAVA_DIR/lava.mak") - with open("lava.mak", 'w') as f: - f.write(LLVM_MAK.format(LLVM_BUILD_PATH=LLVM_DOCKER_DIR, - LLVM_SRC_PATH=LLVM_DOCKER_DIR)) - # ----------------End .mak file stuff --------------------- progress("Making each component of lava, fbi and lavaTool") progress("Compiling fbi") diff --git a/tools/lavaTool/compile-on-docker.sh b/tools/lavaTool/compile-on-docker.sh deleted file mode 100755 index c8326f5c..00000000 --- a/tools/lavaTool/compile-on-docker.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -x - -lava="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")" -llvm_home="/llvm-3.6.2" - -docker run --rm -it \ - -e "HTTP_PROXY=$HTTP_PROXY" \ - -e "HTTPS_PROXY=$HTTPS_PROXY" \ - -e "http_proxy=$http_proxy" \ - -e "https_proxy=$https_proxy" \ - -e "LLVM_DIR=$llvm_home" \ - -v /var/run/postgresql:/var/run/postgresql \ - -v /etc/passwd:/etc/passwd:ro \ - -v /etc/group:/etc/group:ro \ - -v /etc/shadow:/etc/shadow:ro \ - -v /etc/gshadow:/etc/gshadow:ro \ - -v $HOME:$HOME \ - -v "$lava":"$lava" \ - lava32 sh -c "trap '' PIPE; su -l $(whoami) -c 'cmake -B$lava/build -H$lava -DCMAKE_INSTALL_PREFIX=$lava/install' && su -l $(whoami) -c 'make --no-print-directory -j$(nproc) -C \"$lava\"/build/lavaTool install'" - -#For debug builds- add -DCMAKE_BUILD_TYPE=RelWithDebInfo to the above command diff --git a/tools/lavaTool/test-compile-on-docker.sh b/tools/lavaTool/test-compile-on-docker.sh deleted file mode 100755 index 9da41d1b..00000000 --- a/tools/lavaTool/test-compile-on-docker.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -x - -lava="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")" -llvm_home="/llvm-3.6.2" - -# Start host_fninstr.sh, a watchdog that runs fninstr.sh on the host as necessary -# Argument = number of targets to rebuild -NUM_TARGETS="3" -$lava/lavaTool/tests/host_fninstr.sh "$lava/lavaTool/tests" $NUM_TARGETS &> $lava/lavaTool/tests/log_hostfninstr.txt & -PID="$!" -echo "Started host_fninstr with pid=$PID" - -docker run --rm -it \ - -e "HTTP_PROXY=$HTTP_PROXY" \ - -e "HTTPS_PROXY=$HTTPS_PROXY" \ - -e "http_proxy=$http_proxy" \ - -e "https_proxy=$https_proxy" \ - -e "LLVM_DIR=$llvm_home" \ - -e "PATH=$PATH:/llvm-3.6.2/Release/bin" \ - -v /var/run/postgresql:/var/run/postgresql \ - -v /etc/passwd:/etc/passwd:ro \ - -v /etc/group:/etc/group:ro \ - -v /etc/shadow:/etc/shadow:ro \ - -v /etc/gshadow:/etc/gshadow:ro \ - -v $HOME:$HOME \ - -v "$lava":"$lava" \ - lava32 sh -c "trap '' PIPE; su -l $(whoami) -c 'cmake -B$lava/build -H$lava -DCMAKE_INSTALL_PREFIX=$lava/install' && su -l $(whoami) -c 'make -j$(nproc) -C \"$lava\"/build/lavaTool install && $lava/lavaTool/tests/run.sh \"$lava\"'" - #lava32 sh -c "trap '' PIPE; su -l $(whoami) -c 'make -j$(nproc) -C \"$lava\"/src_clang && $lava/src_clang/_tests/run.sh \"$lava\"'" - -kill $PID 2>/dev/null # Kill host_fninstr.sh diff --git a/tools/lavaTool/tests/run.sh b/tools/lavaTool/tests/run.sh index ab888d6d..8255e807 100755 --- a/tools/lavaTool/tests/run.sh +++ b/tools/lavaTool/tests/run.sh @@ -34,7 +34,7 @@ runtest() { ../../../install/bin/lavaTool -debug -lava-wl ./$1.fnwl -arg_dataflow -src-prefix=`pwd` -action=inject $1.c &> lavaTool.log cp $1.c{,.bak} - /llvm-3.6.2/Release/bin/clang-apply-replacements . + /usr/lib/llvm-11/bin/clang-apply-replacements . make clean make &> cc.log