Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gdbstub dependency and enable parallel compilation for faster CI #494

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

visitorckw
Copy link
Collaborator

Fix a compilation error related to the missing gdbstub dependency in the Makefile when building with ENABLE_GDBSTUB=1, ensuring the gdbstub library is correctly compiled before the dependent source files to prevent missing header file issues. Additionally, it introduces parallel compilation using -j$(nproc) for both the default build and gdbstub tests, utilizing all available CPU cores to accelerate the build and testing processes, reducing CI execution time.

When compiling with ENABLE_GDBSTUB=1 using the command:

make ENABLE_GDBSTUB=1 -j$(nproc)

The following compilation error occurs:

In file included from src/syscall.c:14:
src/riscv_private.h:11:10: fatal error: mini-gdbstub/include/gdbstub.h: No such file or directory
   11 | #include "mini-gdbstub/include/gdbstub.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:213: build/syscall.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/softfloat.h:11,
                 from src/emulate.c:19:
src/riscv_private.h:11:10: fatal error: mini-gdbstub/include/gdbstub.h: No such file or directory
   11 | #include "mini-gdbstub/include/gdbstub.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:212: build/emulate.o] Error 1
In file included from src/riscv.c:28:
src/riscv_private.h:11:10: fatal error: mini-gdbstub/include/gdbstub.h: No such file or directory
   11 | #include "mini-gdbstub/include/gdbstub.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

The error is due to the improper handling of the gdbstub library
dependency in the Makefile. This patch ensures that the gdbstub library
is correctly compiled before source files that depend on it.
Parallel compilation with -j$(nproc) is introduced to the default build
and gdbstub tests. By utilizing all available CPU cores, this change
improves the speed of the build and testing process, reducing CI
execution time.
@jserv jserv merged commit a568e32 into sysprog21:master Sep 14, 2024
8 checks passed
@jserv
Copy link
Contributor

jserv commented Sep 14, 2024

Thank @visitorckw for contributing!

@jserv jserv added this to the release-2024.1 milestone Sep 14, 2024
@visitorckw visitorckw deleted the fix-gdbstub-build branch September 14, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants