[FFmpeg-devel] [PATCH] ffbuild: read library linker objects from a file

Gyan Doshi ffmpeg at gyani.pro
Wed Mar 12 09:42:16 EET 2025


The linker command can exceed the maximum argument limit on MinGW,
especially for libavcodec.

The objects list is now stored in a file and passed to the linker.
---
 ffbuild/library.mak | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffbuild/library.mak b/ffbuild/library.mak
index 793e9d41fa..781b018e00 100644
--- a/ffbuild/library.mak
+++ b/ffbuild/library.mak
@@ -66,8 +66,10 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
 
 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
 	$(SLIB_CREATE_DEF_CMD)
-	$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
+	$(Q)echo $$(filter %.o,$$^) > $$@.objs
+	$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
 	$(SLIB_EXTRA_CMD)
+	-$(RM) $$@.objs
 
 ifdef SUBDIR
 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
-- 
2.46.1



More information about the ffmpeg-devel mailing list