1
0
Fork 0

Compare commits

...

3 Commits
1.3.0 ... MT

4 changed files with 38 additions and 27 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ -n "$1" ]; then CC="$1"; elif [ -z "$CC" ]; then CC="cc"; fi
echo "Built : `date -u +"%Y-%m-%d %H:%M:%S"`"
echo "Built : `date -u +'%Y-%m-%d %H:%M:%S'`"
echo "Platform : `uname -s -r -v -m`"
echo "Target : `$CC -dumpmachine`"
echo "Compiler : `$CC -v 2>&1 | grep -iE '\b(gcc|clang)\s+version\b' | head -n 1`"
echo "Compiler : `$CC -v 2>&1 | grep -i '\(gcc\|clang\)[[:space:]]\{1,\}version' | head -n 1`"

View File

@ -0,0 +1,28 @@
#!/bin/bash
set -e
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../../.."
function mk_slunk() {
local command="make -B CC=${2}-gcc STRIP=1 FLTO=1"
$BASH -x -c "${command}${3:+ ${3}}"
cp -vf "frontend/bin/slunkcrypt" "out/slunkcrypt-${1}"
}
if [[ "$OSTYPE" != "linux"* ]]; then
echo "This script is supposed to run on the linux platform !!!"
exit 1
fi
rm -rf "out" && mkdir -p "out"
$BASH -x -c "make clean"
mk_slunk "x86_64" "x86_64-linux-gnu" "MARCH=x86-64 MTUNE=nocona"
mk_slunk "i686" "i686-linux-gnu" "MARCH=pentiumpro MTUNE=pentium3"
mk_slunk "armel" "arm-linux-gnueabi"
mk_slunk "armhf" "arm-linux-gnueabihf"
mk_slunk "arm64" "aarch64-linux-gnu"
mk_slunk "mipsel" "mipsel-linux-gnu"
mk_slunk "mips64el" "mips64el-linux-gnuabi64"
printf "\033[1;32m\nBuild completed successfully.\033[0m\n\n"

View File

@ -1,7 +1,7 @@
#!/bin/bash
# See "etc/utils/linux/mk-musl.sh" in order to build musl libc!
set -e
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../../.."
function mk_slunk() {
local command="make -B CC=/usr/local/musl/${1}/bin/musl-gcc STATIC=1 STRIP=1 FLTO=1"
@ -9,7 +9,7 @@ function mk_slunk() {
cp -vf "frontend/bin/slunkcrypt" "out/slunkcrypt-${1}"
}
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
if [[ "$OSTYPE" != "linux"* ]]; then
echo "This script is supposed to run on the linux platform !!!"
exit 1
fi

View File

@ -52,28 +52,10 @@
// ==========================================================================
#ifdef _WIN32
#ifdef _DLL
#define _acmdln GetCommandLineA()
#define _wcmdln GetCommandLineW()
#else
extern char *const _acmdln;
extern wchar_t *const _wcmdln;
#endif
static void clear_cmdline_args(char *const acmdln, wchar_t *const wcmdln)
{
if (acmdln && acmdln[0U])
{
const size_t len = strlen(acmdln);
slunkcrypt_bzero(acmdln, len * sizeof(char));
if (len > 5U) strcpy(acmdln, "slunk");
}
if (wcmdln && wcmdln[0U])
{
const size_t len = wcslen(wcmdln);
slunkcrypt_bzero(wcmdln, len * sizeof(wchar_t));
if (len > 5U) wcscpy(wcmdln, L"slunk");
}
}
_CRTIMP char **__cdecl __p__acmdln(void);
_CRTIMP wchar_t **__cdecl __p__wcmdln(void);
#define _acmdln (*__p__acmdln())
#define _wcmdln (*__p__wcmdln())
#endif
void init_terminal(void)
@ -82,7 +64,8 @@ void init_terminal(void)
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
_setmode(_fileno(stderr), _O_U8TEXT);
_setmode(_fileno(stdin), _O_BINARY);
clear_cmdline_args(_acmdln, _wcmdln);
slunkcrypt_bzero(_acmdln, strlen(_acmdln) * sizeof(char));
slunkcrypt_bzero(_wcmdln, wcslen(_wcmdln) * sizeof(wchar_t));
#else
openlog("slunkcrypt", LOG_PID | LOG_CONS, LOG_USER);
#endif