Fix make support for BSD ar (#2999) (#3256). [Julie Schwartz]

While GNU 'ar' supports '@' to specify a file, BSD 'ar' does not.
The max line length can be handled by 'xargs' instead, which will know
to break up the command.  In case there are multiple calls, only build
the index (specified with '-s') once in a later call.
This commit is contained in:
Julie Schwartz 2022-01-17 14:04:43 -05:00 committed by Wilson Snyder
parent 48a098b041
commit f5b1a5cd58
2 changed files with 7 additions and 2 deletions

View File

@ -28,6 +28,7 @@ Verilator 4.217 devel
* Support up to 64 bit enums for .next/.prev/.name (#3244). [Alexander Grobman]
* Reduce .rodata footprint of trace initialization (#3250). [Geza Lore, Shunyao CAD]
* Use C++11 standard types for MacOS portability (#3254) (#3257). [Adrien Le Masle]
* Fix make support for BSD ar (#2999) (#3256). [Julie Schwartz]
* Fix bad ending address on $readmem (#3205). [Julie Schwartz]
* Fix MSWIN compile error (#2681). [Unai Martinez-Corral]
* Fix break under foreach loop (#3230).

View File

@ -223,7 +223,9 @@ endif
$(info Archive $(AR) -rcs $@ $^)
$(foreach L, $(filter-out %.a,$^), $(shell echo $L >>$@.verilator_deplist.tmp))
@if test $(words $(filter %.a,$^)) -eq 0; then \
$(AR) -rcs $@ @$@.verilator_deplist.tmp; \
$(RM) -f $@; \
cat $@.verilator_deplist.tmp | xargs $(AR) -rc $@; \
$(AR) -s $@; \
else \
$(RM) -rf $@.tmpdir; \
for archive in $(filter %.a,$^); do \
@ -232,7 +234,9 @@ endif
$(AR) -x ../../$${archive}; \
cd ../..; \
done; \
$(AR) -rcs $@ @$@.verilator_deplist.tmp $@.tmpdir/*/*.o; \
$(RM) -f $@; \
cat $@.verilator_deplist.tmp | xargs $(AR) -rc $@; \
$(AR) -rcs $@ $@.tmpdir/*/*.o; \
fi \
; $(RM) -rf $@.verilator_deplist.tmp $@.tmpdir