1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore(windows): use Debian Bullseye for Windows cross-compilation

bsdtar has moved to libarchive-tools package.

Something has changed in the newer gcc or mingw that makes Opus and
Sodium fail to build with:

  undefined reference to `__memcpy_chk'

The solution is to use -lssp or -fstack-protector, but while -lssp
worked for Opus, it was breaking Sodium's `make install` as it prevented
the .def file from being generated during the build time for some
reason:

  /usr/bin/install: cannot stat './libsodium-24.def': No such file or directory

while -fstack-protector worked just fine, so -fstack-protector was used
for both. This adds a new library dependency on libssp-0.dll.
This commit is contained in:
Maxim Biro 2021-10-01 13:09:46 -04:00
parent da5c165f41
commit 57ae8a3e6a
No known key found for this signature in database
GPG Key ID: AB3AD9896472BFA4
3 changed files with 11 additions and 10 deletions

View File

@ -118,7 +118,7 @@ sudo docker run --rm \
-v "$PWD/workspace":/workspace \ -v "$PWD/workspace":/workspace \
-v "$PWD":/qtox \ -v "$PWD":/qtox \
-e TRAVIS_CI_STAGE="$STAGE" \ -e TRAVIS_CI_STAGE="$STAGE" \
debian:buster-slim \ debian:bullseye-slim \
/bin/bash /qtox/windows/cross-compile/build.sh "$ARCH" "$BUILD_TYPE" /bin/bash /qtox/windows/cross-compile/build.sh "$ARCH" "$BUILD_TYPE"
# Purely for debugging # Purely for debugging

View File

@ -45,19 +45,19 @@ To start cross-compiling for 32-bit release version of qTox run:
sudo docker run --rm \ sudo docker run --rm \
-v /absolute/path/to/your/workspace:/workspace \ -v /absolute/path/to/your/workspace:/workspace \
-v /absolute/path/to/your/qtox:/qtox \ -v /absolute/path/to/your/qtox:/qtox \
debian:buster-slim \ debian:bullseye-slim \
/bin/bash /qtox/windows/cross-compile/build.sh i686 release /bin/bash /qtox/windows/cross-compile/build.sh i686 release
``` ```
If you want to debug some compilation issue, you might want to instead run: If you want to debug some compilation issue, you might want to instead run:
```sh ```sh
# Get shell inside Debian Buster container so that you can poke around if needed # Get shell inside Debian Bullseye container so that you can poke around if needed
sudo docker run -it \ sudo docker run -it \
--rm \ --rm \
-v /absolute/path/to/your/workspace:/workspace \ -v /absolute/path/to/your/workspace:/workspace \
-v /absolute/path/to/your/qtox:/qtox \ -v /absolute/path/to/your/qtox:/qtox \
debian:buster-slim \ debian:bullseye-slim \
/bin/bash /bin/bash
# Run the script # Run the script
bash /qtox/windows/cross-compile/build.sh i686 release bash /qtox/windows/cross-compile/build.sh i686 release

View File

@ -38,9 +38,9 @@ readonly QTOX_SRC_DIR="/qtox"
# Make sure we run in an expected environment # Make sure we run in an expected environment
if [ ! -f /etc/os-release ] || ! cat /etc/os-release | grep -qi 'buster' if [ ! -f /etc/os-release ] || ! cat /etc/os-release | grep -qi 'bullseye'
then then
echo "Error: This script should be run on Debian Buster." echo "Error: This script should be run on Debian Bullseye."
exit 1 exit 1
fi fi
@ -130,12 +130,12 @@ apt-get update
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
autoconf \ autoconf \
automake \ automake \
bsdtar \
build-essential \ build-essential \
ca-certificates \ ca-certificates \
cmake \ cmake \
extra-cmake-modules \ extra-cmake-modules \
git \ git \
libarchive-tools \
libtool \ libtool \
nsis \ nsis \
pkg-config \ pkg-config \
@ -739,6 +739,7 @@ then
rm $OPUS_FILENAME rm $OPUS_FILENAME
cd opus* cd opus*
LDFLAGS="-fstack-protector" \
CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \ CFLAGS="-O2 -g0" ./configure --host="$ARCH-w64-mingw32" \
--prefix="$OPUS_PREFIX_DIR" \ --prefix="$OPUS_PREFIX_DIR" \
--enable-shared \ --enable-shared \
@ -773,6 +774,7 @@ then
rm "$SODIUM_FILENAME" rm "$SODIUM_FILENAME"
cd libsodium* cd libsodium*
LDFLAGS="-fstack-protector" \
./configure --host="$ARCH-w64-mingw32" \ ./configure --host="$ARCH-w64-mingw32" \
--prefix="$SODIUM_PREFIX_DIR" \ --prefix="$SODIUM_PREFIX_DIR" \
--enable-shared \ --enable-shared \
@ -1401,9 +1403,8 @@ mkdir -p "$QTOX_PREFIX_DIR/libsnore-qt5"
cp "$SNORE_PREFIX_DIR/lib/plugins/libsnore-qt5/libsnore_backend_windowstoast.dll" "$QTOX_PREFIX_DIR/libsnore-qt5" cp "$SNORE_PREFIX_DIR/lib/plugins/libsnore-qt5/libsnore_backend_windowstoast.dll" "$QTOX_PREFIX_DIR/libsnore-qt5"
cp "$SNORE_PREFIX_DIR/bin/SnoreToast.exe" $QTOX_PREFIX_DIR cp "$SNORE_PREFIX_DIR/bin/SnoreToast.exe" $QTOX_PREFIX_DIR
cp /usr/lib/gcc/$ARCH-w64-mingw32/*-posix/libgcc_s_*.dll $QTOX_PREFIX_DIR cp /usr/lib/gcc/$ARCH-w64-mingw32/*-posix/{libgcc_s_*.dll,libstdc++*.dll,libssp*.dll} $QTOX_PREFIX_DIR
cp /usr/lib/gcc/$ARCH-w64-mingw32/*-posix/libstdc++-6.dll $QTOX_PREFIX_DIR cp /usr/$ARCH-w64-mingw32/lib/libwinpthread*.dll $QTOX_PREFIX_DIR
cp /usr/$ARCH-w64-mingw32/lib/libwinpthread-1.dll $QTOX_PREFIX_DIR
# Setup wine # Setup wine
if [[ "$ARCH" == "i686" ]] if [[ "$ARCH" == "i686" ]]