Commit 46c12583 authored by Steve Lhomme's avatar Steve Lhomme

vlc-debian-llvm-uwp: bring closer to llvm-mingw

Based on 8a7dcd4ef1a3f99f15fa27eab60885cef377c4a5.

Bring back winpthreads originally removed in vlc-debian-llvm-mingw.
parent 5b513484
Pipeline #43648 failed with stage
in 32 minutes and 5 seconds
......@@ -2,7 +2,7 @@ FROM debian:buster-20201012-slim
MAINTAINER VideoLAN roots <roots@videolan.org>
ENV IMAGE_DATE=202011131520
ENV IMAGE_DATE=202011301436
RUN apt-get update -qq && mkdir -p /usr/share/man/man1 && \
apt-get upgrade -y && \
......@@ -27,8 +27,6 @@ WORKDIR /build
ENV TOOLCHAIN_PREFIX=/opt/llvm-mingw
ARG TOOLCHAIN_ARCHS="i686 x86_64 armv7 aarch64"
ARG CORES=4
RUN CMAKE_VERSION=3.17.0 && \
......@@ -50,13 +48,17 @@ RUN CMAKE_VERSION=3.17.0 && \
ENV PATH=/opt/tools/bin:$PATH
ARG TOOLCHAIN_ARCHS="i686 x86_64 armv7 aarch64"
ARG DEFAULT_CRT=ucrt
# Build everything that uses the llvm monorepo. We need to build the mingw runtime before the compiler-rt/libunwind/libcxxabi/libcxx runtimes.
COPY build-llvm.sh strip-llvm.sh install-wrappers.sh build-mingw-w64.sh build-mingw-w64-tools.sh build-compiler-rt.sh build-mingw-w64-libraries.sh build-libcxx.sh ./
COPY wrappers/*.sh wrappers/*.c wrappers/*.h ./wrappers/
RUN ./build-llvm.sh $TOOLCHAIN_PREFIX && \
./strip-llvm.sh $TOOLCHAIN_PREFIX && \
./install-wrappers.sh $TOOLCHAIN_PREFIX && \
MINGW_W64_VERSION=af56acd2c36af609e701fa4880f25c5f37abe502 ./build-mingw-w64.sh $TOOLCHAIN_PREFIX --with-default-msvcrt=ucrt --with-default-win32-winnt=0xA00 && \
MINGW_W64_VERSION=ecb4ff5498dfedd6abcbadb889b84fab19ee57b2 ./build-mingw-w64.sh $TOOLCHAIN_PREFIX --with-default-msvcrt=$DEFAULT_CRT --with-default-win32-winnt=0xA00 && \
./build-mingw-w64-tools.sh $TOOLCHAIN_PREFIX && \
./build-compiler-rt.sh $TOOLCHAIN_PREFIX && \
./build-mingw-w64-libraries.sh $TOOLCHAIN_PREFIX && \
......
......@@ -156,13 +156,9 @@ build_all() {
-DLIBCXX_ENABLE_EXCEPTIONS=ON \
-DLIBCXX_ENABLE_THREADS=ON \
-DLIBCXX_HAS_WIN32_THREAD_API=ON \
-DLIBCXX_ENABLE_MONOTONIC_CLOCK=ON \
-DLIBCXX_ENABLE_SHARED=$SHARED \
-DLIBCXX_ENABLE_STATIC=$STATIC \
-DLIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG=TRUE \
-DLIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB=TRUE \
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \
-DLIBCXX_ENABLE_FILESYSTEM=OFF \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=TRUE \
-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON \
-DLIBCXX_CXX_ABI=libcxxabi \
......@@ -185,7 +181,14 @@ build_all() {
mkdir -p build-$arch-$type
cd build-$arch-$type
if [ "$type" = "shared" ]; then
LIBCXXABI_VISIBILITY_FLAGS="-D_LIBCPP_BUILDING_LIBRARY= -U_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS"
# Define _LIBCPP_BUILDING_LIBRARY, to an empty string to match
# cases in source files that also do
# "#define _LIBCPP_BUILDING_LIBRARY". Since Nov 3 2020, libcxxabi
# itself also defines this, but with a plain
# -D_LIBCPP_BUILDING_LIBRARY, which defines it to 1. Therefore,
# first undefine any potential existing define from the command
# line, to avoid conflicts.
LIBCXXABI_VISIBILITY_FLAGS="-U_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_BUILDING_LIBRARY= -U_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS"
else
LIBCXXABI_VISIBILITY_FLAGS=""
fi
......
......@@ -36,8 +36,26 @@ export PATH="$PREFIX/bin:$PATH"
: ${CORES:=4}
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
download() {
if [ -n "$(which wget)" ]; then
if [ -n "$2" ]; then
wget -O "$2" "$1"
else
wget "$1"
fi
else
if [ -n "$2" ]; then
curl -L -o "$2" "$1"
else
curl -LO "$1"
fi
fi
}
if [ ! -d libssp ]; then
svn checkout -q svn://gcc.gnu.org/svn/gcc/tags/gcc_7_3_0_release/libssp
download 'https://gitlab.com/watched/gcc-mirror/gcc/-/archive/releases/gcc-7.3.0/gcc-releases-gcc-7.3.0.tar.bz2?path=libssp' libssp.tar.bz2
tar xf libssp.tar.bz2 --strip-components=1
rm -f libssp.tar.bz2
fi
cp libssp-Makefile libssp/Makefile
......
......@@ -35,7 +35,7 @@ if [ ! -d mingw-w64 ] || [ -n "$SYNC" ]; then
fi
cd mingw-w64/mingw-w64-libraries
for lib in winstorecompat; do
for lib in winpthreads winstorecompat; do
cd $lib
for arch in $ARCHS; do
[ -z "$CLEAN" ] || rm -rf build-$arch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment