Get static build back
This commit is contained in:
parent
65efa48df4
commit
a43dcda407
877
bootstrap/main.c
877
bootstrap/main.c
File diff suppressed because it is too large
Load Diff
14
compile.sh
14
compile.sh
@ -6,19 +6,17 @@ function compile()
|
|||||||
exe_name=$2
|
exe_name=$2
|
||||||
debug_info=$3
|
debug_info=$3
|
||||||
optimizations=$4
|
optimizations=$4
|
||||||
|
static=0
|
||||||
|
|
||||||
mkdir -p $build_dir
|
mkdir -p $build_dir
|
||||||
|
|
||||||
compile_command="clang -o $build_dir/$exe_name $debug_info $optimizations -std=gnu2x -Wall -Wextra -Wpedantic -Wno-nested-anon-types -Wno-keyword-macro -Wno-gnu-auto-type -Wno-auto-decl-extensions -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json"
|
compile_command="clang bootstrap/main.c -o $build_dir/$exe_name $debug_info $optimizations -std=gnu2x -Wall -Wextra -Wpedantic -Wno-nested-anon-types -Wno-keyword-macro -Wno-gnu-auto-type -Wno-auto-decl-extensions -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json"
|
||||||
|
|
||||||
case "$OSTYPE" in
|
if [ "$static" == "1" ]
|
||||||
darwin*) compile_command="$compile_command -DDEMAND_LIBC=1";;
|
then
|
||||||
# linux*) compile_command="$compile_command -ffreestanding -nostdlib -static bootstrap/entry.S -DDEMAND_LIBC=0" ;;
|
compile_command="$compile_command -ffreestanding -nostdlib -static -DSTATIC"
|
||||||
linux*) compile_command="$compile_command -DDEMAND_LIBC=1" ;;
|
fi
|
||||||
*) echo "Unknown operating system $OSTYPE: no specific flags were added" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
compile_command="$compile_command bootstrap/main.c"
|
|
||||||
echo -e "\x1b[36m$compile_command\x1b[0m"
|
echo -e "\x1b[36m$compile_command\x1b[0m"
|
||||||
eval "time $compile_command"
|
eval "time $compile_command"
|
||||||
}
|
}
|
||||||
|
2
debug.sh
2
debug.sh
@ -17,6 +17,6 @@ compile $build_dir $exe_name $debug_flags $optimization_flags
|
|||||||
|
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
darwin*) lldb -- $exe_path $bootstrap_args;;
|
darwin*) lldb -- $exe_path $bootstrap_args;;
|
||||||
linux*) gf2 -ex r --args $exe_path $bootstrap_args;;
|
linux*) gf2 -ex b entry_point -ex r --args $exe_path $bootstrap_args;;
|
||||||
*) echo "unknown: $OSTYPE" ;;
|
*) echo "unknown: $OSTYPE" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -6,10 +6,11 @@ build_dir="build"
|
|||||||
exe_name="nest"
|
exe_name="nest"
|
||||||
exe_path=$build_dir/$exe_name
|
exe_path=$build_dir/$exe_name
|
||||||
debug_flags="-g"
|
debug_flags="-g"
|
||||||
optimization_flags=""
|
no_optimization_flags=""
|
||||||
|
optimization_flags="-O3 -march=native"
|
||||||
test_names="first"
|
test_names="first"
|
||||||
|
|
||||||
compile $build_dir $exe_name $debug_flags $optimization_flags;
|
compile $build_dir $exe_name $debug_flags $no_optimization_flags;
|
||||||
|
|
||||||
printf "\n======================\n"
|
printf "\n======================\n"
|
||||||
printf "TESTS"
|
printf "TESTS"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user