Fix hier test failure on mac (#2524)

* No need to link the intermediate .so in hierarchical verilation

* apply clang-format

* run all tests in ci instead of cron. DONT_MERGE

* Add -undefined dynamic_lookup for mac environment when linking a shared protect-lib.

* Let's just check on mac for now. DONT_MERGE

* Revert "Let's just check on mac for now. DONT_MERGE"

This reverts commit 533fac6f9f.

* Revert "run all tests in ci instead of cron. DONT_MERGE"

This reverts commit fb4ac1fb42.
This commit is contained in:
Yutetsu TAKATSUKASA 2020-08-29 20:56:06 +09:00 committed by GitHub
parent ef4f91ae5a
commit 4f88ec3518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 6 deletions

View File

@ -250,12 +250,27 @@ public:
// The rule to create .a is defined in verilated.mk, so just define dependency here.
of.puts(v3Global.opt.protectLibName(false) + ": " + protectLibDeps + "\n");
of.puts("\n");
of.puts(v3Global.opt.protectLibName(true) + ": " + protectLibDeps + "\n");
of.puts("\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -shared -o $@ $^\n");
of.puts("\n");
of.puts("lib" + v3Global.opt.protectLib() + ": " + v3Global.opt.protectLibName(false)
+ " " + v3Global.opt.protectLibName(true) + "\n");
if (v3Global.opt.hierChild()) {
// Hierarchical child does not need .so because hierTop() will create .so from .a
of.puts("lib" + v3Global.opt.protectLib() + ": "
+ v3Global.opt.protectLibName(false) + "\n");
} else {
of.puts(v3Global.opt.protectLibName(true) + ": " + protectLibDeps + "\n");
// Linker on mac emits an error if all symbols are not found here,
// but some symbols that are referred as "DPI-C" can not be found at this moment.
// So add dynamic_lookup
of.puts("ifeq ($(shell uname -s),Darwin)\n");
of.puts("\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -undefined "
"dynamic_lookup -shared -o $@ $^\n");
of.puts("else\n");
of.puts(
"\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -shared -o $@ $^\n");
of.puts("endif\n");
of.puts("\n");
of.puts("lib" + v3Global.opt.protectLib() + ": "
+ v3Global.opt.protectLibName(false) + " "
+ v3Global.opt.protectLibName(true) + "\n");
}
}
of.puts("\n");