As mingw-w64 now provides these routines, we no longer need to build the original library from GCC. As building with -fstack-protector-strong still links with -lssp (and -lssp_nonshared), we still need to provide libraries with these names, but they can be empty dummy libraries.
46 lines
1.4 KiB
Bash
Executable File
46 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2018 Martin Storsjo
|
|
#
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
# copyright notice and this permission notice appear in all copies.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
set -e
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
*)
|
|
PREFIX="$1"
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
if [ -z "$PREFIX" ]; then
|
|
echo "$0 dest"
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$PREFIX"
|
|
PREFIX="$(cd "$PREFIX" && pwd)"
|
|
export PATH="$PREFIX/bin:$PATH"
|
|
|
|
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
|
|
|
|
for arch in $ARCHS; do
|
|
if [ ! -f $PREFIX/$arch-w64-mingw32/lib/libssp.a ]; then
|
|
# Create empty dummy archives, to avoid failing when the compiler
|
|
# driver adds "-lssp -lssh_nonshared" when linking.
|
|
llvm-ar rcs $PREFIX/$arch-w64-mingw32/lib/libssp.a
|
|
llvm-ar rcs $PREFIX/$arch-w64-mingw32/lib/libssp_nonshared.a
|
|
fi
|
|
done
|