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 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"
} }

View File

@ -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

View File

@ -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"