Browse Source

Improve Dragora performance

Since Dragora's current build is not embedded, it does not make much sense to
optimize for size.  Instead, we optimize for performance.

Signed-off-by: Matías Fonzo <selk@dragora.org>
master
Matías Fonzo 11 months ago
parent
commit
716b527859
No known key found for this signature in database GPG Key ID: 3AAF1CEC203A99D5
  1. 89
      bootstrap
  2. 15
      darkcrusade
  3. 8
      recipes/compressors/plzip/recipe
  4. 8
      recipes/libs/lzlib/recipe
  5. 6
      recipes/tools/tarlz/recipe
  6. 12
      stages/1/16-qi

89
bootstrap

@ -34,49 +34,50 @@ CWD="$(CDPATH='' cd -P -- "$(dirname -- "$0")" && pwd -P)" || exit $?
### Functions
usage() {
printf '%s\n' \
"Builder of custom stages (cross compilers, GNU/Linux distributions)" \
"" \
"Usage: $PROGRAM [OPTION...] [FILE]..." \
"" \
"Defaults for the options are specified in brackets." \
"" \
"Options:" \
" -a Target architecture [${arch}]" \
" -j Parallel jobs for the compiler [${jobs}]" \
" -k Keep (don't delete) source directory" \
" -o Output directory [${output}]" \
" -s Stage number to build [${stage}]" \
" -h Display this help and exit" \
" -V Print version information and exit" \
"" \
"Some influential environment variables:" \
" TMPDIR Temporary directory for sources [${TMPDIR}]" \
" BTCC C compiler command [${BTCC}]" \
" BTCXX C++ compiler command [${BTCXX}]" \
" BTCFLAGS C compiler flags [${BTCFLAGS}]" \
" BTCXXFLAGS C++ compiler flags [${BTCXXFLAGS}]" \
" BTLDFLAGS Linker flags [${BTLDFLAGS}]" \
" VENDOR Vendor name to reflect on the target triplet" \
"" \
"Targets from ${CWD}/targets/ ..."
for name in "${CWD}/targets"/*
do
sed -e '2q;d' "$name"
done
unset name
echo ""
usage()
{
printf '%s' \
"Usage: $PROGRAM [OPTIONS] [FILE]...
Builder of custom stages (cross compilers, GNU/Linux distributions).
Defaults for the options are specified in brackets.
Options:
-a Target architecture [${arch}]
-j Parallel jobs for the compiler [${jobs}]
-k Keep (don't delete) source directory
-o Output directory [${output}]
-s Stage number to build [${stage}]
-h Display this help and exit
-V Print version information and exit
Some influential environment variables:
TMPDIR Temporary directory for sources [${TMPDIR}]
BTCC C compiler command [${BTCC}]
BTCXX C++ compiler command [${BTCXX}]
BTCFLAGS C compiler flags [${BTCFLAGS}]
BTCXXFLAGS C++ compiler flags [${BTCXXFLAGS}]
BTLDFLAGS Linker flags [${BTLDFLAGS}]
VENDOR Vendor name to reflect on the target triplet
Targets from ${CWD}/targets/ ..."
for name in "${CWD}/targets"/*
do
sed -e '2q;d' "$name"
done
unset -v name
echo ""
}
version()
{
printf '%s\n' \
"$PROGRAM 3.23" \
"Copyright (C) 2014-2020 Matias Andres Fonzo." \
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>" \
"This is free software: you are free to change and redistribute it." \
"There is NO WARRANTY, to the extent permitted by law."
printf '%s' \
"$PROGRAM 3.24
Copyright (C) 2014-2020 Matias Andres Fonzo.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
"
}
warn()
@ -94,7 +95,7 @@ chkstatus_or_exit()
exit "${1-2}"; # If not given, defaults to 2
fi
unset status
unset -v status
}
# Function to test and extract compressed files
@ -163,7 +164,7 @@ unpack()
exit 1
esac
done
unset file
unset -v file
}
# Print a warning for good practices.
@ -187,8 +188,8 @@ warn_flags()
BTCC="${BTCC:=cc}"
BTCXX="${BTCXX:=c++}"
BTCFLAGS="${BTCFLAGS:=-g0 -Os -pipe}"
BTCXXFLAGS="${BTCXXFLAGS:=-g0 -Os -pipe}"
BTCFLAGS="${BTCFLAGS:=-g0 -O2 -pipe}"
BTCXXFLAGS="${BTCXXFLAGS:=-g0 -O2 -pipe}"
BTLDFLAGS="${BTLDFLAGS:=-s}"
opt_keep=opt_keep.off
stage=0
@ -401,7 +402,7 @@ do
then
cleanup
chkstatus_or_exit 2
unset cleanup
unset -f cleanup
fi
fi

15
darkcrusade

@ -18,22 +18,21 @@
PROGRAM="${0##*/}"
# Exit immediately on any error
set -e
# Show help via option
if test "$1" = -h -o "$1" = --help
if test "$1" = -h || test "$1" = --help
then
echo "Deploy static cross-compilers for easy distribution."
echo ""
echo "Usage: $PROGRAM [TARGET]..."
echo "Deploy static cross-compilers for easy distribution."
echo ""
echo "Where TARGET is any target found in the directory \"targets\"."
echo "Where TARGET is any target found in the \"targets/\" directory."
echo "If no target names are passed, all available targets will be built."
echo ""
exit 0
exit 0;
fi
# Exit immediately on any error
set -e
# Override locale settings
LC_ALL=C
export LC_ALL

