History

ffbuild: read library linker objects from a file

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.

Gyan Doshi committed 1 year ago

Commit 9e857e11 parent 6bad55e3 files · +8 −3Browse files

Unified · Split

3 files
  1. .gitignore +1 −0
  2. ffbuild/common.mak +1 −1
  3. ffbuild/library.mak +6 −2
.gitignore+1−0
@@ -1,5 +1,6 @@
11 *.a
22 *.o
3+*.objs
34 *.o.*
45 *.d
56 *.def
ffbuild/common.mak+1−1
@@ -214,7 +214,7 @@ $(TOOLOBJS): | tools · 213 unmodified lines
214214
215215 OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
216216
217−CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
217+CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.objs *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb
218218 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
219219
220220 define RULES
ffbuild/library.mak+6−2
@@ -35,8 +35,10 @@ OBJS += $(SHLIBOBJS) · 34 unmodified lines
3535 endif
3636 $(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)
3737 $(RM) $@
38− $(AR) $(ARFLAGS) $(AR_O) $^
38+ $(Q)echo $^ > $@.objs
39+ $(AR) $(ARFLAGS) $(AR_O) @$@.objs
3940 $(RANLIB) $@
41+ -$(RM) $@.objs
4042
4143 install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
4244
@@ -66,8 +68,10 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) · 23 unmodified lines
6668
6769 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
6870 $(SLIB_CREATE_DEF_CMD)
69− $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
71+ $(Q)echo $$(filter %.o,$$^) > $$@.objs
72+ $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
7073 $(SLIB_EXTRA_CMD)
74+ -$(RM) $$@.objs
7175
7276 ifdef SUBDIR
7377 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t