From ac3ef217c34660366054a97f1a00517c753c0d84 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Fri, 27 Mar 2026 11:22:05 +0800 Subject: [PATCH 1/2] Fix parallel build race with dep/ directory Pattern rules that move .d files into dep/ do not depend on the dep directory target, so parallel make can attempt the move before the directory exists. Add dep as an order-only prerequisite to all affected pattern rules. Bug: https://bugs.gentoo.org/880921 Bug: https://bugs.gentoo.org/911647 Bug: https://bugs.gentoo.org/917344 Closes: https://github.com/steveicarus/iverilog/issues/1314 Signed-off-by: Huang Rui --- Makefile.in | 2 +- vhdlpp/Makefile.in | 4 ++-- vvp/Makefile.in | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5eafb9673..4333e272d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -252,7 +252,7 @@ endif version.exe: $(srcdir)/version.c $(srcdir)/version_base.h version_tag.h $(BUILDCC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o version.exe -I. -I$(srcdir) $(srcdir)/version.c -%.o: %.cc config.h +%.o: %.cc config.h | dep $(CXX) $(CPPFLAGS) $(CXXFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o mv $*.d dep/$*.d diff --git a/vhdlpp/Makefile.in b/vhdlpp/Makefile.in index 2a8e0757c..27babf4e4 100644 --- a/vhdlpp/Makefile.in +++ b/vhdlpp/Makefile.in @@ -104,11 +104,11 @@ dep: vhdlpp@EXEEXT@: $O $(CXX) -o vhdlpp@EXEEXT@ $(LDFLAGS) $O $(LIBS) -%.o: $(srcdir)/../libmisc/%.cc +%.o: $(srcdir)/../libmisc/%.cc | dep $(CXX) $(CPPFLAGS) $(CXXFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o mv $*.d dep/$*.d -%.o: %.cc vhdlpp_config.h +%.o: %.cc vhdlpp_config.h | dep $(CXX) $(CPPFLAGS) $(CXXFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o mv $*.d dep/$*.d diff --git a/vvp/Makefile.in b/vvp/Makefile.in index 3996ee567..941ffdee1 100644 --- a/vvp/Makefile.in +++ b/vvp/Makefile.in @@ -159,11 +159,11 @@ vvp@EXEEXT@: $O main.o endif endif -%.o: %.cc config.h +%.o: %.cc config.h | dep $(CXX) $(CPPFLAGS) -DIVL_SUFFIX='"$(suffix)"' $(MDIR1) $(MDIR2) $(CXXFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o mv $*.d dep/$*.d -%.o: %.c config.h +%.o: %.c config.h | dep $(CC) $(CPPFLAGS) $(MDIR1) $(MDIR2) $(CFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o mv $*.d dep/$*.d From f20865a5ea4ea7f5cdcbb6d19b0751a9390a8978 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Fri, 27 Mar 2026 11:45:32 +0800 Subject: [PATCH 2/2] Include mach-o/dyld.h for _NSGetExecutablePath on macOS driver/main.c uses _NSGetExecutablePath in the __APPLE__ code path but does not include the header that declares it, causing a build failure on macOS. Signed-off-by: Huang Rui --- driver/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver/main.c b/driver/main.c index a1d22b0ea..0fed62ee7 100644 --- a/driver/main.c +++ b/driver/main.c @@ -69,6 +69,9 @@ const char HELP[] = # include #endif #endif +#ifdef __APPLE__ +# include +#endif #include #ifdef HAVE_GETOPT_H