mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix --protect-lib generated library link rules (#2279)
We used to include a .cpp file on the link line for the shared library, which was ignored, but generated a .d file for the .so which contained the header files required by the .cpp file. This then caused a rebuild where we included the .d in verilated.mk to included in the .h headers among the prerequisites of the .so, yielding a clang error about treating .h files as c++-header rather than c-header... Long story short, we don't do that anymore. This used t cause t_a4_examples to fail on occasion. Note there is no need for a separate compilation rule for the <--protect-lib>.cpp, as it will jsut pick up the standard OPT_FAST rule.
This commit is contained in:
parent
8208fe8a0e
commit
6ed10b7fde
@ -241,19 +241,14 @@ public:
|
||||
}
|
||||
|
||||
if (!v3Global.opt.protectLib().empty()) {
|
||||
of.puts("\n### Library rules... (from --protect-lib)\n");
|
||||
of.puts("# Using -fPIC objects for both static and dynamic libraries "
|
||||
"(which appears to work)\n");
|
||||
of.puts(v3Global.opt.protectLibName(false) + ": $(VK_OBJS) $(VK_GLOBAL_OBJS)\n");
|
||||
of.puts("\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o "
|
||||
+ v3Global.opt.protectLib() + ".o " + v3Global.opt.protectLib() + ".cpp\n");
|
||||
of.puts("\tar rc $@ $^ " + v3Global.opt.protectLib() + ".o\n");
|
||||
const string protectLibDeps
|
||||
= "$(VK_OBJS) $(VK_GLOBAL_OBJS) " + v3Global.opt.protectLib() + ".o";
|
||||
of.puts("\n### Library rules from --protect-lib\n");
|
||||
of.puts(v3Global.opt.protectLibName(false) + ": " + protectLibDeps + "\n");
|
||||
of.puts("\tar rc $@ $^\n");
|
||||
of.puts("\n");
|
||||
|
||||
of.puts(v3Global.opt.protectLibName(true)
|
||||
+ ": $(VM_PREFIX)__ALL.a $(VK_GLOBAL_OBJS)\n");
|
||||
of.puts("\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -shared -o $@ "
|
||||
+ v3Global.opt.protectLib() + ".cpp $^\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)
|
||||
|
Loading…
Reference in New Issue
Block a user