8
recipes/compressors/plzip/recipe

@ -1,6 +1,6 @@
# Build recipe for plzip.
#
# Copyright (c) 2017-2019 Matias Fonzo, <selk@dragora.org>.
# Copyright (c) 2017-2020 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
program=plzip
version=1.8
release=2
release=3
# Define a category for the output of the package name
pkgcategory=compressors
@ -64,9 +64,7 @@ build()
# Set sane permissions
chmod -R u+w,go-w,a+rX-s .
# Remove default opt level (-Os) to leave the default -O2
./configure CXXFLAGS+="$(echo $QICXXFLAGS | sed 's/\-Os//')" \
LDFLAGS="$QILDFLAGS -static" \
./configure CXXFLAGS+="$QICXXFLAGS" LDFLAGS="$QILDFLAGS -static" \
$configure_args \
--infodir=$infodir \
--mandir=$mandir \

8
recipes/libs/lzlib/recipe

@ -1,6 +1,6 @@
# Build recipe for lzlib.
#
# Copyright (c) 2017-2019 Matias Fonzo, <selk@dragora.org>.
# Copyright (c) 2017-2020 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
program=lzlib
version=1.11
release=3
release=4
# Define a category for the output of the package name
pkgcategory=libs
@ -55,9 +55,7 @@ build()
# Set sane permissions
chmod -R u+w,go-w,a+rX-s .
# Remove default opt level (-Os) to leave the default -O2
./configure CFLAGS+="$(echo $QICFLAGS | sed 's/\-Os//')" \
LDFLAGS="$QILDFLAGS" \
./configure CFLAGS+="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
$configure_args \
--libdir=/usr/lib${libSuffix} \
--infodir=$infodir \

6
recipes/tools/tarlz/recipe

@ -16,7 +16,7 @@
program=tarlz
version=0.17
release=1
release=2
# Define a category for the output of the package name
pkgcategory=tools
@ -62,9 +62,7 @@ build()
# Set sane permissions
chmod -R u+w,go-w,a+rX-s .
# Remove default opt level (-Os) to leave the default -O2
./configure CXXFLAGS+="$(echo $QICXXFLAGS | sed 's/\-Os//')" \
LDFLAGS="$QILDFLAGS -static" \
./configure CXXFLAGS+="$QICXXFLAGS" LDFLAGS="$QILDFLAGS -static" \
$configure_args \
--infodir=$infodir \
--mandir=$mandir \

12
stages/1/16-qi

@ -47,20 +47,20 @@ sed -i \
case $arch in
i586)
sed -i \
-e 's|#QICFLAGS=.*|QICFLAGS=\"-g0 -Os -march=pentium-mmx -mtune=pentiumpro -fstack-clash-protection -fcf-protection=full -pipe\"|' \
-e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-g0 -Os -march=pentium-mmx -mtune=pentiumpro -fstack-clash-protection -fcf-protection=full -pipe\"|' \
-e 's|#QICFLAGS=.*|QICFLAGS=\"-g0 -O2 -march=pentium-mmx -mtune=pentiumpro -fstack-clash-protection -fcf-protection=full -pipe\"|' \
-e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-g0 -O2 -march=pentium-mmx -mtune=pentiumpro -fstack-clash-protection -fcf-protection=full -pipe\"|' \
/tools/etc/qirc
;;
x86_64)
sed -i \
-e 's|#QICFLAGS=.*|QICFLAGS=\"-g0 -Os -march=x86-64 -fstack-clash-protection -fcf-protection=full -pipe\"|' \
-e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-g0 -Os -march=x86-64 -fstack-clash-protection -fcf-protection=full -pipe\"|' \
-e 's|#QICFLAGS=.*|QICFLAGS=\"-g0 -O2 -march=x86-64 -fstack-clash-protection -fcf-protection=full -pipe\"|' \
-e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-g0 -O2 -march=x86-64 -fstack-clash-protection -fcf-protection=full -pipe\"|' \
/tools/etc/qirc
;;
*)
sed -i \
-e 's|#QICFLAGS=.*|QICFLAGS=\"-g0 -Os -pipe\"|' \
-e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-g0 -Os -pipe\"|' \
-e 's|#QICFLAGS=.*|QICFLAGS=\"-g0 -O2 -pipe\"|' \
-e 's|#QICXXFLAGS=.*|QICXXFLAGS=\"-g0 -O2 -pipe\"|' \
/tools/etc/qirc
;;
esac

Loading…
Cancel
Save