mirror of
https://github.com/verilator/verilator.git
synced 2025-01-19 12:54:02 +00:00
Fix exceeding command-line ar limit (#2834).
This commit is contained in:
parent
9dcda6947d
commit
6a189a1f81
2
Changes
2
Changes
@ -8,6 +8,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
|||||||
|
|
||||||
**** Fix class unpacked-array compile error (#2774). [Iru Cai]
|
**** Fix class unpacked-array compile error (#2774). [Iru Cai]
|
||||||
|
|
||||||
|
**** Fix exceeding command-line ar limit (#2834). [Yinan Xu]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 4.200 2021-03-12
|
* Verilator 4.200 2021-03-12
|
||||||
|
|
||||||
|
@ -201,26 +201,30 @@ else
|
|||||||
VK_OBJS += $(VK_FAST_OBJS) $(VK_SLOW_OBJS)
|
VK_OBJS += $(VK_FAST_OBJS) $(VK_SLOW_OBJS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# When archiving just objects (.o), single $(AR) run is enough.
|
fred.a: foo1.a foo2.a out.o
|
||||||
# When merging objects (.o) and archives (.a), the following steps are taken.
|
|
||||||
|
# When archiving just objects (.o), use single $(AR) run
|
||||||
|
# 1. Make .tmp file with list of objects so don't exceed commend line
|
||||||
|
# When merging objects (.o) and archives (.a) additionally:
|
||||||
# 1. Extract object files from .a
|
# 1. Extract object files from .a
|
||||||
# 2. Create a new archive from extracted .o and given .o
|
# 2. Create a new archive from extracted .o and given .o
|
||||||
%.a:
|
%.a:
|
||||||
@echo "Archive $(AR) -cr $@ $^"
|
$(info Archive $(AR) -rcs $@ $^)
|
||||||
@if test $(words $(filter %.a,$^)) -eq 0; then \
|
$(file >$@.tmp)
|
||||||
$(AR) -cr $@ $^; \
|
$(foreach L, $(filter-out %.a,$^), $(file >>$@.tmp, $L))
|
||||||
$(RANLIB) $@; \
|
if test $(words $(filter %.a,$^)) -eq 0; then \
|
||||||
|
$(AR) -rcs $@ @$@.tmp; \
|
||||||
else \
|
else \
|
||||||
$(RM) -rf $*__tmpdir; \
|
$(RM) -rf $@.tmpdir; \
|
||||||
for archive in $(filter %.a,$^); do \
|
for archive in $(filter %.a,$^); do \
|
||||||
mkdir -p $*__tmpdir/$$(basename $${archive}); \
|
mkdir -p $@.tmpdir/$$(basename $${archive}); \
|
||||||
cd $*__tmpdir/$$(basename $${archive}); \
|
cd $@.tmpdir/$$(basename $${archive}); \
|
||||||
$(AR) -x ../../$${archive}; \
|
$(AR) -x ../../$${archive}; \
|
||||||
cd ../..; \
|
cd ../..; \
|
||||||
done; \
|
done; \
|
||||||
$(AR) -cr $@ $(filter %.o,$^) $*__tmpdir/*/*.o; \
|
$(AR) -rcs $@ @$@.tmp $@.tmpdir/*/*.o; \
|
||||||
$(RM) -rf $*__tmpdir; \
|
fi \
|
||||||
fi
|
; $(RM) -rf $@.tmp $@.tmpdir
|
||||||
|
|
||||||
$(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS)
|
$(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user