Skip to content

Commit

Permalink
Updated all scripts to point to LLVM-11, also removed config.mak
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Jul 11, 2024
1 parent 50898ef commit 16e7d93
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 342 deletions.
123 changes: 0 additions & 123 deletions docker/Dockerfile.native

This file was deleted.

17 changes: 0 additions & 17 deletions docker/debug/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions docker/rebuild-notes

This file was deleted.

35 changes: 0 additions & 35 deletions docker/sources.list

This file was deleted.

2 changes: 1 addition & 1 deletion docs/how-to-lava.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 0 additions & 24 deletions docs/setup.md

This file was deleted.

14 changes: 5 additions & 9 deletions scripts/add_queries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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='&&'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/competition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down
29 changes: 0 additions & 29 deletions scripts/get-clang.sh

This file was deleted.

27 changes: 8 additions & 19 deletions scripts/lava.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand All @@ -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"
Expand All @@ -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(
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion scripts/lava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"" \

Loading

0 comments on commit 16e7d93

Please sign in to comment.