mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 23:08:07 +00:00
acrnprobe: avoid race condition
main.c is compiled while version.h being generated. This will result following error: | main.c: In function 'main': | main.c:95:5: error: 'AP_MAJOR_VERSION' undeclared (first use in this function) | 95 | AP_MAJOR_VERSION, AP_MINOR_VERSION, | | ^~~~~~~~~~~~~~~~ | main.c:95:5: note: each undeclared identifier is reported only once for each function it appears in | main.c:95:23: error: 'AP_MINOR_VERSION' undeclared (first use in this function) | 95 | AP_MAJOR_VERSION, AP_MINOR_VERSION, | | ^~~~~~~~~~~~~~~~ | main.c:96:5: error: 'AP_BUILD_VERSION' undeclared (first use in this function) | 96 | AP_BUILD_VERSION, AP_BUILD_USER, | | ^~~~~~~~~~~~~~~~ | main.c:96:23: error: 'AP_BUILD_USER' undeclared (first use in this function) | 96 | AP_BUILD_VERSION, AP_BUILD_USER, | | ^~~~~~~~~~~~~ | main.c:97:5: error: 'AP_BUILD_TIME' undeclared (first use in this function) | 97 | AP_BUILD_TIME); | | ^~~~~~~~~~~~~ Similar issues observed with usercrash too. To fix this, add version.h header as dependency, to make sure it is generated successfully. Tracked-On: #4590 Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
This commit is contained in:
@@ -34,7 +34,7 @@ debugger: $(BUILDDIR)/usercrash/obj/debugger.o \
|
||||
$(BUILDDIR)/common/obj/strutils.o
|
||||
$(CC) -g $(CFLAGS) $(INCLUDE) $^ -o $(BUILDDIR)/usercrash/bin/$@ $(LIBS) $(LDFLAGS)
|
||||
|
||||
$(BUILDDIR)/usercrash/obj/%.o:%.c
|
||||
$(BUILDDIR)/usercrash/obj/%.o:%.c $(VERSION_H)
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
|
||||
|
||||
$(VERSION_H):
|
||||
|
Reference in New Issue
Block a user