From f5b1a5cd58544f9aeecb05190f65753abfb769b7 Mon Sep 17 00:00:00 2001 From: Julie Schwartz Date: Mon, 17 Jan 2022 14:04:43 -0500 Subject: [PATCH] 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. --- Changes | 1 + include/verilated.mk.in | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 733450f30..802cd1e15 100644 --- a/Changes +++ b/Changes @@ -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). diff --git a/include/verilated.mk.in b/include/verilated.mk.in index aa9274789..99fd533c2 100644 --- a/include/verilated.mk.in +++ b/include/verilated.mk.in @@ -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