[vlc-commits] [Git][videolan/vlc][master] 3 commits: extras/tools: libtool: respect the provided LTCFLAGS LTCC

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jun 22 11:45:04 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
69c16b38 by Steve Lhomme at 2026-06-22T10:47:47+00:00
extras/tools: libtool: respect the provided LTCFLAGS LTCC

Otherwise calling "LTCFLAGS=-Dtoto LTCC=gcc configure" doesn't use these values.

- - - - -
1e06b033 by Steve Lhomme at 2026-06-22T10:47:47+00:00
package/win32: always use -O0 for libtool wrappers

When using -flto the magic exe is stripped from the wrapper and libtool
ends up installing the wrapper rather than the real binary.

We don't need about the other C flags as it's just a compiled wrapper.
If anything it will generate usable wrappers for UWP.

Fixes #29922

- - - - -
35f4ec31 by Steve Lhomme at 2026-06-22T10:47:47+00:00
package/win32: always build libtool when using LTO

In case LTO is used with gcc we also want it to install the proper executable
rather than tripping on the stripped MAGIC EXE.

- - - - -


3 changed files:

- extras/package/win32/build.sh
- + extras/tools/libtool-2.5.4-libtool.m4-respect-the-provided-LTCFLAGS-LTCC-during.patch
- extras/tools/tools.mak


Changes:

=====================================
extras/package/win32/build.sh
=====================================
@@ -185,6 +185,8 @@ FORCED_TOOLS=""
 # Force libtool build when compiling with clang
 if [ "$COMPILING_WITH_CLANG" -gt 0 ] && [ ! -d "libtool" ]; then
     FORCED_TOOLS="$FORCED_TOOLS libtool"
+elif [ -n "$WITH_LTO" ] && [ ! -d "libtool" ]; then
+    FORCED_TOOLS="$FORCED_TOOLS libtool"
 fi
 # bootstrap only if needed in interactive mode
 if [ "$INTERACTIVE" != "yes" ] || [ ! -f ./Makefile ]; then
@@ -659,7 +661,7 @@ else
     fi
 
     info "Configuring VLC"
-    ${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$CONTRIB_PREFIX "$WIXPATH" $CONFIGFLAGS
+    ${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$CONTRIB_PREFIX "$WIXPATH" $CONFIGFLAGS LTCFLAGS=-O0
 
     info "Compiling"
     make -j$JOBS ${COMPILEFLAGS}


=====================================
extras/tools/libtool-2.5.4-libtool.m4-respect-the-provided-LTCFLAGS-LTCC-during.patch
=====================================
@@ -0,0 +1,38 @@
+From 98399f0b0ad7a848b198ce77d84b042d5aed4192 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 19 Jun 2026 11:51:11 +0200
+Subject: [PATCH] libtool.m4: respect the provided LTCFLAGS/LTCC during
+ configure
+
+Otherwise calling "LTCFLAGS=-Dtoto LTCC=gcc configure" doesn't use these values.
+It always hardcoded to use CC/CFLAGS.
+---
+ m4/libtool.m4 | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+index 8bc4bfde..cabe58a8 100644
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -931,8 +931,6 @@ dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+ m4_defun([_LT_TAG_COMPILER],
+ [AC_REQUIRE([AC_PROG_CC])dnl
+ 
+-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+ _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+ _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+ 
+@@ -942,6 +940,9 @@ LTCC=${LTCC-"$CC"}
+ # If no C compiler flags were specified, use CFLAGS.
+ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+ 
++_LT_DECL([LTCC], [LTCC], [1], [A C compiler])dnl
++_LT_DECL([LTCFLAGS], [LTCFLAGS], [1], [LTCC compiler flags])dnl
++
+ # Allow CC to be a program name with arguments.
+ compiler=$CC
+ ])# _LT_TAG_COMPILER
+-- 
+2.52.0.windows.1
+


=====================================
extras/tools/tools.mak
=====================================
@@ -133,6 +133,7 @@ libtool: libtool-$(LIBTOOL_VERSION).tar.gz
 
 	$(APPLY) $(TOOLS)/libtool-2.5.4-unarchive-old-libraries.patch
 	$(APPLY) $(TOOLS)/libtool-2.5.4-ltmain.in-reference-MAGIC_EXE-in-the-main.patch
+	$(APPLY) $(TOOLS)/libtool-2.5.4-libtool.m4-respect-the-provided-LTCFLAGS-LTCC-during.patch
 	$(MOVE)
 
 .buildlibtool: libtool .automake .help2man



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/85b9e8476423327d33f5aaee973874358957c34d...35f4ec31b217f659f618c70020244e636c41e4e6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/85b9e8476423327d33f5aaee973874358957c34d...35f4ec31b217f659f618c70020244e636c41e4e6
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list