From 29bec3847866b7193413c6516198f3cdebff4e00 Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 31 May 2022 22:27:24 +0100 Subject: made build profile by default use march=native --- xi_profile.sh | 8 ++++---- xibuild.sh | 14 +++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/xi_profile.sh b/xi_profile.sh index 93be8f6..aa0445a 100644 --- a/xi_profile.sh +++ b/xi_profile.sh @@ -1,13 +1,13 @@ -#export CC="clang" -#export CXX="clang++" -#export LD="clang" + +# local xibuild profile +# tune these preferences to suite local builds export JOBS=$(grep "processor" /proc/cpuinfo | wc -l) export MAKEFLAGS=-j$JOBS export SAMUFLAGS=-j$JOBS export CARGO_BUILD_JOBS=$JOBS -export CFLAGS="-pipe -Os -fomit-frame-pointer" +export CFLAGS="-pipe -O2 -march=native" export CXXFLAGS="$CFLAGS" export CPPFLAGS="$CFLAGS" export LDFLAGS="-Wl,--as-needed,-O1,--sort-common" diff --git a/xibuild.sh b/xibuild.sh index 65a34f4..118841c 100644 --- a/xibuild.sh +++ b/xibuild.sh @@ -14,6 +14,7 @@ build_dir="$xibuild_dir/build" export_dir="$xibuild_dir/build/xipkg" doinstall=false +dostrip=true doclean=false checkopt="" @@ -49,6 +50,8 @@ ${BLUE}Avaiable Options: ${LIGHT_CYAN}clean: clean the out directory after building and installing ${BLUE}-n ${LIGHT_CYAN}nocheck: skip running the step stage of building + ${BLUE}-s + ${LIGHT_CYAN}nostrip: do not strip debugging symbols from binary ${BLUE}Available Commands: ${LIGHT_GREEN}prepare @@ -199,7 +202,7 @@ xibuild_sign () { info_file=$xipkg.info { printf "SIGNATURE=" - openssl dgst -sign $key_file $xipkg | base64 | tr '\n' ' ':w + openssl dgst -sign $key_file $xipkg | base64 | tr '\n' ' ' printf "\n" } >> $info_file done @@ -219,7 +222,7 @@ xibuild_clean () { rm $out_dir/build.log } -while getopts ":r:l:C:k:p:b:d:vcinh" opt; do +while getopts ":r:l:C:k:p:b:d:vcinsh" opt; do case "${opt}" in r) root=$(realpath ${OPTARG});; @@ -243,6 +246,8 @@ while getopts ":r:l:C:k:p:b:d:vcinh" opt; do doclean=true;; n) checkopt="-n";; + s) + dostrip=false;; h) usage; exit 0;; esac @@ -250,7 +255,10 @@ done shift $((OPTIND-1)) -tasks="prepare fetch build strip package describe" + +tasks="prepare fetch build" +$dostrip && tasks="$tasks strip" +tasks="$tasks package describe" [ "$key_file" ] && tasks="$tasks sign" -- cgit v1.2.1