Fix test failure on FreeBSD (#2521)

* Don't use thin-archive to merge multiple archives because it is gnu-ar specific.

* remove -time option that may caues -Wunused-command-line-argument warning
This commit is contained in:
Yutetsu TAKATSUKASA 2020-08-27 07:52:48 +09:00 committed by GitHub
parent bed3101dfc
commit ef04ada12b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 15 deletions

View File

@ -201,20 +201,23 @@ else
endif endif
# When archiving just objects (.o), single $(AR) run is enough. # When archiving just objects (.o), single $(AR) run is enough.
# When merging objects (.o) and archives (.a), the following step is taken. # When merging objects (.o) and archives (.a), the following steps are taken.
# 1. create a temporary archive ($*__tmp.a) which contains only .o # 1. Extract object files from .a
# 2. create a thin archive that refers all archives including $*__tmp.a # 2. Create a new archive from extracted .o and given .o
# 3. convert the thin archive to the ordinal archive
%.a: %.a:
if test $(words $(filter %.a,$^)) -eq 0; then \ if test $(words $(filter %.a,$^)) -eq 0; then \
$(AR) -cr $@ $^; \ $(AR) -cr $@ $^; \
$(RANLIB) $@; \ $(RANLIB) $@; \
else \ else \
$(RM) -f $*__tmp.a; \ $(RM) -rf $*__tmpdir; \
$(AR) -cr $*__tmp.a $(filter-out %.a,$^); \ for archive in $(filter %.a,$^); do \
$(AR) -cqT $@ $*__tmp.a $(filter %.a,$^); \ mkdir -p $*__tmpdir/$$(basename $${archive}); \
printf "create $@\n addlib $@\n save\\n end" | $(AR) -M; \ cd $*__tmpdir/$$(basename $${archive}); \
$(RM) -f $*__tmp.a; \ $(AR) -x ../../$${archive}; \
cd ../..; \
done; \
$(AR) -cr $@ $(filter %.o,$^) $*__tmpdir/*/*.o; \
$(RM) -rf $*__tmpdir; \
fi fi
$(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS) $(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS)

View File

@ -20,7 +20,7 @@ compile(
v_flags2 => ['t/t_hier_block.cpp'], v_flags2 => ['t/t_hier_block.cpp'],
verilator_flags2 => ['--stats', ($Self->{vltmt} ? ' --threads 6' : ''), verilator_flags2 => ['--stats', ($Self->{vltmt} ? ' --threads 6' : ''),
'--hierarchical', '--hierarchical',
'--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus -time"' '--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus"'
], ],
); );

View File

@ -22,7 +22,7 @@ compile(
v_flags2 => ['t/t_hier_block.cpp'], v_flags2 => ['t/t_hier_block.cpp'],
verilator_flags2 => ['--stats', verilator_flags2 => ['--stats',
'--hierarchical', '--hierarchical',
'--CFLAGS', "'-pipe -DCPP_MACRO=cplusplus -time'", '--CFLAGS', "'-pipe -DCPP_MACRO=cplusplus '",
'--make cmake', '--make cmake',
($Self->{vltmt} ? ' --threads 6' : '')], ($Self->{vltmt} ? ' --threads 6' : '')],
); );

View File

@ -23,7 +23,7 @@ compile(
v_flags2 => ['t/t_hier_block.cpp'], v_flags2 => ['t/t_hier_block.cpp'],
verilator_flags2 => ['--stats', verilator_flags2 => ['--stats',
'+define+USE_VLT', 't/t_hier_block_vlt.vlt', '+define+USE_VLT', 't/t_hier_block_vlt.vlt',
'--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus -time"', '--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus"',
($Self->{vltmt} ? ' --threads 6' : '')], ($Self->{vltmt} ? ' --threads 6' : '')],
); );

View File

@ -31,7 +31,7 @@ while (1) {
"PROTECT_KEY", "PROTECT_KEY",
"t/t_hier_block.v", "t/t_hier_block.v",
"-DAS_PROT_LIB", "-DAS_PROT_LIB",
'--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus -time"', '--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus"',
$Self->{vltmt} ? ' --threads 1' : '', $Self->{vltmt} ? ' --threads 1' : '',
"--build"], "--build"],
verilator_run => 1, verilator_run => 1,

View File

@ -23,7 +23,7 @@ compile(
'--stats', '--stats',
'--hierarchical', '--hierarchical',
($Self->{vltmt} ? ' --threads 6' : ''), ($Self->{vltmt} ? ' --threads 6' : ''),
'--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus -time"' '--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus"'
], ],
); );

View File

@ -21,7 +21,7 @@ compile(
verilator_flags2 => ['--stats', verilator_flags2 => ['--stats',
'--hierarchical', '--hierarchical',
'+define+USE_VLT', 't/t_hier_block_vlt.vlt', '+define+USE_VLT', 't/t_hier_block_vlt.vlt',
'--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus -time"', '--CFLAGS', '"-pipe -DCPP_MACRO=cplusplus"',
($Self->{vltmt} ? ' --threads 6' : '')], ($Self->{vltmt} ? ' --threads 6' : '')],
); );