[vlc-commits] package/win32: build.sh: fix building ucrt builds with non-msys2 gcc
Steve Lhomme
git at videolan.org
Thu Jun 18 14:54:37 CEST 2020
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun 3 13:36:15 2020 +0200| [6e2da1462e2206e3f4360f97b6ed33bf04b7d61e] | committer: Steve Lhomme
package/win32: build.sh: fix building ucrt builds with non-msys2 gcc
-mcrtdll is a msys2 only option. At least it's not in the regular gcc images
from our Dockers.
(cherry picked from commit 1f06e44fe39287e63091d4a95dbd4b4ef5c5874e)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6e2da1462e2206e3f4360f97b6ed33bf04b7d61e
---
extras/package/win32/build.sh | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
index 958ebe90d2..06b8d99422 100755
--- a/extras/package/win32/build.sh
+++ b/extras/package/win32/build.sh
@@ -210,16 +210,19 @@ if [ ! -z "$BUILD_UCRT" ]; then
LDFLAGS="$LDFLAGS -l$EXTRA_CRUNTIME -lucrt"
if [ ! "$COMPILING_WITH_CLANG" -gt 0 ]; then
- # tell gcc to replace msvcrt with $EXTRA_CRUNTIME+ucrt
- CFLAGS="$CFLAGS -mcrtdll=$EXTRA_CRUNTIME -mcrtdll=ucrt"
- CXXFLAGS="$CXXFLAGS -mcrtdll=$EXTRA_CRUNTIME -mcrtdll=ucrt"
- LDFLAGS="$LDFLAGS -mcrtdll=$EXTRA_CRUNTIME -mcrtdll=ucrt"
+ # assume gcc
+ NEWSPECFILE="`pwd`/specfile-$SHORTARCH"
+ # tell gcc to replace msvcrt with ucrtbase+ucrt
+ $CC -dumpspecs | sed -e "s/-lmsvcrt/-l$EXTRA_CRUNTIME -lucrt/" > $NEWSPECFILE
+ CFLAGS="$CFLAGS -specs=$NEWSPECFILE"
+ CXXFLAGS="$CXXFLAGS -specs=$NEWSPECFILE"
if [ ! -z "$WINSTORE" ]; then
- # trick to provide these libraries before -ladvapi32 -lshell32 -luser32 -lkernel32
- CFLAGS="$CFLAGS -mcrtdll=windowsapp -mcrtdll=winstorecompat"
- CXXFLAGS="$CXXFLAGS -mcrtdll=windowsapp -mcrtdll=winstorecompat"
- LDFLAGS="$LDFLAGS -mcrtdll=windowsapp -mcrtdll=winstorecompat"
+ # trick to provide these libraries instead of -ladvapi32 -lshell32 -luser32 -lkernel32
+ sed -i -e "s/-ladvapi32/-lwindowsapp -lwinstorecompat/" $NEWSPECFILE
+ sed -i -e "s/-lshell32//" $NEWSPECFILE
+ sed -i -e "s/-luser32//" $NEWSPECFILE
+ sed -i -e "s/-lkernel32//" $NEWSPECFILE
fi
else
CFLAGS="$CFLAGS -Wl,-l$EXTRA_CRUNTIME,-lucrt"
More information about the vlc-commits
mailing list