Build scripts: fixed timestamp setting

This commit is contained in:
SChernykh
2025-07-07 16:17:18 +02:00
parent c5b4e84652
commit 24ac83e88b
27 changed files with 72 additions and 63 deletions
@@ -3,21 +3,22 @@ set -e
cd /p2pool
git fetch --jobs=$(nproc)
git checkout $3
git checkout $2
git submodule update --recursive --jobs $(nproc)
export TZ=UTC0
CURRENT_DATE=$(date -u -d @$2 +"%Y-%m-%d")
CURRENT_TIME=$(date -u -d @$2 +"%H:%M:%S")
TOUCH_DATE=$(date -u -d @$2 +"%Y%m%d%H%M.%S")
BUILD_TIMESTAMP=$(git show --no-patch --format=%ct $2)
CURRENT_DATE=$(date -u -d @$BUILD_TIMESTAMP +"%Y-%m-%d")
CURRENT_TIME=$(date -u -d @$BUILD_TIMESTAMP +"%H:%M:%S")
TOUCH_DATE=$(date -u -d @$BUILD_TIMESTAMP +"%Y%m%d%H%M.%S")
flags_size="-ffunction-sections -fdata-sections -Wl,-s -Wl,--gc-sections"
flags_datetime="-D__DATE__=\"\\\"$CURRENT_DATE\\\"\" -D__TIME__=\"\\\"$CURRENT_TIME\\\"\" -Wno-builtin-macro-redefined"
flags_libs="--target=x86_64-pc-windows-gnu -Os -flto -Wl,/timestamp:$2 -fuse-ld=lld -w $flags_size $flags_datetime"
flags_libs="--target=x86_64-pc-windows-gnu -Os -flto -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -w $flags_size $flags_datetime"
flags_p2pool="--target=x86_64-pc-windows-gnu -Wl,/timestamp:$2 -fuse-ld=lld -femulated-tls -Wno-unused-command-line-argument $flags_size $flags_datetime"
flags_p2pool="--target=x86_64-pc-windows-gnu -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -femulated-tls -Wno-unused-command-line-argument $flags_size $flags_datetime"
flags_cxx_headers="-isystem /usr/local/x86_64-w64-mingw32/include/c++ -isystem /usr/local/x86_64-w64-mingw32/include/c++/15.1.0 -isystem /usr/local/x86_64-w64-mingw32/include"
cd /p2pool