Get static build back

This commit is contained in:
David Gonzalez Martin 2024-07-24 08:38:26 +02:00
parent 65efa48df4
commit a43dcda407
4 changed files with 487 additions and 411 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,19 +6,17 @@ function compile()
exe_name=$2
debug_info=$3
optimizations=$4
static=0
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
darwin*) compile_command="$compile_command -DDEMAND_LIBC=1";;
# linux*) compile_command="$compile_command -ffreestanding -nostdlib -static bootstrap/entry.S -DDEMAND_LIBC=0" ;;
linux*) compile_command="$compile_command -DDEMAND_LIBC=1" ;;
*) echo "Unknown operating system $OSTYPE: no specific flags were added" ;;
esac
if [ "$static" == "1" ]
then
compile_command="$compile_command -ffreestanding -nostdlib -static -DSTATIC"
fi
compile_command="$compile_command bootstrap/main.c"
echo -e "\x1b[36m$compile_command\x1b[0m"
eval "time $compile_command"
}

View File

@ -17,6 +17,6 @@ compile $build_dir $exe_name $debug_flags $optimization_flags
case "$OSTYPE" in
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" ;;
esac

View File

@ -6,10 +6,11 @@ build_dir="build"
exe_name="nest"
exe_path=$build_dir/$exe_name
debug_flags="-g"
optimization_flags=""
no_optimization_flags=""
optimization_flags="-O3 -march=native"
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 "TESTS"